Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177843368
D61900.1795412864.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
852 B
Referenced Files
None
Subscribers
None
D61900.1795412864.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/compat.h b/sys/compat/linuxkpi/common/include/linux/compat.h
--- a/sys/compat/linuxkpi/common/include/linux/compat.h
+++ b/sys/compat/linuxkpi/common/include/linux/compat.h
@@ -32,6 +32,7 @@
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/malloc.h>
+#include <sys/sysent.h>
struct domainset;
struct thread;
@@ -65,4 +66,18 @@
typedef void fpu_safe_exec_cb_t(void *ctx);
void lkpi_fpu_safe_exec(fpu_safe_exec_cb_t func, void *ctx);
+/*
+ * Linux only treats a system call as a compat one when a 32-bit process
+ * runs on a 64-bit kernel, so native 32-bit kernels always return false.
+ */
+static inline bool
+in_compat_syscall(void)
+{
+#ifdef __LP64__
+ return (SV_CURPROC_FLAG(SV_ILP32) != 0);
+#else
+ return (false);
+#endif
+}
+
#endif /* _LINUXKPI_LINUX_COMPAT_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 23, 5:47 AM (23 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41924083
Default Alt Text
D61900.1795412864.diff (852 B)
Attached To
Mode
D61900: LinuxKPI: Add in_compat_syscall()
Attached
Detach File
Event Timeline