7 /* Compile in asserts and custom sanity checks at all? */
13 #define MEMPROTECT 0 /* Slab objects not mapped. Access with USE() */
14 #define JUNKFREE 0 /* Fill freed pages with junk */
16 #include <sys/errno.h>
18 #include "sanitycheck.h"
21 /* Memory flags to pt_allocmap() and alloc_mem(). */
22 #define PAF_CLEAR 0x01 /* Clear physical memory. */
23 #define PAF_CONTIG 0x02 /* Physically contiguous. */
24 #define PAF_ALIGN64K 0x04 /* Aligned to 64k boundary. */
25 #define PAF_LOWER16MB 0x08
26 #define PAF_LOWER1MB 0x10
27 #define PAF_ALIGN16K 0x40 /* Aligned to 16k boundary. */
29 #define MARK do { if(mark) { printf("%d\n", __LINE__); } } while(0)
31 /* special value for v in pt_allocmap */
32 #define AM_AUTO ((u32_t) -1)
34 /* How noisy are we supposed to be? */
38 /* Minimum stack region size - 64MB. */
39 #define MINSTACKREGION (64*1024*1024)
41 /* If so, this level: */
42 #define SCL_NONE 0 /* No sanity checks - assert()s only. */
43 #define SCL_TOP 1 /* Main loop and other high-level places. */
44 #define SCL_FUNCTIONS 2 /* Function entry/exit. */
45 #define SCL_DETAIL 3 /* Detailled steps. */
46 #define SCL_MAX 3 /* Highest value. */
48 /* Type of page allocations. */
50 #define VMP_PAGETABLE 1
53 #define VMP_CATEGORIES 4
55 /* Flags to pt_writemap(). */
56 #define WMF_OVERWRITE 0x01 /* Caller knows map may overwrite. */
57 #define WMF_WRITEFLAGSONLY 0x02 /* Copy physaddr and update flags. */
58 #define WMF_FREE 0x04 /* Free pages overwritten. */
59 #define WMF_VERIFY 0x08 /* Check pagetable contents. */
61 #define MAP_NONE 0xFFFFFFFE
62 #define NO_MEM ((phys_clicks) MAP_NONE) /* returned by alloc_mem() with mem is up */
64 /* And what is the highest addressable piece of memory? */
65 #define VM_DATATOP kernel_boot_info.user_end
67 #define VM_STACKTOP kernel_boot_info.user_sp
69 /* Live update will work only with magic instrumentation. Live update requires
70 * strict separation of regions within the process to succeed. Therefore,
71 * apply this strict separation only if magic instrumentation is used.
72 * Otherwise, do not place such limitations on processes.
75 #define VM_MMAPTOP (VM_STACKTOP-DEFAULT_STACK_LIMIT)
76 #define VM_MMAPBASE (VM_MMAPTOP/2)
78 #define VM_MMAPTOP VM_DATATOP
79 #define VM_MMAPBASE VM_PAGE_SIZE
83 #define VM_OWN_HEAPSTART ((vir_bytes) (&_end))
84 #define VM_OWN_HEAPBASE roundup(VM_OWN_HEAPSTART, VM_PAGE_SIZE)
85 #define VM_OWN_MMAPBASE (VM_OWN_HEAPBASE+1024*1024*1024)
86 #define VM_OWN_MMAPTOP (VM_OWN_MMAPBASE+100 * 1024 * 1024)