11 IMPLEMENT inline NEEDS [<cerrno>, <cstring>, <unistd.h>, <sys/mman.h>,
12 "boot_info.h", "config.h", "panic.h"]
14 Vmem_alloc::page_map (void *address, int order, Zero_fill zf, Address phys)
16 if (mmap (address, (1 << order) * Config::PAGE_SIZE,
17 PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED,
18 Boot_info::fd(), phys) == MAP_FAILED)
19 panic ("mmap error: %s", strerror (errno));
22 memset(address, 0, (1 << order) * Config::PAGE_SIZE);
25 IMPLEMENT inline NEEDS [<cerrno>, <cstring>, <unistd.h>, <sys/mman.h>,
26 "boot_info.h", "config.h", "panic.h"]
28 Vmem_alloc::page_unmap (void *address, int order)
30 if (munmap (address, (1 << order) * Config::PAGE_SIZE) != 0)
31 panic ("munmap error: %s", strerror (errno));