aboutsummaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/common.h19
-rw-r--r--src/shared/stdarg.h9
-rw-r--r--src/shared/stdbool.h13
-rw-r--r--src/shared/stddef.h8
-rw-r--r--src/shared/stdint.h16
5 files changed, 65 insertions, 0 deletions
diff --git a/src/shared/common.h b/src/shared/common.h
new file mode 100644
index 0000000..aa9b281
--- /dev/null
+++ b/src/shared/common.h
@@ -0,0 +1,19 @@
+#ifndef MELVIX_COMMON_H
+#define MELVIX_COMMON_H
+
+// Syscalls
+#define SYS_HALT 0
+#define SYS_EXIT 1
+#define SYS_FORK 2
+#define SYS_READ 3
+#define SYS_WRITE 4
+#define SYS_EXEC 5
+#define SYS_GET_PID 6
+#define SYS_MALLOC 7
+#define SYS_FREE 8
+
+// Registration
+#define REG_KEYBOARD 0
+#define REG_MOUSE 1
+
+#endif \ No newline at end of file
diff --git a/src/shared/stdarg.h b/src/shared/stdarg.h
new file mode 100644
index 0000000..2f45f23
--- /dev/null
+++ b/src/shared/stdarg.h
@@ -0,0 +1,9 @@
+#ifndef MELVIX_STDARG_H
+#define MELVIX_STDARG_H
+
+typedef __builtin_va_list va_list;
+#define va_start __builtin_va_start
+#define va_end __builtin_va_end
+#define va_arg __builtin_va_arg
+
+#endif \ No newline at end of file
diff --git a/src/shared/stdbool.h b/src/shared/stdbool.h
new file mode 100644
index 0000000..733ec28
--- /dev/null
+++ b/src/shared/stdbool.h
@@ -0,0 +1,13 @@
+#ifndef MELVIX_STDBOOL_H
+#define MELVIX_STDBOOL_H
+
+typedef int bool;
+
+#define true 1
+#define false 0
+
+// For the strange people in the world
+#define TRUE 1
+#define FALSE 0
+
+#endif \ No newline at end of file
diff --git a/src/shared/stddef.h b/src/shared/stddef.h
new file mode 100644
index 0000000..f4bd1a2
--- /dev/null
+++ b/src/shared/stddef.h
@@ -0,0 +1,8 @@
+#ifndef MELVIX_STDDEF_H
+#define MELVIX_STDDEF_H
+
+// u32
+
+#define NULL ((void *)0)
+
+#endif \ No newline at end of file
diff --git a/src/shared/stdint.h b/src/shared/stdint.h
new file mode 100644
index 0000000..8ed1198
--- /dev/null
+++ b/src/shared/stdint.h
@@ -0,0 +1,16 @@
+#ifndef MELVIX_STDINT_H
+#define MELVIX_STDINT_H
+
+typedef signed char s8;
+typedef unsigned char u8;
+
+typedef signed short s16;
+typedef unsigned short u16;
+
+typedef signed int s32;
+typedef unsigned int u32;
+
+typedef signed long long s64;
+typedef unsigned long long u64;
+
+#endif \ No newline at end of file