|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * The contents of this file constitute Original Code as defined in and ! 7: * are subject to the Apple Public Source License Version 1.1 (the ! 8: * "License"). You may not use this file except in compliance with the ! 9: * License. Please obtain a copy of the License at ! 10: * http://www.apple.com/publicsource and read it before using this file. ! 11: * ! 12: * This Original Code and all software distributed under the License are ! 13: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 14: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 15: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 16: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 17: * License for the specific language governing rights and limitations ! 18: * under the License. ! 19: * ! 20: * @APPLE_LICENSE_HEADER_END@ ! 21: */ ! 22: /* ! 23: * @OSF_COPYRIGHT@ ! 24: */ ! 25: /* ! 26: * Copyright (c) 1990 The University of Utah and ! 27: * the Center for Software Science at the University of Utah (CSS). ! 28: * All rights reserved. ! 29: * ! 30: * Permission to use, copy, modify and distribute this software is hereby ! 31: * granted provided that (1) source code retains these copyright, permission, ! 32: * and disclaimer notices, and (2) redistributions including binaries ! 33: * reproduce the notices in supporting documentation, and (3) all advertising ! 34: * materials mentioning features or use of this software display the following ! 35: * acknowledgement: ``This product includes software developed by the Center ! 36: * for Software Science at the University of Utah.'' ! 37: * ! 38: * THE UNIVERSITY OF UTAH AND CSS ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS ! 39: * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSS DISCLAIM ANY LIABILITY OF ! 40: * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. ! 41: * ! 42: * CSS requests users of this software to return to [email protected] any ! 43: * improvements that they make and grant CSS redistribution rights. ! 44: * ! 45: * Utah $Hdr: pmap.h 1.13 91/09/25$ ! 46: * Author: Mike Hibler, Bob Wheeler, University of Utah CSS, 9/90 ! 47: */ ! 48: ! 49: #ifndef _PPC_PMAP_H_ ! 50: #define _PPC_PMAP_H_ ! 51: ! 52: #include <mach/vm_types.h> ! 53: #include <mach/machine/vm_types.h> ! 54: #include <mach/vm_prot.h> ! 55: #include <mach/vm_statistics.h> ! 56: #include <kern/queue.h> ! 57: ! 58: ! 59: struct pmap { ! 60: queue_head_t pmap_link; /* MUST BE FIRST */ ! 61: decl_simple_lock_data(,lock) /* lock on map */ ! 62: int ref_count; /* reference count */ ! 63: space_t space; /* space for this pmap */ ! 64: struct pmap_statistics stats; /* statistics */ ! 65: }; ! 66: ! 67: #define PMAP_SWITCH_USER(th, map, my_cpu) th->map = map; ! 68: ! 69: #define PMAP_ACTIVATE(pmap, th, cpu) ! 70: #define PMAP_DEACTIVATE(pmap, th, cpu) ! 71: #define PMAP_CONTEXT(pmap,th) ! 72: ! 73: #define pmap_kernel_va(VA) \ ! 74: (((VA) >= VM_MIN_KERNEL_ADDRESS) && ((VA) <= VM_MAX_KERNEL_ADDRESS)) ! 75: ! 76: #define PPC_SID_KERNEL 0 /* Must change KERNEL_SEG_REG0_VALUE if !0 */ ! 77: #define SID_MAX ((1<<20) - 1) /* Space ID=20 bits, segment_id=SID + 4 bits */ ! 78: ! 79: #define pmap_resident_count(pmap) ((pmap)->stats.resident_count) ! 80: #define pmap_remove_attributes(pmap,start,end) ! 81: #define pmap_copy(dpmap,spmap,da,len,sa) ! 82: #define pmap_update() ! 83: ! 84: #define pmap_phys_address(x) ((x) << PPC_PGSHIFT) ! 85: #define pmap_phys_to_frame(x) ((x) >> PPC_PGSHIFT) ! 86: ! 87: /* ! 88: * prototypes. ! 89: */ ! 90: extern void ppc_protection_init(void); ! 91: extern vm_offset_t phystokv(vm_offset_t pa); /* Get kernel virtual address from physical */ ! 92: extern vm_offset_t kvtophys(vm_offset_t va); /* Get physical address from kernel virtual */ ! 93: extern vm_offset_t pmap_map(vm_offset_t va, ! 94: vm_offset_t spa, ! 95: vm_offset_t epa, ! 96: vm_prot_t prot); ! 97: extern kern_return_t pmap_add_physical_memory(vm_offset_t spa, ! 98: vm_offset_t epa, ! 99: boolean_t available, ! 100: unsigned int attr); ! 101: extern vm_offset_t pmap_map_bd(vm_offset_t va, ! 102: vm_offset_t spa, ! 103: vm_offset_t epa, ! 104: vm_prot_t prot); ! 105: extern void pmap_bootstrap(unsigned int mem_size, ! 106: vm_offset_t *first_avail, ! 107: vm_offset_t *first_phys_avail, unsigned int kmapsize); ! 108: extern void pmap_block_map(vm_offset_t pa, ! 109: vm_size_t size, ! 110: vm_prot_t prot, ! 111: int entry, ! 112: int dtlb); ! 113: extern void pmap_remove_all(vm_offset_t pa); ! 114: ! 115: extern boolean_t pmap_verify_free(vm_offset_t pa); ! 116: extern void pmap_move_page(unsigned long from, unsigned long to, vm_size_t size); ! 117: extern void sync_cache(vm_offset_t pa, unsigned length); ! 118: extern void flush_dcache(vm_offset_t va, unsigned length, boolean_t phys); ! 119: extern void invalidate_dcache(vm_offset_t va, unsigned length, boolean_t phys); ! 120: extern void invalidate_icache(vm_offset_t va, unsigned length, boolean_t phys); ! 121: extern void invalidate_cache_for_io(vm_offset_t va, unsigned length, boolean_t phys); ! 122: ! 123: #endif /* _PPC_PMAP_H_ */ ! 124:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.