From 7b91c46a8ebf38b2c1c80c1f1e63c4d4dfd10640 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Fri, 4 Feb 2022 10:41:24 +0000 Subject: header reworking, beginning memory.c refactoring --- kc/core/Makefile | 3 ++- kc/core/kcc_memory.c | 16 ++++++++++++++++ kc/core/memory.c | 2 +- kc/reloc_x86_64.c | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 kc/core/kcc_memory.c (limited to 'kc') 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_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 -#include +#include /* 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 +#include #include -- cgit v1.3.1-1-g115d