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