1 /* $NetBSD: vmparam.h,v 1.15 2011/06/20 20:24:28 matt Exp $ */ 2 3 #ifndef _POWERPC_VMPARAM_H_ 4 #define _POWERPC_VMPARAM_H_ 5 6 #ifdef _KERNEL_OPT 7 #include "opt_modular.h" 8 #include "opt_ppcarch.h" 9 #include "opt_uvm.h" 10 #endif 11 12 /* 13 * These are common for BOOKE, IBM4XX, and OEA 14 */ 15 #define VM_FREELIST_DEFAULT 0 16 #define VM_FREELIST_FIRST256 1 17 #define VM_FREELIST_FIRST16 2 18 #define VM_NFREELIST 3 19 20 #define VM_PHYSSEG_MAX 16 21 22 /* 23 * The address to which unspecified mapping requests default 24 * Put the stack in it's own segment and start mmaping at the 25 * top of the next lower segment. 26 */ 27 #define __USE_TOPDOWN_VM 28 #define VM_DEFAULT_ADDRESS(da, sz) \ 29 ((VM_MAXUSER_ADDRESS - MAXSSIZ) - round_page(sz)) 30 31 #if defined(_MODULE) 32 /* 33 * If we are a module, then we need with varible page sizes since BOOKE and OEA 34 * use 4KB pages while IBM4XX use 16KB pages. 35 */ 36 #define MIN_PAGE_SIZE 4096 /* BOOKE/OEA */ 37 #define MAX_PAGE_SIZE 16384 /* IBM4XX */ 38 39 /* 40 * Some modules need some of the constants but those vary between the variants 41 * so those constants are exported as linker symbols so they don't take up any 42 * space but also avoid an extra load to put into a register. 43 */ 44 extern const char __USRSTACK; /* let the linker resolve it */ 45 46 #define USRSTACK ((vaddr_t)(uintptr_t)&__USRSTACK) 47 48 #else /* !_MODULE */ 49 50 #if defined(PPC_BOOKE) 51 #include <powerpc/booke/vmparam.h> 52 #elif defined(PPC_IBM4XX) 53 #include <powerpc/ibm4xx/vmparam.h> 54 #elif defined(PPC_OEA) || defined (PPC_OEA64) || defined (PPC_OEA64_BRIDGE) 55 #include <powerpc/oea/vmparam.h> 56 #else 57 #error unknown PPC variant 58 #endif 59 60 #endif /* !_MODULE */ 61 62 #if defined(MODULAR) || defined(_MODULAR) 63 /* 64 * If we are a module or support modules, we need to define a compatible 65 * pmap_physseg since IBM4XX uses one. This will waste a tiny of space 66 * but is needed for compatibility. 67 */ 68 #ifndef __HAVE_PMAP_PHYSSEG 69 #define __HAVE_PMAP_PHYSSEG 70 struct pmap_physseg { 71 uintptr_t pmseg_dummy[2]; 72 }; 73 #endif 74 75 __CTASSERT(sizeof(struct pmap_physseg) == sizeof(uintptr_t) * 2); 76 #endif /* MODULAR || _MODULE */ 77 78 #endif /* !_POWERPC_VMPARAM_H_ */ 79