Commit 1ae99b4b authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/32: get rid of COPY_EE in exception entry

EXC_XFER_TEMPLATE() is not called with COPY_EE anymore so
we can get rid of copyee parameters and related COPY_EE and NOCOPY
macros.
Suggested-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
[splited out from benh RFC patch]
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 642770dd
...@@ -103,28 +103,24 @@ ...@@ -103,28 +103,24 @@
addi r3,r1,STACK_FRAME_OVERHEAD; \ addi r3,r1,STACK_FRAME_OVERHEAD; \
xfer(n, hdlr) xfer(n, hdlr)
#define EXC_XFER_TEMPLATE(hdlr, trap, msr, copyee, tfer, ret) \ #define EXC_XFER_TEMPLATE(hdlr, trap, msr, tfer, ret) \
li r10,trap; \ li r10,trap; \
stw r10,_TRAP(r11); \ stw r10,_TRAP(r11); \
LOAD_MSR_KERNEL(r10, msr); \ LOAD_MSR_KERNEL(r10, msr); \
copyee(r10, r9); \
bl tfer; \ bl tfer; \
.long hdlr; \ .long hdlr; \
.long ret .long ret
#define COPY_EE(d, s) rlwimi d,s,0,MSR_EE
#define NOCOPY(d, s)
#define EXC_XFER_STD(n, hdlr) \ #define EXC_XFER_STD(n, hdlr) \
EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, NOCOPY, transfer_to_handler_full, \ EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, transfer_to_handler_full, \
ret_from_except_full) ret_from_except_full)
#define EXC_XFER_LITE(n, hdlr) \ #define EXC_XFER_LITE(n, hdlr) \
EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \ EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, transfer_to_handler, \
ret_from_except) ret_from_except)
#define EXC_XFER_SYS(n, hdlr) \ #define EXC_XFER_SYS(n, hdlr) \
EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL | MSR_EE, NOCOPY, transfer_to_handler, \ EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL | MSR_EE, transfer_to_handler, \
ret_from_except) ret_from_except)
#endif /* __HEAD_32_H__ */ #endif /* __HEAD_32_H__ */
...@@ -166,8 +166,7 @@ _ENTRY(saved_ksp_limit) ...@@ -166,8 +166,7 @@ _ENTRY(saved_ksp_limit)
CRITICAL_EXCEPTION_PROLOG; \ CRITICAL_EXCEPTION_PROLOG; \
addi r3,r1,STACK_FRAME_OVERHEAD; \ addi r3,r1,STACK_FRAME_OVERHEAD; \
EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \ EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
NOCOPY, crit_transfer_to_handler, \ crit_transfer_to_handler, ret_from_crit_exc)
ret_from_crit_exc)
/* /*
* 0x0100 - Critical Interrupt Exception * 0x0100 - Critical Interrupt Exception
...@@ -651,7 +650,7 @@ _ENTRY(saved_ksp_limit) ...@@ -651,7 +650,7 @@ _ENTRY(saved_ksp_limit)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_FRAME_OVERHEAD
EXC_XFER_TEMPLATE(DebugException, 0x2002, \ EXC_XFER_TEMPLATE(DebugException, 0x2002, \
(MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \ (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
NOCOPY, crit_transfer_to_handler, ret_from_crit_exc) crit_transfer_to_handler, ret_from_crit_exc)
/* Programmable Interval Timer (PIT) Exception. (from 0x1000) */ /* Programmable Interval Timer (PIT) Exception. (from 0x1000) */
Decrementer: Decrementer:
...@@ -673,8 +672,7 @@ WDTException: ...@@ -673,8 +672,7 @@ WDTException:
addi r3,r1,STACK_FRAME_OVERHEAD; addi r3,r1,STACK_FRAME_OVERHEAD;
EXC_XFER_TEMPLATE(WatchdogException, 0x1020+2, EXC_XFER_TEMPLATE(WatchdogException, 0x1020+2,
(MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)),
NOCOPY, crit_transfer_to_handler, crit_transfer_to_handler, ret_from_crit_exc)
ret_from_crit_exc)
/* /*
* The other Data TLB exceptions bail out to this point * The other Data TLB exceptions bail out to this point
......
...@@ -217,8 +217,7 @@ END_BTB_FLUSH_SECTION ...@@ -217,8 +217,7 @@ END_BTB_FLUSH_SECTION
CRITICAL_EXCEPTION_PROLOG(intno); \ CRITICAL_EXCEPTION_PROLOG(intno); \
addi r3,r1,STACK_FRAME_OVERHEAD; \ addi r3,r1,STACK_FRAME_OVERHEAD; \
EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \ EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
NOCOPY, crit_transfer_to_handler, \ crit_transfer_to_handler, ret_from_crit_exc)
ret_from_crit_exc)
#define MCHECK_EXCEPTION(n, label, hdlr) \ #define MCHECK_EXCEPTION(n, label, hdlr) \
START_EXCEPTION(label); \ START_EXCEPTION(label); \
...@@ -227,32 +226,27 @@ END_BTB_FLUSH_SECTION ...@@ -227,32 +226,27 @@ END_BTB_FLUSH_SECTION
stw r5,_ESR(r11); \ stw r5,_ESR(r11); \
addi r3,r1,STACK_FRAME_OVERHEAD; \ addi r3,r1,STACK_FRAME_OVERHEAD; \
EXC_XFER_TEMPLATE(hdlr, n+4, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \ EXC_XFER_TEMPLATE(hdlr, n+4, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
NOCOPY, mcheck_transfer_to_handler, \ mcheck_transfer_to_handler, ret_from_mcheck_exc)
ret_from_mcheck_exc)
#define EXC_XFER_TEMPLATE(hdlr, trap, msr, copyee, tfer, ret) \ #define EXC_XFER_TEMPLATE(hdlr, trap, msr, tfer, ret) \
li r10,trap; \ li r10,trap; \
stw r10,_TRAP(r11); \ stw r10,_TRAP(r11); \
lis r10,msr@h; \ lis r10,msr@h; \
ori r10,r10,msr@l; \ ori r10,r10,msr@l; \
copyee(r10, r9); \
bl tfer; \ bl tfer; \
.long hdlr; \ .long hdlr; \
.long ret .long ret
#define COPY_EE(d, s) rlwimi d,s,0,16,16
#define NOCOPY(d, s)
#define EXC_XFER_STD(n, hdlr) \ #define EXC_XFER_STD(n, hdlr) \
EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, NOCOPY, transfer_to_handler_full, \ EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, transfer_to_handler_full, \
ret_from_except_full) ret_from_except_full)
#define EXC_XFER_LITE(n, hdlr) \ #define EXC_XFER_LITE(n, hdlr) \
EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \ EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, transfer_to_handler, \
ret_from_except) ret_from_except)
#define EXC_XFER_SYS(n, hdlr) \ #define EXC_XFER_SYS(n, hdlr) \
EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL | MSR_EE, NOCOPY, transfer_to_handler, \ EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL | MSR_EE, transfer_to_handler, \
ret_from_except) ret_from_except)
/* Check for a single step debug exception while in an exception /* Check for a single step debug exception while in an exception
...@@ -319,7 +313,7 @@ END_BTB_FLUSH_SECTION ...@@ -319,7 +313,7 @@ END_BTB_FLUSH_SECTION
/* continue normal handling for a debug exception... */ \ /* continue normal handling for a debug exception... */ \
2: mfspr r4,SPRN_DBSR; \ 2: mfspr r4,SPRN_DBSR; \
addi r3,r1,STACK_FRAME_OVERHEAD; \ addi r3,r1,STACK_FRAME_OVERHEAD; \
EXC_XFER_TEMPLATE(DebugException, 0x2008, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, debug_transfer_to_handler, ret_from_debug_exc) EXC_XFER_TEMPLATE(DebugException, 0x2008, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), debug_transfer_to_handler, ret_from_debug_exc)
#define DEBUG_CRIT_EXCEPTION \ #define DEBUG_CRIT_EXCEPTION \
START_EXCEPTION(DebugCrit); \ START_EXCEPTION(DebugCrit); \
...@@ -372,7 +366,7 @@ END_BTB_FLUSH_SECTION ...@@ -372,7 +366,7 @@ END_BTB_FLUSH_SECTION
/* continue normal handling for a critical exception... */ \ /* continue normal handling for a critical exception... */ \
2: mfspr r4,SPRN_DBSR; \ 2: mfspr r4,SPRN_DBSR; \
addi r3,r1,STACK_FRAME_OVERHEAD; \ addi r3,r1,STACK_FRAME_OVERHEAD; \
EXC_XFER_TEMPLATE(DebugException, 0x2002, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, crit_transfer_to_handler, ret_from_crit_exc) EXC_XFER_TEMPLATE(DebugException, 0x2002, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), crit_transfer_to_handler, ret_from_crit_exc)
#define DATA_STORAGE_EXCEPTION \ #define DATA_STORAGE_EXCEPTION \
START_EXCEPTION(DataStorage) \ START_EXCEPTION(DataStorage) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment