Skip to contentSkip to conversation

move x86 specific syscalls to x86 dir

PATCH New Adrien Schildknecht 1 participant 1 message Mar 10, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 move x86 specific syscalls to x86 dir

---
 Makefile                         |  5 +++
 syscalls/arch_prctl.c            | 29 ---------------
 syscalls/ioperm.c                | 12 -------
 syscalls/iopl.c                  | 12 -------
 syscalls/modify_ldt.c            | 77 ----------------------------------------
 syscalls/vm86.c                  | 13 -------
 syscalls/vm86old.c               | 13 -------
 syscalls/x86/i386/vm86.c         | 13 +++++++
 syscalls/x86/i386/vm86old.c      | 13 +++++++
 syscalls/x86/ioperm.c            | 12 +++++++
 syscalls/x86/iopl.c              | 12 +++++++
 syscalls/x86/modify_ldt.c        | 77 ++++++++++++++++++++++++++++++++++++++++
 syscalls/x86/x86_64/arch_prctl.c | 29 +++++++++++++++
 13 files changed, 161 insertions(+), 156 deletions(-)
 delete mode 100644 syscalls/arch_prctl.c
 delete mode 100644 syscalls/ioperm.c
 delete mode 100644 syscalls/iopl.c
 delete mode 100644 syscalls/modify_ldt.c
 delete mode 100644 syscalls/vm86.c
 delete mode 100644 syscalls/vm86old.c
 create mode 100644 syscalls/x86/i386/vm86.c
 create mode 100644 syscalls/x86/i386/vm86old.c
 create mode 100644 syscalls/x86/ioperm.c
 create mode 100644 syscalls/x86/iopl.c
 create mode 100644 syscalls/x86/modify_ldt.c
 create mode 100644 syscalls/x86/x86_64/arch_prctl.c
Makefile +5 -0
index 9fbdb94..da93e75 100644
@@ -72,6 +72,11 @@ SYSCALLS_ARCH	= $(shell case "$(MACHINE)" in \
 		  (ia64*) echo syscalls/ia64/*.c ;; \
 		  (ppc*|powerpc*) echo syscalls/ppc/*.c ;; \
 		  (sparc*) echo syscalls/sparc/*.c ;; \
+		  (x86_64*) echo syscalls/x86/*.c \
+				 syscalls/x86/i386/*.c \
+				 syscalls/x86/x86_64/*.c;; \
+		  (i?86*) echo syscalls/x86/*.c \
+			       syscalls/x86/i386/*.c;; \
 		  esac)
 
 HEADERS		= $(patsubst %.h,%.h,$(wildcard *.h)) $(patsubst %.h,%.h,$(wildcard syscalls/*.h)) $(patsubst %.h,%.h,$(wildcard ioctls/*.h))
syscalls/arch_prctl.c deleted +0 -29
deleted file mode 100644
index 0433fe8..0000000
@@ -1,29 +0,0 @@
-/* (x86-64 only)
- *  long sys_arch_prctl(int code, unsigned long addr)
- *
- * On success, arch_prctl() returns 0
- * On error, -1 is returned, and errno is set to indicate the error.
- */
-
-#if defined(__i386__) || defined (__x86_64__)
-
-#include "sanitise.h"
-#include <asm/prctl.h>
-#include <sys/prctl.h>
-
-static unsigned long arch_prctl_flags[] = {
-	ARCH_SET_FS, ARCH_GET_FS, ARCH_SET_GS, ARCH_GET_GS
-};
-
-struct syscallentry syscall_arch_prctl = {
-	.name = "arch_prctl",
-	.flags = AVOID_SYSCALL,
-	.num_args = 2,
-	.arg1name = "code",
-	.arg1type = ARG_OP,
-	.arg1list = ARGLIST(arch_prctl_flags),
-	.arg2name = "addr",
-	.arg2type = ARG_ADDRESS,
-	.rettype = RET_BORING,
-};
-#endif
syscalls/ioperm.c deleted +0 -12
deleted file mode 100644
index a4a842d..0000000
@@ -1,12 +0,0 @@
-/*
-   asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
- */
-#include "sanitise.h"
-
-struct syscallentry syscall_ioperm = {
-	.name = "ioperm",
-	.num_args = 3,
-	.arg1name = "from",
-	.arg2name = "num",
-	.arg3name = "turn_on",
-};
syscalls/iopl.c deleted +0 -12
deleted file mode 100644
index b1ecd9e..0000000
@@ -1,12 +0,0 @@
-/*
-   long sys_iopl(unsigned int level, struct pt_regs *regs)
- */
-#include "sanitise.h"
-
-struct syscallentry syscall_iopl = {
-	.name = "iopl",
-	.num_args = 2,
-	.arg1name = "level",
-	.arg2name = "regs",
-	.arg2type = ARG_ADDRESS,
-};
syscalls/modify_ldt.c deleted +0 -77

77 lines not on this page · raw message

syscalls/vm86.c deleted +0 -13
deleted file mode 100644
index d7b48c0..0000000
@@ -1,13 +0,0 @@
-/*
- * int sys_vm86(unsigned long cmd, unsigned long arg, struct pt_regs *regs)
- */
-#include "sanitise.h"
-
-struct syscallentry syscall_vm86 = {
-	.name = "vm86",
-	.num_args = 3,
-	.arg1name = "cmd",
-	.arg2name = "arg",
-	.arg3name = "regs",
-	.arg3type = ARG_ADDRESS,
-};
syscalls/vm86old.c deleted +0 -13
deleted file mode 100644
index f4ff998..0000000
@@ -1,13 +0,0 @@
-/*
- * int sys_vm86old(struct vm86_struct __user *v86, struct pt_regs *regs)
- */
-#include "sanitise.h"
-
-struct syscallentry syscall_vm86old = {
-	.name = "vm86old",
-	.num_args = 2,
-	.arg1name = "v86",
-	.arg1type = ARG_ADDRESS,
-	.arg2name = "regs",
-	.arg2type = ARG_ADDRESS,
-};
syscalls/x86/i386/vm86.c new file +13 -0
new file mode 100644
index 0000000..d7b48c0
@@ -0,0 +1,13 @@
+/*
+ * int sys_vm86(unsigned long cmd, unsigned long arg, struct pt_regs *regs)
+ */
+#include "sanitise.h"
+
+struct syscallentry syscall_vm86 = {
+	.name = "vm86",
+	.num_args = 3,
+	.arg1name = "cmd",
+	.arg2name = "arg",
+	.arg3name = "regs",
+	.arg3type = ARG_ADDRESS,
+};
syscalls/x86/i386/vm86old.c new file +13 -0
new file mode 100644
index 0000000..f4ff998
@@ -0,0 +1,13 @@
+/*
+ * int sys_vm86old(struct vm86_struct __user *v86, struct pt_regs *regs)
+ */
+#include "sanitise.h"
+
+struct syscallentry syscall_vm86old = {
+	.name = "vm86old",
+	.num_args = 2,
+	.arg1name = "v86",
+	.arg1type = ARG_ADDRESS,
+	.arg2name = "regs",
+	.arg2type = ARG_ADDRESS,
+};
syscalls/x86/ioperm.c new file +12 -0
new file mode 100644
index 0000000..a4a842d
@@ -0,0 +1,12 @@
+/*
+   asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
+ */
+#include "sanitise.h"
+
+struct syscallentry syscall_ioperm = {
+	.name = "ioperm",
+	.num_args = 3,
+	.arg1name = "from",
+	.arg2name = "num",
+	.arg3name = "turn_on",
+};
syscalls/x86/iopl.c new file +12 -0
new file mode 100644
index 0000000..b1ecd9e
@@ -0,0 +1,12 @@
+/*
+   long sys_iopl(unsigned int level, struct pt_regs *regs)
+ */
+#include "sanitise.h"
+
+struct syscallentry syscall_iopl = {
+	.name = "iopl",
+	.num_args = 2,
+	.arg1name = "level",
+	.arg2name = "regs",
+	.arg2type = ARG_ADDRESS,
+};
syscalls/x86/modify_ldt.c new file +77 -0

77 lines not on this page · raw message

syscalls/x86/x86_64/arch_prctl.c new file +29 -0
new file mode 100644
index 0000000..0433fe8
@@ -0,0 +1,29 @@
+/* (x86-64 only)
+ *  long sys_arch_prctl(int code, unsigned long addr)
+ *
+ * On success, arch_prctl() returns 0
+ * On error, -1 is returned, and errno is set to indicate the error.
+ */
+
+#if defined(__i386__) || defined (__x86_64__)
+
+#include "sanitise.h"
+#include <asm/prctl.h>
+#include <sys/prctl.h>
+
+static unsigned long arch_prctl_flags[] = {
+	ARCH_SET_FS, ARCH_GET_FS, ARCH_SET_GS, ARCH_GET_GS
+};
+
+struct syscallentry syscall_arch_prctl = {
+	.name = "arch_prctl",
+	.flags = AVOID_SYSCALL,
+	.num_args = 2,
+	.arg1name = "code",
+	.arg1type = ARG_OP,
+	.arg1list = ARGLIST(arch_prctl_flags),
+	.arg2name = "addr",
+	.arg2type = ARG_ADDRESS,
+	.rettype = RET_BORING,
+};
+#endif
Signature · 1 line
2.7.2