diff options
Diffstat (limited to '')
| -rw-r--r-- | kernel/libk/liballoc.c (renamed from kernel/libk/liballoc.cc) | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/kernel/libk/liballoc.cc b/kernel/libk/liballoc.c index 333b1b5..d8f220e 100644 --- a/kernel/libk/liballoc.cc +++ b/kernel/libk/liballoc.c @@ -22,15 +22,12 @@ #include <mm/virtual_mm.h> #include <stddef.h> -namespace LibAlloc -{ - -Spinlock lock; +spinlock_t lock; -#define liballoc_lock lock.acquire -#define liballoc_unlock lock.release -#define liballoc_alloc VirtualMM::alloc_pages -#define liballoc_free VirtualMM::free_pages +#define liballoc_lock() spinlock_acquire(&lock) +#define liballoc_unlock() spinlock_release(&lock) +#define liballoc_alloc vmm_alloc_pages +#define liballoc_free vmm_free_pages #define LIBALLOC_MAGIC 0xc001c0de #define MAXCOMPLETE 5 @@ -216,7 +213,7 @@ allocate_new_tag(unsigned int size) if (pages < l_pageCount) pages = l_pageCount; - tag = (struct boundary_tag *) liballoc_alloc(pages); + tag = (struct boundary_tag *) vmm_alloc_pages(pages); if (tag == NULL) return NULL; // uh oh, we ran out of memory. @@ -451,5 +448,3 @@ krealloc(void *p, size_t size) return ptr; } - -} |
