summaryrefslogtreecommitdiff
path: root/kmalloc.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-10-27 19:39:54 +0200
committerAnton Kling <anton@kling.gg>2023-10-30 21:49:48 +0100
commit715274d3a77c58510b97c3f87cd604dde9de7a4f (patch)
treef3f71248419f3395badc1b3bd9f64bd63dc3ae8c /kmalloc.c
parent8eede5fd642db2c56a1f5185973815fbd2b0afa4 (diff)
Kernel: Move min, max functions to their own file
Diffstat (limited to 'kmalloc.c')
-rw-r--r--kmalloc.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/kmalloc.c b/kmalloc.c
index f3c8238..34c466d 100644
--- a/kmalloc.c
+++ b/kmalloc.c
@@ -1,6 +1,7 @@
#include <assert.h>
#include <kmalloc.h>
#include <ksbrk.h>
+#include <math.h>
#define NEW_ALLOC_SIZE 0x30000
#define IS_FREE (1 << 0)
@@ -13,10 +14,6 @@ typedef struct MallocHeader {
struct MallocHeader *n;
} MallocHeader;
-size_t max(size_t a, size_t b) { return (a > b) ? a : b; }
-
-size_t min(size_t a, size_t b) { return (a < b) ? a : b; }
-
uint64_t delta_page(uint64_t a) { return 0x1000 - (a % 0x1000); }
MallocHeader *head = NULL;