git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: false positive when looking for room to host pmem_list
[lunaix-os.git]
/
lunaix-os
/
arch
/
x86
/
mm
/
pmm.c
diff --git
a/lunaix-os/arch/x86/mm/pmm.c
b/lunaix-os/arch/x86/mm/pmm.c
index aa35b86b99b4e167ef1a8efa36348e91760b38eb..8f350f426e90b0f7f502e4f5c8e89034f9f0db78 100644
(file)
--- a/
lunaix-os/arch/x86/mm/pmm.c
+++ b/
lunaix-os/arch/x86/mm/pmm.c
@@
-17,8
+17,10
@@
pmm_arch_init_remap(struct pmem* memory, struct boot_handoff* bctx)
size_t i = 0;
struct boot_mmapent* ent;
size_t i = 0;
struct boot_mmapent* ent;
- for (; i < bctx->mem.mmap_len; i++) {
- ent = &bctx->mem.mmap[i];
+
+restart:;
+ while (i < bctx->mem.mmap_len) {
+ ent = &bctx->mem.mmap[i++];
if (free_memregion(ent) && ent->size > pool_size) {
goto found;
}
if (free_memregion(ent) && ent->size > pool_size) {
goto found;
}
@@
-38,7
+40,7
@@
found:;
#endif
if (aligned_pplist + pool_size > ent->start + ent->size) {
#endif
if (aligned_pplist + pool_size > ent->start + ent->size) {
-
return 0
;
+
goto restart
;
}
// for x86_32, the upper bound of memory requirement for pplist
}
// for x86_32, the upper bound of memory requirement for pplist