summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/asm.h9
-rw-r--r--src/include/heap.h23
-rw-r--r--src/include/stdio.h6
-rw-r--r--src/include/string.h15
-rw-r--r--src/include/types.h8
5 files changed, 61 insertions, 0 deletions
diff --git a/src/include/asm.h b/src/include/asm.h
new file mode 100644
index 0000000..1d61b88
--- /dev/null
+++ b/src/include/asm.h
@@ -0,0 +1,9 @@
+#ifndef ASM_H
+#define ASM_H
+
+#include"types.h"
+
+extern uint8_t ioport_in(uint8_t port);
+extern void ioport_out(uint8_t port, char data);
+
+#endif
diff --git a/src/include/heap.h b/src/include/heap.h
new file mode 100644
index 0000000..2f66501
--- /dev/null
+++ b/src/include/heap.h
@@ -0,0 +1,23 @@
+#include"types.h"
+
+typedef struct _KHEAPBLOCKBM {
+ struct _KHEAPBLOCKBM *next;
+ uint32_t size;
+ uint32_t used;
+ uint32_t bsize;
+ uint32_t lfb;
+} KHEAPBLOCKBM;
+
+typedef struct _KHEAPBM {
+ KHEAPBLOCKBM *fblock;
+} KHEAPBM;
+
+void k_heapBMInit(KHEAPBM *heap);
+int k_heapBMAddBlock(KHEAPBM *heap, uintptr_t addr, uint32_t size, uint32_t bsize);
+void *k_heapBMAlloc(KHEAPBM *heap, uint32_t size);
+void k_heapBMFree(KHEAPBM *heap, void *ptr);
+
+extern KHEAPBM kheap;
+
+#define kmalloc k_heapBMAlloc
+#define kfree k_heapBMFree
diff --git a/src/include/stdio.h b/src/include/stdio.h
new file mode 100644
index 0000000..2d0aa8a
--- /dev/null
+++ b/src/include/stdio.h
@@ -0,0 +1,6 @@
+#ifndef STDIO_H
+#define STDIO_H
+
+void printf(char *str, ...);
+
+#endif
diff --git a/src/include/string.h b/src/include/string.h
new file mode 100644
index 0000000..500f545
--- /dev/null
+++ b/src/include/string.h
@@ -0,0 +1,15 @@
+#ifndef STRING_H
+#define STRING_H
+
+#include"types.h"
+
+size_t stringlen(char *str);
+bool stringcmp(char *str1,char *str2);
+void stringcat(char *str1,char *str2);
+void stringrev(char *str);
+void itos(uint32_t num,char *str);
+uint32_t stoi(const char *str);
+double stof(const char *str);
+void ftos(double num, char *str);
+
+#endif
diff --git a/src/include/types.h b/src/include/types.h
new file mode 100644
index 0000000..a6d6530
--- /dev/null
+++ b/src/include/types.h
@@ -0,0 +1,8 @@
+#ifndef TYPES_H
+#define TYPES_H
+
+#include<stdbool.h>
+#include<stddef.h>
+#include<stdint.h>
+
+#endif