Fixed pmmap_size
This commit is contained in:
parent
b282cc9872
commit
d49e750c18
|
@ -1,9 +1,9 @@
|
|||
#ifndef PMM_INTERNALS_H_
|
||||
#define PMM_INTERNALS_H_
|
||||
|
||||
#define BLOCKS_PER_BYTE 8
|
||||
#define BLOCK_SIZE 4096
|
||||
#define BLOCK_ALIGN BLOCK_SIZE
|
||||
#define BLOCKS_PER_DWORD 32
|
||||
#define BLOCK_SIZE 4096
|
||||
#define BLOCK_ALIGN BLOCK_SIZE
|
||||
|
||||
/* Macros for testing and aligning memory. */
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ void pmm_init(uint32_t pmmap_addr, size_t size) {
|
|||
used_blocks = max_blocks;
|
||||
pmmap = (uint32_t *) pmmap_addr;
|
||||
|
||||
pmmap_size = mem_size / BLOCKS_PER_BYTE;
|
||||
if (mem_size % BLOCKS_PER_BYTE)
|
||||
pmmap_size = max_blocks / BLOCKS_PER_DWORD;
|
||||
if (max_blocks % BLOCKS_PER_DWORD)
|
||||
pmmap_size++;
|
||||
|
||||
memset(pmmap, 0xFF, pmmap_size);
|
||||
|
|
Loading…
Reference in New Issue