diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2020-11-24 15:15:11 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2020-11-24 15:22:42 -0700 |
commit | ecbcb2509f4b811bce0a56e07de9737d14815251 (patch) | |
tree | f96492fb6db5d26c133dc3ab2993a9df3f224ea2 /src/kern/mem.c | |
parent | 351ff7059a5bacb322664412a8c62ee4640b33bf (diff) | |
download | stm32l4-ecbcb2509f4b811bce0a56e07de9737d14815251.tar.gz stm32l4-ecbcb2509f4b811bce0a56e07de9737d14815251.tar.bz2 stm32l4-ecbcb2509f4b811bce0a56e07de9737d14815251.zip |
Add better logging capabilities, including the ability to panic.
Diffstat (limited to 'src/kern/mem.c')
-rw-r--r-- | src/kern/mem.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/kern/mem.c b/src/kern/mem.c index ac90f0d..eb4527e 100644 --- a/src/kern/mem.c +++ b/src/kern/mem.c @@ -1,7 +1,9 @@ #include "kern/mem.h" #include "arch.h" + #include "kern/common.h" +#include "kern/panic.h" #ifdef ARCH_STM32L4 /* Provide a definition for memset() when not provided for the @@ -146,22 +148,6 @@ static void coalesce(kalloc_node_t* cur) last_freed->size = ((uint8_t*)next_used - (last_freed->mem)) / 4; } -#ifdef FOR_TESTING -#include <assert.h> -#include <stdio.h> -void panic(const char* x) -{ - fprintf(stderr, "%s\n", x); - assert(0); -} -#else -void panic(const char* x) -{ - for (;;) - ; -} -#endif - void kfree(void* mem) { /* Like normal free(), do nothing on free'ing NULL */ |