aboutsummaryrefslogtreecommitdiff
path: root/kernel/include
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2014-12-07 11:49:52 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2014-12-07 11:49:52 +0100
commitd7aaba8c85cc71f3184cddcf20b740c5157c864d (patch)
treed99c9d6765eb433c73498c5e99ebcdb088c0e7e6 /kernel/include
parent26b68c108664cb54089613bdbc54624ed66f7fda (diff)
downloadmacroscope-d7aaba8c85cc71f3184cddcf20b740c5157c864d.tar.gz
macroscope-d7aaba8c85cc71f3184cddcf20b740c5157c864d.zip
Refactor kmalloc & tests in kmain.
Diffstat (limited to 'kernel/include')
-rw-r--r--kernel/include/idt.h2
-rw-r--r--kernel/include/kmalloc.h14
2 files changed, 16 insertions, 0 deletions
diff --git a/kernel/include/idt.h b/kernel/include/idt.h
index b697dc3..9415c8e 100644
--- a/kernel/include/idt.h
+++ b/kernel/include/idt.h
@@ -58,6 +58,8 @@
#define EX_INTEL_RESERVED_13 30 // No
#define EX_INTEL_RESERVED_14 31 // No
+#define EFLAGS_IF (0x1 << 9)
+
struct registers {
uint32_t ds; // Data segment selector
uint32_t edi, esi, ebp, useless_esp, ebx, edx, ecx, eax; // Pushed by pusha.
diff --git a/kernel/include/kmalloc.h b/kernel/include/kmalloc.h
new file mode 100644
index 0000000..a409865
--- /dev/null
+++ b/kernel/include/kmalloc.h
@@ -0,0 +1,14 @@
+#pragma once
+
+#include <stdint.h>
+#include <stddef.h>
+
+// Kernel memory allocator : one slab allocator for shared memory
+// Thread-safe.
+
+void kmalloc_setup();
+
+void* kmalloc(size_t sz);
+void kfree(void* ptr);
+
+/* vim: set ts=4 sw=4 tw=0 noet :*/