summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordzwdz2022-08-11 22:39:12 +0200
committerdzwdz2022-08-11 22:39:12 +0200
commitd170ceb6c9f26f222558012ccbb75614ec2a6b8f (patch)
treec7f41a46109ee6e4dd237a94184cc1c9c1815996 /src
parent162395700b100943eb019ce2b363f4d6ed03ab1a (diff)
shared/header: don't mix kinds of declarations between headers
syscalls.h shouldn't define a random struct etc
Diffstat (limited to 'src')
-rw-r--r--src/shared/include/camellia/flags.h15
-rw-r--r--src/shared/include/camellia/syscalls.h15
-rw-r--r--src/shared/include/camellia/types.h10
-rw-r--r--src/user/app/shell/shell.c1
-rw-r--r--src/user/app/tests/kernel/fs.c1
-rw-r--r--src/user/app/tests/kernel/misc.c1
-rw-r--r--src/user/app/tmpfs/tmpfs.c1
-rw-r--r--src/user/lib/file.c1
8 files changed, 26 insertions, 19 deletions
diff --git a/src/shared/include/camellia/flags.h b/src/shared/include/camellia/flags.h
index dd20a3f..2a208c3 100644
--- a/src/shared/include/camellia/flags.h
+++ b/src/shared/include/camellia/flags.h
@@ -1,6 +1,13 @@
#pragma once
-enum {
- MEMFLAG_PRESENT = 1 << 0,
- MEMFLAG_FINDFREE = 1 << 1,
-};
+#define MEMFLAG_PRESENT 1
+#define MEMFLAG_FINDFREE 2
+
+#define FORK_NOREAP 1
+#define FORK_NEWFS 2
+
+#define WRITE_TRUNCATE 1
+
+#define OPEN_CREATE 1
+
+#define FSR_DELEGATE 1
diff --git a/src/shared/include/camellia/syscalls.h b/src/shared/include/camellia/syscalls.h
index b6c93fe..50fd5c8 100644
--- a/src/shared/include/camellia/syscalls.h
+++ b/src/shared/include/camellia/syscalls.h
@@ -2,12 +2,6 @@
#include <camellia/types.h>
#include <stddef.h>
-#define FORK_NOREAP 1
-#define FORK_NEWFS 2
-#define WRITE_TRUNCATE 1
-#define OPEN_CREATE 1
-#define FSR_DELEGATE 1
-
enum {
// idc about stable syscall numbers just yet
_SYSCALL_EXIT,
@@ -24,7 +18,6 @@ enum {
_SYSCALL_REMOVE,
_SYSCALL_CLOSE,
- _SYSCALL_FS_FORK2,
_SYSCALL_FS_WAIT,
_SYSCALL_FS_RESPOND,
@@ -69,14 +62,6 @@ long _syscall_getsize(handle_t h);
long _syscall_remove(handle_t h);
long _syscall_close(handle_t h);
-struct fs_wait_response {
- enum vfs_operation op;
- size_t len; // how much was put in *buf
- size_t capacity; // how much output can be accepted by the caller
- void __user *id; // file id (returned by the open handler, passed to other calls)
- long offset;
- int flags;
-};
/** Blocks until an fs request is made.
* @return 0 if everything was successful */
long _syscall_fs_wait(char __user *buf, long max_len, struct fs_wait_response __user *res);
diff --git a/src/shared/include/camellia/types.h b/src/shared/include/camellia/types.h
index 622d705..4f6ab1d 100644
--- a/src/shared/include/camellia/types.h
+++ b/src/shared/include/camellia/types.h
@@ -1,4 +1,5 @@
#pragma once
+#include <stddef.h>
#include <stdint.h>
#ifdef __CHECKER__
@@ -20,3 +21,12 @@ enum vfs_operation {
VFSOP_REMOVE,
VFSOP_CLOSE,
};
+
+struct fs_wait_response {
+ enum vfs_operation op;
+ size_t len; // how much was put in *buf
+ size_t capacity; // how much output can be accepted by the caller
+ void __user *id; // file id (returned by the open handler, passed to other calls)
+ long offset;
+ int flags;
+};
diff --git a/src/user/app/shell/shell.c b/src/user/app/shell/shell.c
index 0f97d7a..0c92410 100644
--- a/src/user/app/shell/shell.c
+++ b/src/user/app/shell/shell.c
@@ -1,5 +1,6 @@
#include "builtins.h"
#include "shell.h"
+#include <camellia/flags.h>
#include <camellia/syscalls.h>
#include <errno.h>
#include <stdbool.h>
diff --git a/src/user/app/tests/kernel/fs.c b/src/user/app/tests/kernel/fs.c
index c8d2eae..d11775a 100644
--- a/src/user/app/tests/kernel/fs.c
+++ b/src/user/app/tests/kernel/fs.c
@@ -1,4 +1,5 @@
#include "../tests.h"
+#include <camellia/flags.h>
#include <camellia/syscalls.h>
static void test_unfinished_req(void) {
diff --git a/src/user/app/tests/kernel/misc.c b/src/user/app/tests/kernel/misc.c
index 6899e18..01e041d 100644
--- a/src/user/app/tests/kernel/misc.c
+++ b/src/user/app/tests/kernel/misc.c
@@ -1,5 +1,6 @@
#include "../tests.h"
#include <camellia/errno.h>
+#include <camellia/flags.h>
#include <camellia/syscalls.h>
#include <string.h>
diff --git a/src/user/app/tmpfs/tmpfs.c b/src/user/app/tmpfs/tmpfs.c
index 9bc3d6c..401bab3 100644
--- a/src/user/app/tmpfs/tmpfs.c
+++ b/src/user/app/tmpfs/tmpfs.c
@@ -1,3 +1,4 @@
+#include <camellia/flags.h>
#include <camellia/fsutil.h>
#include <camellia/syscalls.h>
#include <errno.h>
diff --git a/src/user/lib/file.c b/src/user/lib/file.c
index 080217c..c8acbfb 100644
--- a/src/user/lib/file.c
+++ b/src/user/lib/file.c
@@ -1,5 +1,6 @@
#include "file.h"
#include <camellia/syscalls.h>
+#include <camellia/flags.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>