summaryrefslogtreecommitdiff
path: root/include/linux/syscalls.h
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2018-03-11 11:34:25 +0100
committerDominik Brodowski <linux@dominikbrodowski.net>2018-03-25 18:08:51 +0200
commit819671ff849b07b9831b91de879ddc5da4b333d4 (patch)
tree0d2e9bb2765af669be7e29f00fe48b30261cdbc3 /include/linux/syscalls.h
parent0c8efd610b58cb23cefdfa12015799079aef94ae (diff)
downloadlwn-819671ff849b07b9831b91de879ddc5da4b333d4.tar.gz
lwn-819671ff849b07b9831b91de879ddc5da4b333d4.zip
syscalls: define and explain goal to not call syscalls in the kernel
The syscall entry points to the kernel defined by SYSCALL_DEFINEx() and COMPAT_SYSCALL_DEFINEx() should only be called from userspace through kernel entry points, but not from the kernel itself. This will allow cleanups and optimizations to the entry paths *and* to the parts of the kernel code which currently need to pretend to be userspace in order to make use of syscalls. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'include/linux/syscalls.h')
-rw-r--r--include/linux/syscalls.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index a78186d826d7..0526286a0314 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -941,4 +941,11 @@ asmlinkage long sys_pkey_free(int pkey);
asmlinkage long sys_statx(int dfd, const char __user *path, unsigned flags,
unsigned mask, struct statx __user *buffer);
+
+/*
+ * Kernel code should not call syscalls (i.e., sys_xyzyyz()) directly.
+ * Instead, use one of the functions which work equivalently, such as
+ * the ksys_xyzyyz() functions prototyped below.
+ */
+
#endif