mirror of
https://github.com/cfenollosa/os-tutorial.git
synced 2024-10-27 20:34:19 +00:00
Fixed alignment check of memory allocated by kmalloc.
This commit is contained in:
parent
7aff64740e
commit
7462dfc8f5
@ -20,7 +20,7 @@ u32 free_mem_addr = 0x10000;
|
||||
* keeps growing */
|
||||
u32 kmalloc(u32 size, int align, u32 *phys_addr) {
|
||||
/* Pages are aligned to 4K, or 0x1000 */
|
||||
if (align == 1 && (free_mem_addr & 0xFFFFF000)) {
|
||||
if (align == 1 && (free_mem_addr & 0x00000FFF)) {
|
||||
free_mem_addr &= 0xFFFFF000;
|
||||
free_mem_addr += 0x1000;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user