aboutsummaryrefslogtreecommitdiff
path: root/kernel/libk
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/libk')
-rw-r--r--kernel/libk/liballoc.c (renamed from kernel/libk/liballoc.cc)17
-rw-r--r--kernel/libk/memset.c (renamed from kernel/libk/memset.cc)0
-rw-r--r--kernel/libk/printf.c (renamed from kernel/libk/printf.cc)0
-rw-r--r--kernel/libk/printk.c (renamed from kernel/libk/printk.cc)12
-rw-r--r--kernel/libk/strlen.c (renamed from kernel/libk/strlen.cc)0
5 files changed, 12 insertions, 17 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;
}
-
-}
diff --git a/kernel/libk/memset.cc b/kernel/libk/memset.c
index ab0bc27..ab0bc27 100644
--- a/kernel/libk/memset.cc
+++ b/kernel/libk/memset.c
diff --git a/kernel/libk/printf.cc b/kernel/libk/printf.c
index cacb338..cacb338 100644
--- a/kernel/libk/printf.cc
+++ b/kernel/libk/printf.c
diff --git a/kernel/libk/printk.cc b/kernel/libk/printk.c
index c6a1496..f97fa1c 100644
--- a/kernel/libk/printk.cc
+++ b/kernel/libk/printk.c
@@ -32,11 +32,11 @@ printk(const char *from, const char *msg, ...)
vsnprintf(str, sizeof(str), msg, ap);
va_end(ap);
- Serial::write_string("\033[33m");
- Serial::write_string(from);
- Serial::write_string(":\033[0m ");
- Serial::write_string(str);
- Serial::write_string("\033[0m\n");
+ serial_write_string("\033[33m");
+ serial_write_string(from);
+ serial_write_string(":\033[0m ");
+ serial_write_string(str);
+ serial_write_string("\033[0m\n");
}
void
@@ -50,5 +50,5 @@ printk_raw(const char *msg, ...)
vsnprintf(str, sizeof(str), msg, ap);
va_end(ap);
- Serial::write_string(str);
+ serial_write_string(str);
}
diff --git a/kernel/libk/strlen.cc b/kernel/libk/strlen.c
index 8e2cf7d..8e2cf7d 100644
--- a/kernel/libk/strlen.cc
+++ b/kernel/libk/strlen.c