X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/12293ed1d71cd306ed9a5d021a79ba945fe4e680..88875b2cc15a6f24c6ab0168a57df15ad8ab7179:/lunaix-os/kernel/mm/kalloc.c diff --git a/lunaix-os/kernel/mm/kalloc.c b/lunaix-os/kernel/mm/kalloc.c index d5116a2..ba00b09 100644 --- a/lunaix-os/kernel/mm/kalloc.c +++ b/lunaix-os/kernel/mm/kalloc.c @@ -62,14 +62,13 @@ lx_grow_heap(heap_context_t* heap, size_t sz); // FIXME: This should be per-process but not global! static heap_context_t kheap; -#define KHEAP_SIZE_MB 256 - int kalloc_init() { - kheap.start = &__kernel_heap_start; + kheap.start = KHEAP_START; kheap.brk = NULL; - kheap.max_addr = (void*)((uintptr_t)kheap.start + (KHEAP_SIZE_MB << 20)); + kheap.max_addr = + (void*)PROC_START; // 在新的布局中,堆结束的地方即为进程表开始的地方 for (size_t i = 0; i < KHEAP_SIZE_MB >> 2; i++) { vmm_set_mapping(PD_REFERENCED,