summaryrefslogtreecommitdiff
path: root/kc
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2022-02-04 10:41:24 +0000
committerAda Christine <adachristine18@gmail.com>2022-02-04 10:41:24 +0000
commit7b91c46a8ebf38b2c1c80c1f1e63c4d4dfd10640 (patch)
treed1ecf22568d6de100c5dce601b8166c8abbae2b7 /kc
parentf0c062df0c2a674d67af12eb5e18f22bd8412c15 (diff)
header reworking, beginning memory.c refactoring
Diffstat (limited to 'kc')
-rw-r--r--kc/core/Makefile3
-rw-r--r--kc/core/kcc_memory.c16
-rw-r--r--kc/core/memory.c2
-rw-r--r--kc/reloc_x86_64.c2
4 files changed, 20 insertions, 3 deletions
diff --git a/kc/core/Makefile b/kc/core/Makefile
index 7458ba5..b0f4035 100644
--- a/kc/core/Makefile
+++ b/kc/core/Makefile
@@ -12,7 +12,8 @@ CFLAGS += -Wno-unused-const-variable -Wno-unused-function -fvisibility=hidden -g
SOBJS :=
GOBJS := entry_x86_64.o reloc_x86_64.o kprint.o serial.o port.o \
kc_main.o main.o memory.o memset.o memcpy.o memmove.o memcmp.o cpu.o \
- vm_tree.o exceptions.o panic.o msr.o task.o cpu_task.o
+ vm_tree.o exceptions.o panic.o msr.o task.o cpu_task.o \
+ kcc_memory.o
IOBJS :=
# __attribute__((interrupt)) requires -mgeneral-regs-only
diff --git a/kc/core/kcc_memory.c b/kc/core/kcc_memory.c
new file mode 100644
index 0000000..68aa1d4
--- /dev/null
+++ b/kc/core/kcc_memory.c
@@ -0,0 +1,16 @@
+#include "memory.h"
+
+#include <kc/core/memory.h>
+
+KC_EXPORT
+kc_phys_addr kcc_page_alloc(void)
+{
+ return page_alloc();
+}
+
+KC_EXPORT
+void kcc_page_free(kc_phys_addr page)
+{
+ page_free(page);
+}
+
diff --git a/kc/core/memory.c b/kc/core/memory.c
index 2d5dd75..634c3b3 100644
--- a/kc/core/memory.c
+++ b/kc/core/memory.c
@@ -6,7 +6,7 @@
#include <stdint.h>
-#include <kernel/component.h>
+#include <kc/kc.h>
/* kernel virtual space guarantees
*
diff --git a/kc/reloc_x86_64.c b/kc/reloc_x86_64.c
index 0204700..dfc6df6 100644
--- a/kc/reloc_x86_64.c
+++ b/kc/reloc_x86_64.c
@@ -1,4 +1,4 @@
-#include <kernel/component.h>
+#include <kc/kc.h>
#include <elf/elf64.h>