Skip to content

Commit aaa2e7a

Browse files
author
Al Viro
committed
add asm-generic/extable.h
... and make the users of generic uaccess.h use that. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 444f02c commit aaa2e7a

10 files changed

Lines changed: 34 additions & 22 deletions

File tree

arch/arc/include/asm/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ generic-y += device.h
66
generic-y += div64.h
77
generic-y += emergency-restart.h
88
generic-y += errno.h
9+
generic-y += extable.h
910
generic-y += fb.h
1011
generic-y += fcntl.h
1112
generic-y += ftrace.h

arch/arc/include/asm/uaccess.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,4 @@ extern long arc_strnlen_user_noinline(const char __user *src, long n);
750750

751751
#include <asm-generic/uaccess.h>
752752

753-
extern int fixup_exception(struct pt_regs *regs);
754-
755753
#endif

arch/c6x/include/asm/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ generic-y += dma.h
1212
generic-y += emergency-restart.h
1313
generic-y += errno.h
1414
generic-y += exec.h
15+
generic-y += extable.h
1516
generic-y += fb.h
1617
generic-y += fcntl.h
1718
generic-y += futex.h

arch/h8300/include/asm/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ generic-y += dma.h
1313
generic-y += emergency-restart.h
1414
generic-y += errno.h
1515
generic-y += exec.h
16+
generic-y += extable.h
1617
generic-y += fb.h
1718
generic-y += fcntl.h
1819
generic-y += ftrace.h

arch/hexagon/include/asm/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ generic-y += device.h
1111
generic-y += div64.h
1212
generic-y += emergency-restart.h
1313
generic-y += errno.h
14+
generic-y += extable.h
1415
generic-y += fb.h
1516
generic-y += fcntl.h
1617
generic-y += ftrace.h

arch/um/include/asm/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ generic-y += delay.h
66
generic-y += device.h
77
generic-y += emergency-restart.h
88
generic-y += exec.h
9+
generic-y += extable.h
910
generic-y += ftrace.h
1011
generic-y += futex.h
1112
generic-y += hardirq.h

arch/unicore32/include/asm/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ generic-y += div64.h
1010
generic-y += emergency-restart.h
1111
generic-y += errno.h
1212
generic-y += exec.h
13+
generic-y += extable.h
1314
generic-y += fb.h
1415
generic-y += fcntl.h
1516
generic-y += ftrace.h

arch/unicore32/include/asm/uaccess.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,4 @@ __strnlen_user(const char __user *s, long n);
3838

3939
#include <asm-generic/uaccess.h>
4040

41-
extern int fixup_exception(struct pt_regs *regs);
42-
4341
#endif /* __UNICORE_UACCESS_H__ */

include/asm-generic/extable.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#ifndef __ASM_GENERIC_EXTABLE_H
2+
#define __ASM_GENERIC_EXTABLE_H
3+
4+
/*
5+
* The exception table consists of pairs of addresses: the first is the
6+
* address of an instruction that is allowed to fault, and the second is
7+
* the address at which the program should continue. No registers are
8+
* modified, so it is entirely up to the continuation code to figure out
9+
* what to do.
10+
*
11+
* All the routines below use bits of fixup code that are out of line
12+
* with the main instruction path. This means when everything is well,
13+
* we don't even have to jump over them. Further, they do not intrude
14+
* on our cache or tlb entries.
15+
*/
16+
17+
struct exception_table_entry
18+
{
19+
unsigned long insn, fixup;
20+
};
21+
22+
23+
struct pt_regs;
24+
extern int fixup_exception(struct pt_regs *regs);
25+
26+
#endif

include/asm-generic/uaccess.h

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,6 @@ static inline int __access_ok(unsigned long addr, unsigned long size)
4747
}
4848
#endif
4949

50-
/*
51-
* The exception table consists of pairs of addresses: the first is the
52-
* address of an instruction that is allowed to fault, and the second is
53-
* the address at which the program should continue. No registers are
54-
* modified, so it is entirely up to the continuation code to figure out
55-
* what to do.
56-
*
57-
* All the routines below use bits of fixup code that are out of line
58-
* with the main instruction path. This means when everything is well,
59-
* we don't even have to jump over them. Further, they do not intrude
60-
* on our cache or tlb entries.
61-
*/
62-
63-
struct exception_table_entry
64-
{
65-
unsigned long insn, fixup;
66-
};
67-
6850
/*
6951
* architectures with an MMU should override these two
7052
*/
@@ -344,4 +326,6 @@ clear_user(void __user *to, unsigned long n)
344326
return __clear_user(to, n);
345327
}
346328

329+
#include <asm/extable.h>
330+
347331
#endif /* __ASM_GENERIC_UACCESS_H */

0 commit comments

Comments
 (0)