]> git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/ppc/vm_param.h
xnu-792.2.4.tar.gz
[apple/xnu.git] / osfmk / mach / ppc / vm_param.h
1
2 /*
3 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
4 *
5 * @APPLE_LICENSE_HEADER_START@
6 *
7 * The contents of this file constitute Original Code as defined in and
8 * are subject to the Apple Public Source License Version 1.1 (the
9 * "License"). You may not use this file except in compliance with the
10 * License. Please obtain a copy of the License at
11 * http://www.apple.com/publicsource and read it before using this file.
12 *
13 * This Original Code and all software distributed under the License are
14 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
18 * License for the specific language governing rights and limitations
19 * under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /*
24 * @OSF_COPYRIGHT@
25 */
26
27 #ifndef _MACH_PPC_VM_PARAM_H_
28 #define _MACH_PPC_VM_PARAM_H_
29
30 /*
31 * These are the global definitions
32 */
33
34 #define BYTE_SIZE 8 /* byte size in bits */
35
36 #define PPC_PGBYTES 4096 /* bytes per ppc page */
37 #define PPC_PGSHIFT 12 /* number of bits to shift for pages */
38
39 #define PAGE_SIZE PPC_PGBYTES
40 #define PAGE_SHIFT PPC_PGSHIFT
41 #define PAGE_MASK (PAGE_SIZE - 1)
42
43 #if 0
44 #define VM_MAX_PAGE_ADDRESS 0xFFFFFFFFFFFFF000ULL
45 #else
46 /*
47 * LP64todo - For now, we are limited to 51-bits of user addressing
48 */
49 #define VM_MAX_PAGE_ADDRESS 0x0007FFFFFFFFF000ULL
50 #endif
51
52 #define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0)
53 #define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_PAGE_ADDRESS)
54
55 /*
56 * These are the values relative to the local process.
57 */
58 #if defined (__ppc64__)
59 /*
60 * LP64todo - We don't have the 64-bit address space layout yet.
61 * Use the 32-bit stack layout for now.
62 */
63 #define VM_MIN_ADDRESS ((vm_offset_t) MACH_VM_MIN_ADDRESS)
64 #define VM_MAX_ADDRESS ((vm_offset_t) MACH_VM_MAX_ADDRESS)
65 #define USER_STACK_END ((vm_offset_t) 0x00000000ffff0000ULL)
66 #else
67 #define VM_MIN_ADDRESS ((vm_offset_t) 0)
68 #define VM_MAX_ADDRESS ((vm_offset_t) (VM_MAX_PAGE_ADDRESS & 0xFFFFFFFF))
69 #define USER_STACK_END ((vm_offset_t) 0xffff0000U)
70 #endif /* defined(__ppc64__) */
71
72 #ifdef KERNEL_PRIVATE
73
74 /* Kernel-wide values */
75 #define VM_MIN_KERNEL_ADDRESS ((vm_offset_t) 0x00001000)
76 #define VM_MAX_KERNEL_ADDRESS ((vm_offset_t) 0xDFFFFFFF)
77 #define KERNEL_STACK_SIZE (4 * PPC_PGBYTES)
78 #define INTSTACK_SIZE (5 * PPC_PGBYTES)
79
80 #define VM_MAP_MIN_ADDRESS MACH_VM_MIN_ADDRESS
81 #define VM_MAP_MAX_ADDRESS MACH_VM_MAX_ADDRESS
82
83 #ifdef MACH_KERNEL_PRIVATE
84
85 /* For implementing legacy 32-bit interfaces */
86 #define VM32_SUPPORT
87 #define VM32_MIN_ADDRESS ((vm32_offset_t) 0)
88 #define VM32_MAX_ADDRESS ((vm32_offset_t) (VM_MAX_PAGE_ADDRESS & 0xFFFFFFFF))
89
90 #endif /* MACH_KERNEL_PRIVATE */
91
92 #endif /* KERNEL_PRIVATE */
93
94 #endif /* _MACH_PPC_VM_PARAM_H_ */