summaryrefslogtreecommitdiffstats
path: root/abi
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2024-03-11 21:30:31 -0400
committerJon Santmyer <jon@jonsantmyer.com>2024-03-11 21:30:31 -0400
commitd1ff7bcc91886626dc9060ec5fb67ee102ab7c1d (patch)
tree8f0b5cd8aad31089131785dc6e37b659490f9955 /abi
downloadjove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.tar.gz
jove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.tar.bz2
jove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.zip
usermode capable kernel with logging syscall
Diffstat (limited to 'abi')
-rw-r--r--abi/permission.h6
-rw-r--r--abi/syscall.h29
2 files changed, 35 insertions, 0 deletions
diff --git a/abi/permission.h b/abi/permission.h
new file mode 100644
index 0000000..5ca56e0
--- /dev/null
+++ b/abi/permission.h
@@ -0,0 +1,6 @@
+#ifndef JOVE_ABI_PERMISSION_H
+#define JOVE_ABI_PERMISSION_H 1
+
+#define PERM_MEMSRV 0
+
+#endif
diff --git a/abi/syscall.h b/abi/syscall.h
new file mode 100644
index 0000000..95cd4a5
--- /dev/null
+++ b/abi/syscall.h
@@ -0,0 +1,29 @@
+#ifndef JOVE_ABI_SYSCALL_H
+#define JOVE_ABI_SYSCALL_H 1
+
+typedef struct syscall {
+ int id;
+} syscall_t;
+
+struct syscall_log {
+ syscall_t syscall;
+ const char *message;
+};
+
+enum
+{
+ SYSCALL_LOG = 0,
+ SYSCALL_COUNT
+};
+
+#define _SYSCALL(data) __asm__ volatile("movq %0, %%rdi\nsyscall":: "r"(data))
+
+void _syscall_log(const char *message) {
+ struct syscall_log syscall_data = {
+ .syscall = (syscall_t){ .id = SYSCALL_LOG },
+ .message = message
+ };
+ _SYSCALL(&syscall_data);
+}
+
+#endif