1*433d6423SLionel Sambuc 2*433d6423SLionel Sambuc #ifndef _VM_H 3*433d6423SLionel Sambuc #define _VM_H 1 4*433d6423SLionel Sambuc 5*433d6423SLionel Sambuc #define _SYSTEM 1 6*433d6423SLionel Sambuc 7*433d6423SLionel Sambuc /* Compile in asserts and custom sanity checks at all? */ 8*433d6423SLionel Sambuc #define SANITYCHECKS 0 9*433d6423SLionel Sambuc #define CACHE_SANITY 0 10*433d6423SLionel Sambuc #define VMSTATS 0 11*433d6423SLionel Sambuc 12*433d6423SLionel Sambuc /* VM behaviour */ 13*433d6423SLionel Sambuc #define MEMPROTECT 0 /* Slab objects not mapped. Access with USE() */ 14*433d6423SLionel Sambuc #define JUNKFREE 0 /* Fill freed pages with junk */ 15*433d6423SLionel Sambuc 16*433d6423SLionel Sambuc #include <sys/errno.h> 17*433d6423SLionel Sambuc 18*433d6423SLionel Sambuc #include "sanitycheck.h" 19*433d6423SLionel Sambuc #include "region.h" 20*433d6423SLionel Sambuc 21*433d6423SLionel Sambuc /* Memory flags to pt_allocmap() and alloc_mem(). */ 22*433d6423SLionel Sambuc #define PAF_CLEAR 0x01 /* Clear physical memory. */ 23*433d6423SLionel Sambuc #define PAF_CONTIG 0x02 /* Physically contiguous. */ 24*433d6423SLionel Sambuc #define PAF_ALIGN64K 0x04 /* Aligned to 64k boundary. */ 25*433d6423SLionel Sambuc #define PAF_LOWER16MB 0x08 26*433d6423SLionel Sambuc #define PAF_LOWER1MB 0x10 27*433d6423SLionel Sambuc #define PAF_ALIGN16K 0x40 /* Aligned to 16k boundary. */ 28*433d6423SLionel Sambuc 29*433d6423SLionel Sambuc #define MARK do { if(mark) { printf("%d\n", __LINE__); } } while(0) 30*433d6423SLionel Sambuc 31*433d6423SLionel Sambuc /* special value for v in pt_allocmap */ 32*433d6423SLionel Sambuc #define AM_AUTO ((u32_t) -1) 33*433d6423SLionel Sambuc 34*433d6423SLionel Sambuc /* How noisy are we supposed to be? */ 35*433d6423SLionel Sambuc #define VERBOSE 0 36*433d6423SLionel Sambuc #define LU_DEBUG 0 37*433d6423SLionel Sambuc 38*433d6423SLionel Sambuc /* Minimum stack region size - 64MB. */ 39*433d6423SLionel Sambuc #define MINSTACKREGION (64*1024*1024) 40*433d6423SLionel Sambuc 41*433d6423SLionel Sambuc /* If so, this level: */ 42*433d6423SLionel Sambuc #define SCL_NONE 0 /* No sanity checks - assert()s only. */ 43*433d6423SLionel Sambuc #define SCL_TOP 1 /* Main loop and other high-level places. */ 44*433d6423SLionel Sambuc #define SCL_FUNCTIONS 2 /* Function entry/exit. */ 45*433d6423SLionel Sambuc #define SCL_DETAIL 3 /* Detailled steps. */ 46*433d6423SLionel Sambuc #define SCL_MAX 3 /* Highest value. */ 47*433d6423SLionel Sambuc 48*433d6423SLionel Sambuc /* Type of page allocations. */ 49*433d6423SLionel Sambuc #define VMP_SPARE 0 50*433d6423SLionel Sambuc #define VMP_PAGETABLE 1 51*433d6423SLionel Sambuc #define VMP_PAGEDIR 2 52*433d6423SLionel Sambuc #define VMP_SLAB 3 53*433d6423SLionel Sambuc #define VMP_CATEGORIES 4 54*433d6423SLionel Sambuc 55*433d6423SLionel Sambuc /* Flags to pt_writemap(). */ 56*433d6423SLionel Sambuc #define WMF_OVERWRITE 0x01 /* Caller knows map may overwrite. */ 57*433d6423SLionel Sambuc #define WMF_WRITEFLAGSONLY 0x02 /* Copy physaddr and update flags. */ 58*433d6423SLionel Sambuc #define WMF_FREE 0x04 /* Free pages overwritten. */ 59*433d6423SLionel Sambuc #define WMF_VERIFY 0x08 /* Check pagetable contents. */ 60*433d6423SLionel Sambuc 61*433d6423SLionel Sambuc #define MAP_NONE 0xFFFFFFFE 62*433d6423SLionel Sambuc #define NO_MEM ((phys_clicks) MAP_NONE) /* returned by alloc_mem() with mem is up */ 63*433d6423SLionel Sambuc 64*433d6423SLionel Sambuc /* And what is the highest addressable piece of memory? */ 65*433d6423SLionel Sambuc #define VM_DATATOP kernel_boot_info.user_end 66*433d6423SLionel Sambuc #define VM_STACKTOP kernel_boot_info.user_sp 67*433d6423SLionel Sambuc 68*433d6423SLionel Sambuc #endif 69*433d6423SLionel Sambuc 70