* Initialize the MemGuard mock allocator. All objects from MemGuard come * out of a single contiguous chunk of kernel address space that is managed * by a vmem arena. */
| 206 | * by a vmem arena. |
| 207 | */ |
| 208 | void |
| 209 | memguard_init(vmem_t *parent) |
| 210 | { |
| 211 | vm_offset_t base; |
| 212 | |
| 213 | vmem_alloc(parent, memguard_mapsize, M_BESTFIT | M_WAITOK, &base); |
| 214 | vmem_init(memguard_arena, "memguard arena", base, memguard_mapsize, |
| 215 | PAGE_SIZE, 0, M_WAITOK); |
| 216 | memguard_base = base; |
| 217 | |
| 218 | printf("MEMGUARD DEBUGGING ALLOCATOR INITIALIZED:\n"); |
| 219 | printf("\tMEMGUARD map base: 0x%lx\n", (u_long)base); |
| 220 | printf("\tMEMGUARD map size: %jd KBytes\n", |
| 221 | (uintmax_t)memguard_mapsize >> 10); |
| 222 | } |
| 223 | |
| 224 | /* |
| 225 | * Run things that can't be done as early as memguard_init(). |
no test coverage detected