aboutsummaryrefslogtreecommitdiff
path: root/include/kern
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2020-12-06 02:00:43 -0700
committerJosh Rahm <joshuarahm@gmail.com>2020-12-06 02:00:43 -0700
commit1710871aa1958c2cac38e4b372964ef22032ed4a (patch)
tree259bcbae2f5d1c93877c74ed53ff9d2169f1ee15 /include/kern
parentd29ea8d7fb8cc6f7c3dda1cbca6266908acd4291 (diff)
downloadstm32l4-1710871aa1958c2cac38e4b372964ef22032ed4a.tar.gz
stm32l4-1710871aa1958c2cac38e4b372964ef22032ed4a.tar.bz2
stm32l4-1710871aa1958c2cac38e4b372964ef22032ed4a.zip
Added header files implementing a basic AVL tree and Map based off it.
These headers take inspiration from the linked list and array list headers as a way to provide primitive templates in C. This time they implement an AVL tree and Map template (which uses the AVL tree). Included are relatively robust tests, though they could be improved.
Diffstat (limited to 'include/kern')
-rw-r--r--include/kern/common.h1
-rw-r--r--include/kern/mem.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/include/kern/common.h b/include/kern/common.h
index 021229b..0acc9d3 100644
--- a/include/kern/common.h
+++ b/include/kern/common.h
@@ -39,6 +39,7 @@ typedef enum { ENDIANNESS_LITTLE, ENDIANNESS_BIG } endianness_t;
#define ptr2reg(ptr) ((uint32_t)(ptrdiff_t)(ptr))
typedef __IO uint32_t bits_t;
+typedef uint16_t msize_t;
#define regset(reg, mask, val) ((reg) = ((reg) & ~mask) | (val << CTZ(mask)))
diff --git a/include/kern/mem.h b/include/kern/mem.h
index 20b09bb..bc6c4e2 100644
--- a/include/kern/mem.h
+++ b/include/kern/mem.h
@@ -22,6 +22,8 @@ int debug_kalloc_assert_consistency(char* error, size_t len);
void debug_print_blocks();
+int debug_is_heap_empty();
+
#endif