Added macro for converting KB to blocks
This commit is contained in:
parent
585fe5b9cb
commit
5103ee5ede
|
@ -10,6 +10,10 @@
|
|||
#define IS_ALIGNED(addr, align) !((addr) & ~((align) - 1))
|
||||
#define ALIGN(addr, align) (((addr) & ~((align) - 1)) + (align))
|
||||
|
||||
/* Macros for converting between units of measure. */
|
||||
|
||||
#define KB_TO_BLOCKS(x) (((x) * 1024) / BLOCK_SIZE)
|
||||
|
||||
/*
|
||||
* Internal variables:
|
||||
*
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
void pmm_init(uint32_t pmmap_addr, size_t size) {
|
||||
|
||||
mem_size = size;
|
||||
max_blocks = (mem_size * 1024) / BLOCK_SIZE;
|
||||
max_blocks = KB_TO_BLOCKS(mem_size);
|
||||
used_blocks = max_blocks;
|
||||
pmmap = (uint32_t *) pmmap_addr;
|
||||
|
||||
|
|
Loading…
Reference in New Issue