summaryrefslogtreecommitdiff
path: root/rt
diff options
context:
space:
mode:
authorAlejandro Sior <aho@sior.be>2022-07-23 22:53:47 +0200
committerAlejandro Sior <aho@sior.be>2022-07-23 22:53:47 +0200
commitef805e9373fd946bf1fe667bf18a54dfed6d1045 (patch)
tree7762f9574bbd56c502d4dbba1a9d5f3535035211 /rt
kernel: add basic modules: arch, mem, rt
Diffstat (limited to 'rt')
-rw-r--r--rt/README5
-rw-r--r--rt/assert.h6
-rw-r--r--rt/meson.build1
-rw-r--r--rt/rt.h8
-rw-r--r--rt/stddef.h8
-rw-r--r--rt/stdint.h21
6 files changed, 49 insertions, 0 deletions
diff --git a/rt/README b/rt/README
new file mode 100644
index 0000000..2cfdd3f
--- /dev/null
+++ b/rt/README
@@ -0,0 +1,5 @@
+The [rt] module contains definitions and declarations of things
+that are used very commonly throughout the codebase.
+
+The module notably exposes the rt.h header importing the most
+common files within this module for convenience. \ No newline at end of file
diff --git a/rt/assert.h b/rt/assert.h
new file mode 100644
index 0000000..f000d70
--- /dev/null
+++ b/rt/assert.h
@@ -0,0 +1,6 @@
+#ifndef RT_ASSERT_H
+#define RT_ASSERT_H
+
+#define static_assert _Static_assert
+
+#endif \ No newline at end of file
diff --git a/rt/meson.build b/rt/meson.build
new file mode 100644
index 0000000..86de68f
--- /dev/null
+++ b/rt/meson.build
@@ -0,0 +1 @@
+kernel_inc += include_directories('.') \ No newline at end of file
diff --git a/rt/rt.h b/rt/rt.h
new file mode 100644
index 0000000..c3670d5
--- /dev/null
+++ b/rt/rt.h
@@ -0,0 +1,8 @@
+#ifndef RT_RT_H
+#define RT_RT_H
+
+#include "assert.h"
+#include "stdint.h"
+#include "stddef.h"
+
+#endif \ No newline at end of file
diff --git a/rt/stddef.h b/rt/stddef.h
new file mode 100644
index 0000000..83d9957
--- /dev/null
+++ b/rt/stddef.h
@@ -0,0 +1,8 @@
+#ifndef RT_STDDEF_H
+#define RT_STDDEF_H
+
+#define nil ((void*)0)
+
+#define ALIGN_UP(X, F) ((X) - (X) % (F) + (F))
+
+#endif \ No newline at end of file
diff --git a/rt/stdint.h b/rt/stdint.h
new file mode 100644
index 0000000..f7ee056
--- /dev/null
+++ b/rt/stdint.h
@@ -0,0 +1,21 @@
+#ifndef RT_STDINT_H
+#define RT_STDINT_H
+
+#include "assert.h"
+
+typedef unsigned char uchar;
+
+typedef unsigned short int ushort;
+
+typedef unsigned int uint;
+
+typedef unsigned long int ulong;
+
+typedef long long int vlong;
+typedef unsigned long long int uvlong;
+
+// Machine specific types
+
+#include <arch_stdint.h>
+
+#endif \ No newline at end of file