parisc: provide macro to create exception table entries

Provide a macro ASM_EXCEPTIONTABLE_ENTRY() to create exception table
entries and convert all open-coded places to use that macro.

This patch is a first step toward creating a exception table which only
holds 32bit pointers even on a 64bit kernel. That way in my own kernel
I was able to reduce the in-kernel exception table from 44kB to 22kB.

Signed-off-by: Helge Deller <deller@gmx.de>
此提交包含在:
Helge Deller
2013-10-13 21:11:30 +02:00
父節點 5e01dc7b26
當前提交 61dbbaeb86
共有 5 個檔案被更改,包括 27 行新增14 行删除

查看文件

@@ -515,5 +515,17 @@
nop /* 7 */
.endm
/*
* ASM_EXCEPTIONTABLE_ENTRY
*
* Creates an exception table entry.
* Do not convert to a assembler macro. This won't work.
*/
#define ASM_EXCEPTIONTABLE_ENTRY(fault_addr, except_addr) \
.section __ex_table,"aw" ! \
ASM_ULONG_INSN fault_addr, except_addr ! \
.previous
#endif /* __ASSEMBLY__ */
#endif

查看文件

@@ -59,12 +59,13 @@ static inline long access_ok(int type, const void __user * addr,
/*
* The exception table contains two values: the first is an address
* for an instruction that is allowed to fault, and the second is
* the address to the fixup routine.
* the address to the fixup routine. Even on a 64bit kernel we could
* use a 32bit (unsigned int) address here.
*/
struct exception_table_entry {
unsigned long insn; /* address of insn that is allowed to fault. */
long fixup; /* fixup routine */
unsigned long insn; /* address of insn that is allowed to fault. */
unsigned long fixup; /* fixup routine */
};
#define ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr )\