Changeset View
Changeset View
Standalone View
Standalone View
head/sys/powerpc/include/vmparam.h
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
/* | /* | ||||
* Would like to have MAX addresses = 0, but this doesn't (currently) work | * Would like to have MAX addresses = 0, but this doesn't (currently) work | ||||
*/ | */ | ||||
#if !defined(LOCORE) | #if !defined(LOCORE) | ||||
#ifdef __powerpc64__ | #ifdef __powerpc64__ | ||||
#define VM_MIN_ADDRESS (0x0000000000000000UL) | #define VM_MIN_ADDRESS (0x0000000000000000UL) | ||||
#ifdef AIM | #define VM_MAXUSER_ADDRESS (0x3ffffffffffff000UL) | ||||
#define VM_MAXUSER_ADDRESS (0xfffffffffffff000UL) | |||||
#else | |||||
#define VM_MAXUSER_ADDRESS (0x7ffffffffffff000UL) | |||||
#endif | |||||
#define VM_MAX_ADDRESS (0xffffffffffffffffUL) | #define VM_MAX_ADDRESS (0xffffffffffffffffUL) | ||||
#else | #else | ||||
#define VM_MIN_ADDRESS ((vm_offset_t)0) | #define VM_MIN_ADDRESS ((vm_offset_t)0) | ||||
#define VM_MAXUSER_ADDRESS VM_MAXUSER_ADDRESS32 | #define VM_MAXUSER_ADDRESS VM_MAXUSER_ADDRESS32 | ||||
#define VM_MAX_ADDRESS ((vm_offset_t)0xffffffff) | #define VM_MAX_ADDRESS ((vm_offset_t)0xffffffff) | ||||
#endif | #endif | ||||
#define SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE) | #define SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE) | ||||
#else /* LOCORE */ | #else /* LOCORE */ | ||||
#ifdef BOOKE | #ifdef BOOKE | ||||
#define VM_MIN_ADDRESS 0 | #define VM_MIN_ADDRESS 0 | ||||
#ifdef __powerpc64__ | #ifdef __powerpc64__ | ||||
#define VM_MAXUSER_ADDRESS 0x7ffffffffffff000 | #define VM_MAXUSER_ADDRESS 0x3ffffffffffff000 | ||||
#else | #else | ||||
#define VM_MAXUSER_ADDRESS 0x7ffff000 | #define VM_MAXUSER_ADDRESS 0x7ffff000 | ||||
#endif | #endif | ||||
#endif | #endif | ||||
#endif /* LOCORE */ | #endif /* LOCORE */ | ||||
#define FREEBSD32_SHAREDPAGE (VM_MAXUSER_ADDRESS32 - PAGE_SIZE) | #define FREEBSD32_SHAREDPAGE (VM_MAXUSER_ADDRESS32 - PAGE_SIZE) | ||||
#define FREEBSD32_USRSTACK FREEBSD32_SHAREDPAGE | #define FREEBSD32_USRSTACK FREEBSD32_SHAREDPAGE | ||||
#ifdef __powerpc64__ | #ifdef __powerpc64__ | ||||
#ifdef AIM | |||||
#define VM_MIN_KERNEL_ADDRESS 0xe000000000000000UL | |||||
#define VM_MAX_KERNEL_ADDRESS 0xe0000001c7ffffffUL | |||||
#else | |||||
#define VM_MIN_KERNEL_ADDRESS 0xc000000000000000UL | #define VM_MIN_KERNEL_ADDRESS 0xc000000000000000UL | ||||
#define VM_MAX_KERNEL_ADDRESS 0xc0000001c7ffffffUL | #define VM_MAX_KERNEL_ADDRESS 0xc0000001c7ffffffUL | ||||
#endif | |||||
#define VM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS | #define VM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS | ||||
#endif | #endif | ||||
#ifdef AIM | #ifdef AIM | ||||
#define KERNBASE 0x00100100UL /* start of kernel virtual */ | #define KERNBASE 0x00100100UL /* start of kernel virtual */ | ||||
#ifndef __powerpc64__ | #ifndef __powerpc64__ | ||||
#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)KERNEL_SR << ADDR_SR_SHFT) | #define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)KERNEL_SR << ADDR_SR_SHFT) | ||||
▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | |||||
* the runtime-detected hw_direct_map to pick between the two cases. Our | * the runtime-detected hw_direct_map to pick between the two cases. Our | ||||
* friends in vm_machdep.c will do the same to ensure nothing gets confused. | * friends in vm_machdep.c will do the same to ensure nothing gets confused. | ||||
*/ | */ | ||||
#define SFBUF | #define SFBUF | ||||
#define SFBUF_NOMD | #define SFBUF_NOMD | ||||
/* | /* | ||||
* We (usually) have a direct map of all physical memory, so provide | * We (usually) have a direct map of all physical memory, so provide | ||||
* a macro to use to get the kernel VA address for a given PA. Returns | * a macro to use to get the kernel VA address for a given PA. Check the | ||||
* 0 if the direct map is unavailable. The location of the direct map | * value of PMAP_HAS_PMAP before using. | ||||
* may not be 1:1 in future, so use of the macro is recommended. | |||||
*/ | */ | ||||
#ifndef LOCORE | |||||
#ifdef __powerpc64__ | #ifdef __powerpc64__ | ||||
#define DMAP_BASE_ADDRESS 0x0000000000000000UL | #define DMAP_BASE_ADDRESS 0xc000000000000000UL | ||||
#define DMAP_MAX_ADDRESS 0xcfffffffffffffffUL | |||||
#else | #else | ||||
#define DMAP_BASE_ADDRESS 0x00000000UL | #define DMAP_BASE_ADDRESS 0x00000000UL | ||||
#define DMAP_MAX_ADDRESS 0xbfffffffUL | |||||
#endif | |||||
#endif | #endif | ||||
#define PMAP_HAS_DMAP (hw_direct_map) | #define PMAP_HAS_DMAP (hw_direct_map) | ||||
#define PHYS_TO_DMAP(x) ({ \ | #define PHYS_TO_DMAP(x) ({ \ | ||||
KASSERT(hw_direct_map, ("Direct map not provided by PMAP")); \ | KASSERT(hw_direct_map, ("Direct map not provided by PMAP")); \ | ||||
(x) | DMAP_BASE_ADDRESS; }) | (x) | DMAP_BASE_ADDRESS; }) | ||||
#define DMAP_TO_PHYS(x) ({ \ | #define DMAP_TO_PHYS(x) ({ \ | ||||
KASSERT(hw_direct_map, ("Direct map not provided by PMAP")); \ | KASSERT(hw_direct_map, ("Direct map not provided by PMAP")); \ | ||||
(x) &~ DMAP_BASE_ADDRESS; }) | (x) &~ DMAP_BASE_ADDRESS; }) | ||||
#endif /* _MACHINE_VMPARAM_H_ */ | #endif /* _MACHINE_VMPARAM_H_ */ |