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