fix: correction sur la réservation/liberation de mémoire physique (bitmap), limitation à 4Go de RAM en 32 bits
This commit is contained in:
parent
c91c2a1e45
commit
f04bb66ec8
10
lib/memory.c
10
lib/memory.c
|
@ -50,6 +50,10 @@ void bitmap_page_setused(u64 addr,u64 len)
|
||||||
u32 pagesrc=TOPAGE(addr);
|
u32 pagesrc=TOPAGE(addr);
|
||||||
if (len & 0b1111111111 > 0)
|
if (len & 0b1111111111 > 0)
|
||||||
nbpage++;
|
nbpage++;
|
||||||
|
if (addr>0xFFFFFFFF)
|
||||||
|
return;
|
||||||
|
if (len>0xFFFFFFFF)
|
||||||
|
len=0xFFFFFFFF;
|
||||||
for(u32 page=pagesrc;page<pagesrc+nbpage;page++)
|
for(u32 page=pagesrc;page<pagesrc+nbpage;page++)
|
||||||
bitmap_page_use(page);
|
bitmap_page_use(page);
|
||||||
}
|
}
|
||||||
|
@ -62,7 +66,11 @@ void bitmap_page_setfree(u64 addr,u64 len)
|
||||||
u32 nbpage=TOPAGE(len);
|
u32 nbpage=TOPAGE(len);
|
||||||
u32 pagesrc=TOPAGE(addr);
|
u32 pagesrc=TOPAGE(addr);
|
||||||
if (len & 0b1111111111 > 0)
|
if (len & 0b1111111111 > 0)
|
||||||
nbpage++;
|
nbpage++;
|
||||||
|
if (addr>0xFFFFFFFF)
|
||||||
|
return;
|
||||||
|
if (len>0xFFFFFFFF)
|
||||||
|
len=0xFFFFFFFF;
|
||||||
for(u32 page=pagesrc;page<pagesrc+nbpage;page++)
|
for(u32 page=pagesrc;page<pagesrc+nbpage;page++)
|
||||||
bitmap_page_free(page);
|
bitmap_page_free(page);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue