summaryrefslogtreecommitdiff
path: root/src/init
diff options
context:
space:
mode:
authordzwdz2021-09-11 18:04:57 +0200
committerdzwdz2021-09-11 18:04:57 +0200
commitaf2f9184e03015dc3b188ea437bbf496638000ce (patch)
tree4b4186d8df73bc1b96e14e5c8eadcf1a4f66692a /src/init
parent0994192f6cab853f4a49ac73aa63f6820c886ec2 (diff)
replace `user_ptr` with a linux-style `__user` annotation
Diffstat (limited to 'src/init')
-rw-r--r--src/init/syscalls.c18
-rw-r--r--src/init/types.h3
2 files changed, 11 insertions, 10 deletions
diff --git a/src/init/syscalls.c b/src/init/syscalls.c
index c091247..4584837 100644
--- a/src/init/syscalls.c
+++ b/src/init/syscalls.c
@@ -4,7 +4,7 @@
int _syscall(int, int, int, int);
-_Noreturn void _syscall_exit(const user_ptr msg, size_t len) {
+_Noreturn void _syscall_exit(const char __user *msg, size_t len) {
_syscall(_SYSCALL_EXIT, (int)msg, len, 0);
__builtin_unreachable();
}
@@ -13,23 +13,23 @@ int _syscall_fork(void) {
return _syscall(_SYSCALL_FORK, 0, 0, 0);
}
-int _syscall_await(user_ptr buf, int len) {
+int _syscall_await(char __user *buf, int len) {
return _syscall(_SYSCALL_AWAIT, (int)buf, (int)len, 0);
}
-handle_t _syscall_open(const user_ptr path, int len) {
+handle_t _syscall_open(const char __user *path, int len) {
return _syscall(_SYSCALL_OPEN, (int)path, len, 0);
}
-int _syscall_mount(handle_t handle, const user_ptr path, int len) {
+int _syscall_mount(handle_t handle, const char __user *path, int len) {
return _syscall(_SYSCALL_MOUNT, handle, (int)path, len);
}
-int _syscall_read(handle_t handle, user_ptr buf, int len) {
+int _syscall_read(handle_t handle, char __user *buf, int len) {
return _syscall(_SYSCALL_READ, handle, (int)buf, len);
}
-int _syscall_write(handle_t handle, user_ptr buf, int len) {
+int _syscall_write(handle_t handle, const char __user *buf, int len) {
return _syscall(_SYSCALL_WRITE, handle, (int)buf, len);
}
@@ -37,10 +37,10 @@ int _syscall_close(handle_t handle) {
return _syscall(_SYSCALL_CLOSE, handle, 0, 0);
}
-handle_t _syscall_fs_create(user_ptr back) {
+handle_t _syscall_fs_create(handle_t __user *back) {
return _syscall(_SYSCALL_FS_CREATE, (int)back, 0, 0);
}
-int _syscall_fs_wait(handle_t back, user_ptr info) {
- return _syscall(_SYSCALL_FS_WAIT, back, info, 0);
+int _syscall_fs_wait(handle_t back, void __user *info) {
+ return _syscall(_SYSCALL_FS_WAIT, back, (int)info, 0);
}
diff --git a/src/init/types.h b/src/init/types.h
index 2c56484..9c6d64b 100644
--- a/src/init/types.h
+++ b/src/init/types.h
@@ -1,4 +1,5 @@
#pragma once
#define TYPES_INCLUDED
-typedef char* user_ptr;
+
+#define __user