vm: explicitly initialise kmalloc in vm_bootstrap

if kmalloc is called with count=N before vm_bootstrap is finished,
the request will be fulfilled using memblock_alloc.

if N is a power of 2, the returned pointer will be aligned to
an N-byte boundary.
This commit is contained in:
2023-02-06 20:46:38 +00:00
parent fe0b7e043f
commit 0516ef06a3
3 changed files with 36 additions and 6 deletions

View File

@@ -234,6 +234,7 @@ extern void vm_cache_destroy(vm_cache_t *cache);
extern void *vm_cache_alloc(vm_cache_t *cache, vm_flags_t flags);
extern void vm_cache_free(vm_cache_t *cache, void *p);
extern void kmalloc_init(void);
extern void *kmalloc(size_t count, vm_flags_t flags);
extern void *kzalloc(size_t count, vm_flags_t flags);
extern void kfree(void *p);