17 static const unsigned mempool_pages = 64*(1<<20)/PAGE_SIZE;
18 unsigned page_bitmap[mempool_pages/32];
20 bool is_page_allocated(
unsigned idx);
21 void mark_page_allocated(
unsigned idx,
bool allocated);
34 Kalloc (mword virt_begin, mword virt_end) : begin (virt_begin), end (virt_end) {}
36 void * alloc(
unsigned size);
38 void *
alloc_page (
unsigned count, Fill fill = NOFILL);
static void * phys2virt(mword)
Returns the virtual address that can be used to access memory with physical address phys.
Definition: kalloc.cc:92
static mword virt2phys(void *)
Return the physical address that is mapped from the virtual address virt (opposite of phys2virt).
Definition: kalloc.cc:98
void free_page(void *)
Free a page previously allocated with Kalloc::alloc_page().
Definition: kalloc.cc:82
void * alloc_page(unsigned count, Fill fill=NOFILL)
Allocate count virtually contiguous pages and optionally fill them with 0x00 or 0xFF.
Definition: kalloc.cc:46