Relocated fixup table macros
authorMichael Taufen <mtaufen@gmail.com>
Wed, 24 Feb 2016 23:15:48 +0000 (15:15 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 26 Feb 2016 16:28:20 +0000 (11:28 -0500)
Signed-off-by: Michael Taufen <mtaufen@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/arch/x86/fixup.h [new file with mode: 0644]
kern/arch/x86/uaccess.h

diff --git a/kern/arch/x86/fixup.h b/kern/arch/x86/fixup.h
new file mode 100644 (file)
index 0000000..c9fcc85
--- /dev/null
@@ -0,0 +1,24 @@
+/* Copyright (C) 1991-2016, the Linux Kernel authors
+ *
+ * This source code is licensed under the GNU General Public License
+ * Version 2. See the file COPYING for more details.
+ *
+ * Part of this code originates from Linux kernel files:
+ *
+ * linux/arch/x86/include/asm/asm.h
+ *
+ * These files are missing copyright headers, but are supposed to be
+ * governed by the overall Linux copyright.
+ */
+
+#pragma once
+
+#define _ASM_EXTABLE(from, to)             \
+    " .pushsection \"__ex_table\",\"a\"\n" \
+    " .balign 16\n"                        \
+    " .quad (" #from ") - .\n"             \
+    " .quad (" #to ") - .\n"               \
+    " .popsection\n"
+
+#define ASM_STAC
+#define ASM_CLAC
\ No newline at end of file
index e7fe944..80551e4 100644 (file)
@@ -16,9 +16,8 @@
 #include <compiler.h>
 #include <stdint.h>
 #include <umem.h>
+#include <arch/fixup.h>
 
-#define ASM_STAC
-#define ASM_CLAC
 #define __m(x) *(x)
 
 struct extable_ip_fixup {
@@ -26,13 +25,6 @@ struct extable_ip_fixup {
        uint64_t fixup;
 };
 
-#define _ASM_EXTABLE(from, to)                                                                 \
-       " .pushsection \"__ex_table\",\"a\"\n"                                          \
-       " .balign 16\n"                                                                                         \
-       " .quad (" #from ") - .\n"                                                                      \
-       " .quad (" #to ") - .\n"                                                                        \
-       " .popsection\n"
-
 #define __read_msr_asm(eax, edx, addr, err, errret)                                            \
        asm volatile(ASM_STAC "\n"                                                                                      \
                                 "1:            rdmsr\n"                                                                        \