diff options
author | dzwdz | 2022-08-11 22:39:12 +0200 |
---|---|---|
committer | dzwdz | 2022-08-11 22:39:12 +0200 |
commit | d170ceb6c9f26f222558012ccbb75614ec2a6b8f (patch) | |
tree | c7f41a46109ee6e4dd237a94184cc1c9c1815996 /src/shared/include | |
parent | 162395700b100943eb019ce2b363f4d6ed03ab1a (diff) |
shared/header: don't mix kinds of declarations between headers
syscalls.h shouldn't define a random struct etc
Diffstat (limited to 'src/shared/include')
-rw-r--r-- | src/shared/include/camellia/flags.h | 15 | ||||
-rw-r--r-- | src/shared/include/camellia/syscalls.h | 15 | ||||
-rw-r--r-- | src/shared/include/camellia/types.h | 10 |
3 files changed, 21 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; +}; |