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