aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-09-05 11:32:44 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-09-27 21:15:23 -0400
commit45caf470077ae6b02da6d5eaee94003ee1543ca3 (patch)
treea01860422d8a9b416ac3d28999506d5afb08ab63
parentb79d8d82bb994fe6154ea1a8e56d587ef9e356ae (diff)
x86: separate extable.h, switch sections.h to it
drivers/platform/x86/dell-smo8800.c is touched due to the following obscenity: drivers/platform/x86/dell-smo8800.c -> linux/interrupt.h -> linux/hardirq.h -> asm/hardirq.h -> linux/irq.h -> asm/hw_irq.h -> asm/sections.h -> asm/uaccess.h is the only chain of includes pulling asm/uaccess.h there. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--arch/x86/include/asm/extable.h35
-rw-r--r--arch/x86/include/asm/sections.h2
-rw-r--r--arch/x86/include/asm/uaccess.h32
-rw-r--r--drivers/platform/x86/dell-smo8800.c1
4 files changed, 38 insertions, 32 deletions
diff --git a/arch/x86/include/asm/extable.h b/arch/x86/include/asm/extable.h
new file mode 100644
index 000000000000..b8ad261d11dc
--- /dev/null
+++ b/arch/x86/include/asm/extable.h
@@ -0,0 +1,35 @@
1#ifndef _ASM_X86_EXTABLE_H
2#define _ASM_X86_EXTABLE_H
3/*
4 * The exception table consists of triples of addresses relative to the
5 * exception table entry itself. The first address is of an instruction
6 * that is allowed to fault, the second is the target at which the program
7 * should continue. The third is a handler function to deal with the fault
8 * caused by the instruction in the first field.
9 *
10 * All the routines below use bits of fixup code that are out of line
11 * with the main instruction path. This means when everything is well,
12 * we don't even have to jump over them. Further, they do not intrude
13 * on our cache or tlb entries.
14 */
15
16struct exception_table_entry {
17 int insn, fixup, handler;
18};
19struct pt_regs;
20
21#define ARCH_HAS_RELATIVE_EXTABLE
22
23#define swap_ex_entry_fixup(a, b, tmp, delta) \
24 do { \
25 (a)->fixup = (b)->fixup + (delta); \
26 (b)->fixup = (tmp).fixup - (delta); \
27 (a)->handler = (b)->handler + (delta); \
28 (b)->handler = (tmp).handler - (delta); \
29 } while (0)
30
31extern int fixup_exception(struct pt_regs *regs, int trapnr);
32extern bool ex_has_fault_handler(unsigned long ip);
33extern void early_fixup_exception(struct pt_regs *regs, int trapnr);
34
35#endif
diff --git a/arch/x86/include/asm/sections.h b/arch/x86/include/asm/sections.h
index 13b6cdd0af57..2f75f30cb2f6 100644
--- a/arch/x86/include/asm/sections.h
+++ b/arch/x86/include/asm/sections.h
@@ -2,7 +2,7 @@
2#define _ASM_X86_SECTIONS_H 2#define _ASM_X86_SECTIONS_H
3 3
4#include <asm-generic/sections.h> 4#include <asm-generic/sections.h>
5#include <asm/uaccess.h> 5#include <asm/extable.h>
6 6
7extern char __brk_base[], __brk_limit[]; 7extern char __brk_base[], __brk_limit[];
8extern struct exception_table_entry __stop___ex_table[]; 8extern struct exception_table_entry __stop___ex_table[];
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index 2131c4ce7d8a..faf3687f1035 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -11,6 +11,7 @@
11#include <asm/asm.h> 11#include <asm/asm.h>
12#include <asm/page.h> 12#include <asm/page.h>
13#include <asm/smap.h> 13#include <asm/smap.h>
14#include <asm/extable.h>
14 15
15#define VERIFY_READ 0 16#define VERIFY_READ 0
16#define VERIFY_WRITE 1 17#define VERIFY_WRITE 1
@@ -91,37 +92,6 @@ static inline bool __chk_range_not_ok(unsigned long addr, unsigned long size, un
91 likely(!__range_not_ok(addr, size, user_addr_max())) 92 likely(!__range_not_ok(addr, size, user_addr_max()))
92 93
93/* 94/*
94 * The exception table consists of triples of addresses relative to the
95 * exception table entry itself. The first address is of an instruction
96 * that is allowed to fault, the second is the target at which the program
97 * should continue. The third is a handler function to deal with the fault
98 * caused by the instruction in the first field.
99 *
100 * All the routines below use bits of fixup code that are out of line
101 * with the main instruction path. This means when everything is well,
102 * we don't even have to jump over them. Further, they do not intrude
103 * on our cache or tlb entries.
104 */
105
106struct exception_table_entry {
107 int insn, fixup, handler;
108};
109
110#define ARCH_HAS_RELATIVE_EXTABLE
111
112#define swap_ex_entry_fixup(a, b, tmp, delta) \
113 do { \
114 (a)->fixup = (b)->fixup + (delta); \
115 (b)->fixup = (tmp).fixup - (delta); \
116 (a)->handler = (b)->handler + (delta); \
117 (b)->handler = (tmp).handler - (delta); \
118 } while (0)
119
120extern int fixup_exception(struct pt_regs *regs, int trapnr);
121extern bool ex_has_fault_handler(unsigned long ip);
122extern void early_fixup_exception(struct pt_regs *regs, int trapnr);
123
124/*
125 * These are the main single-value transfer routines. They automatically 95 * These are the main single-value transfer routines. They automatically
126 * use the right size if we just have the right pointer type. 96 * use the right size if we just have the right pointer type.
127 * 97 *
diff --git a/drivers/platform/x86/dell-smo8800.c b/drivers/platform/x86/dell-smo8800.c
index 0aec4fd4c48e..37e646034ef8 100644
--- a/drivers/platform/x86/dell-smo8800.c
+++ b/drivers/platform/x86/dell-smo8800.c
@@ -24,6 +24,7 @@
24#include <linux/acpi.h> 24#include <linux/acpi.h>
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/miscdevice.h> 26#include <linux/miscdevice.h>
27#include <linux/uaccess.h>
27 28
28struct smo8800_device { 29struct smo8800_device {
29 u32 irq; /* acpi device irq */ 30 u32 irq; /* acpi device irq */