From 8e757fae5aaece57755a98544f193bc2672966b3 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 18 Sep 2021 09:37:53 +0200 Subject: merge `kernel/types.h` and `init/types.h` --- src/init/main.c | 1 - src/init/syscalls.c | 1 - src/init/tar.c | 1 - src/init/types.h | 5 ----- src/kernel/arch/generic.h | 2 +- src/kernel/arch/i386/registers.h | 2 +- src/kernel/handle.h | 2 +- src/kernel/mem/virt.h | 2 +- src/kernel/syscalls.c | 1 - src/kernel/types.h | 12 ------------ src/kernel/vfs/root.c | 1 - src/shared/syscalls.h | 5 +---- src/shared/types.h | 10 ++++++++++ 13 files changed, 15 insertions(+), 30 deletions(-) delete mode 100644 src/init/types.h delete mode 100644 src/kernel/types.h create mode 100644 src/shared/types.h diff --git a/src/init/main.c b/src/init/main.c index 683d0ca..aef6410 100644 --- a/src/init/main.c +++ b/src/init/main.c @@ -1,5 +1,4 @@ #include -#include #include #include #include diff --git a/src/init/syscalls.c b/src/init/syscalls.c index 6e00895..549ff61 100644 --- a/src/init/syscalls.c +++ b/src/init/syscalls.c @@ -1,5 +1,4 @@ // this file could probably just get generated by a script -#include #include _Noreturn void _syscall_exit(const char __user *msg, size_t len) { diff --git a/src/init/tar.c b/src/init/tar.c index 22e4785..24adfce 100644 --- a/src/init/tar.c +++ b/src/init/tar.c @@ -1,4 +1,3 @@ -#include #include #include diff --git a/src/init/types.h b/src/init/types.h deleted file mode 100644 index 9c6d64b..0000000 --- a/src/init/types.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#define TYPES_INCLUDED - -#define __user diff --git a/src/kernel/arch/generic.h b/src/kernel/arch/generic.h index 0696a96..e5ececd 100644 --- a/src/kernel/arch/generic.h +++ b/src/kernel/arch/generic.h @@ -1,8 +1,8 @@ #pragma once -#include #include #include +#include #include // i have no idea where else to put it diff --git a/src/kernel/arch/i386/registers.h b/src/kernel/arch/i386/registers.h index 5443b10..8bd090d 100644 --- a/src/kernel/arch/i386/registers.h +++ b/src/kernel/arch/i386/registers.h @@ -1,5 +1,5 @@ #pragma once -#include +#include #include struct registers { diff --git a/src/kernel/handle.h b/src/kernel/handle.h index 4ec8e57..917f738 100644 --- a/src/kernel/handle.h +++ b/src/kernel/handle.h @@ -1,6 +1,6 @@ #pragma once -#include #include +#include #include #define HANDLE_MAX 16 diff --git a/src/kernel/mem/virt.h b/src/kernel/mem/virt.h index 54454e9..3a42e9e 100644 --- a/src/kernel/mem/virt.h +++ b/src/kernel/mem/virt.h @@ -1,6 +1,6 @@ /* contains utilities for interacting with virtual memory */ #pragma once -#include +#include #include #include diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c index a5c6f43..1bc9694 100644 --- a/src/kernel/syscalls.c +++ b/src/kernel/syscalls.c @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include diff --git a/src/kernel/types.h b/src/kernel/types.h deleted file mode 100644 index 44a0d46..0000000 --- a/src/kernel/types.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once -#include - -#define TYPES_INCLUDED - -#ifdef __CHECKER__ -# define __user __attribute__((noderef, address_space(__user))) -#else -# define __user -#endif - -typedef void __user * userptr_t; diff --git a/src/kernel/vfs/root.c b/src/kernel/vfs/root.c index feb718d..6fcfc08 100644 --- a/src/kernel/vfs/root.c +++ b/src/kernel/vfs/root.c @@ -1,7 +1,6 @@ #include #include #include -#include #include #include diff --git a/src/shared/syscalls.h b/src/shared/syscalls.h index 36588b6..2c1648e 100644 --- a/src/shared/syscalls.h +++ b/src/shared/syscalls.h @@ -1,10 +1,7 @@ #pragma once +#include #include -#ifndef TYPES_INCLUDED -# error "please include or before this file" -#endif - typedef int handle_t; enum { diff --git a/src/shared/types.h b/src/shared/types.h new file mode 100644 index 0000000..5dd39ad --- /dev/null +++ b/src/shared/types.h @@ -0,0 +1,10 @@ +#pragma once +#include + +#ifdef __CHECKER__ +# define __user __attribute__((noderef, address_space(__user))) +#else +# define __user +#endif + +typedef void __user * userptr_t; -- cgit v1.2.3