BarryServer : Git

All the code for all my projects
// BarryServer : Git / Nucleus / commit / b33d632d85a31b49ca4a764fe3b644a60459387b / include / nucleus

// Related

Nucleus

Barry Interrupt handlers b33d632 (3 years, 3 months ago)
diff --git a/include/nucleus/memory.h b/include/nucleus/memory.h
new file mode 100644
index 0000000..c6446b0
--- /dev/null
+++ b/include/nucleus/memory.h
@@ -0,0 +1,13 @@
+#ifndef _NUCLEUS_MEMORY_H
+#define _NUCLEUS_MEMORY_H
+
+#include <stdint.h>
+#include <stddef.h>
+
+#define PAGE_SIZE 0x1000
+
+uintptr_t alloc_frame(void);
+void free_frame(uintptr_t frame);
+void init_frames(size_t memMapSize, void *memMap);
+
+#endif
diff --git a/include/nucleus/panic.h b/include/nucleus/panic.h
new file mode 100644
index 0000000..413fee6
--- /dev/null
+++ b/include/nucleus/panic.h
@@ -0,0 +1,13 @@
+#ifndef _NUCLEUS_PANIC_H
+#define _NUCLEUS_PANIC_H
+
+_Noreturn void panic(char *fmt, ...);
+
+#define ASSERT(c) ({ \
+	if (__builtin_expect(!(c),0)) \
+		panic("Assertion failed (%s:%d): " #c, \
+		      __FILE__, __LINE__); \
+	c; \
+})
+
+#endif