|
|
1.1 root 1: /*
2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3: *
4: * @APPLE_LICENSE_HEADER_START@
5: *
6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7: * Reserved. This file contains Original Code and/or Modifications of
8: * Original Code as defined in and that are subject to the Apple Public
9: * Source License Version 1.1 (the "License"). You may not use this file
10: * except in compliance with the License. Please obtain a copy of the
11: * License at http://www.apple.com/publicsource and read it before using
12: * this file.
13: *
14: * The Original Code and all software distributed under the License are
15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19: * License for the specific language governing rights and limitations
20: * under the License.
21: *
22: * @APPLE_LICENSE_HEADER_END@
23: */
24:
25: /* Things that don't need to be exported from pmap. Putting
26: * them here and not in pmap.h avoids major recompiles when
27: * modifying something either here or in proc_reg.h
28: */
29:
30: #ifndef _PMAP_INTERNALS_H_
31: #define _PMAP_INTERNALS_H_
32:
33: /* #include <mach/vm_types.h> */
34: #include <mach/machine/vm_types.h>
35: #include <mach/vm_prot.h>
36: #include <mach/vm_statistics.h>
37: #include <kern/queue.h>
38: #include <machdep/ppc/proc_reg.h>
39:
40: /* Page table entries are stored in groups (PTEGS) in a hash table */
41:
42: #if __PPC__
43: #if _BIG_ENDIAN == 0
44: error - bitfield structures are not checked for bit ordering in words
45: #endif /* _BIG_ENDIAN */
46: #endif /* __PPC__ */
47:
48: /*
49: * Don't change these structures unless you change the assembly code in
50: * locore.s
51: */
52: struct mapping {
53: queue_head_t phys_link; /* for mappings of a given PA */
54:
55: union {
56: unsigned int word;
57: struct {
58: vm_offset_t page:28;/* virtual page number */
59: unsigned int wired:1; /* boolean */
60: unsigned int phys:1; /* boolean */
61: unsigned int :0;
62: } bits;
63: } vm_info;
64:
65: pte_t *pte; /* pointer to pte in hash table */
66: struct pmap *pmap; /* pmap mapping belongs to */
67: };
68:
69: #define MAPPING_NULL ((struct mapping *) 0)
70:
71: struct phys_entry {
72: queue_head_t phys_link; /* head of mappings of a given PA */
73: pte1_t pte1; /* referenced/changed/wimg info */
74: };
75:
76: #define PHYS_NULL ((struct phys_entry *)0)
77:
78: /* Memory may be non-contiguous. This data structure contains info
79: * for mapping this non-contiguous space into the contiguous
80: * physical->virtual mapping tables. An array of this type is
81: * provided to the pmap system at bootstrap by ppc_vm_init.
82: *
83: * NB : regions must be in order in this structure.
84: */
85:
86: typedef struct pmap_mem_region {
87: vm_offset_t start; /* Address of base of region */
88: struct phys_entry *phys_table; /* base of region's table */
89: unsigned int end; /* End address+1 */
90: } pmap_mem_region_t;
91:
92: /* MEM_REGION_MAX has a PowerMac dependancy - at least the value of
93: * kMaxRAMBanks in ppc/POWERMAC/nkinfo.h
94: */
95: #define MEM_REGION_MAX 26
96:
97: extern pmap_mem_region_t pmap_mem_regions[MEM_REGION_MAX];
98: extern int pmap_mem_regions_count;
99:
100: /* keep track of free regions of physical memory so that we can offer
101: * them up via pmap_next_page later on
102: */
103:
104: #define FREE_REGION_MAX 8
105: extern pmap_mem_region_t free_regions[FREE_REGION_MAX];
106: extern int free_regions_count;
107:
108: /* Prototypes */
109:
110: struct phys_entry *pmap_find_physentry(vm_offset_t pa);
111:
112: extern pte_t *pmap_pteg_overflow(pte_t *primary_hash, pte0_t primary_match,
113: pte_t *secondary_hash, pte0_t secondary_key);
114:
115: #endif /* _PMAP_INTERNALS_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.