[xtensa-cvscommit] linux/arch/xtensa/kernel handlers.S,1.18,1.19 vectors.S,1.8,1.9
Brought to you by:
zankel
|
From: <joe...@us...> - 2003-05-09 20:28:42
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv21097/arch/xtensa/kernel Modified Files: handlers.S vectors.S Log Message: Don't call the scheduler when handling double exceptions. Index: handlers.S =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/handlers.S,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** handlers.S 23 Apr 2003 23:15:21 -0000 1.18 --- handlers.S 9 May 2003 20:28:39 -0000 1.19 *************** *** 71,74 **** --- 71,75 ---- #include <xtensa/config/specreg.h> #include <xtensa/config/core.h> + #include <xtensa/xt2000.h> #include <asm/ptrace.h> #include <asm/kstack.h> *************** *** 172,177 **** double_noconversion: /* Compute the exception type. PS (in a0) indicates user vs ! * kernel. MISC_REG_0 indicates whether the double exception ! * occurred in the window vector. */ movi a0, EXCTYPE_DOUBLE_KERNEL --- 173,177 ---- double_noconversion: /* Compute the exception type. PS (in a0) indicates user vs ! * kernel. */ movi a0, EXCTYPE_DOUBLE_KERNEL *************** *** 1265,1272 **** // the break, then the default exception handler is invoked. // ! l32i a6, a1, PT_EXCTYPE // exception type movi a4, c_exception_handlers /* XTFIXME: _bbsi instruction below */ ! // _bbsi.l a6, EXCTYPE_UNHANDLED_SHIFT, _excDefault // invoke default handler instead? addx4 a4, a7, a4 // index by cause into C exception handler table l32i a4, a4, 0 // load the exception handler --- 1265,1272 ---- // the break, then the default exception handler is invoked. // ! l32i a2, a1, PT_EXCTYPE // exception type movi a4, c_exception_handlers /* XTFIXME: _bbsi instruction below */ ! // _bbsi.l a2, EXCTYPE_UNHANDLED_SHIFT, _excDefault // invoke default handler instead? addx4 a4, a7, a4 // index by cause into C exception handler table l32i a4, a4, 0 // load the exception handler *************** *** 1287,1290 **** --- 1287,1291 ---- l32i a3, a1, PT_PS bbci.l a3, PS_UM_SHIFT, _excExitKernel + bbsi.l a2, EXCTYPE_DOUBLE_SHIFT, _excExitKernel // Check for softirq *************** *** 1838,1844 **** * and S32E instructions, because this move must be done with * the user's PS.RING privilege levels, not with ring 0 ! * (kernel's) privileges current active with PS.EXCM set. Note ! * that we also register a fixup routine with the double ! * exception vector in case a double exception occurs. */ --- 1839,1845 ---- * and S32E instructions, because this move must be done with * the user's PS.RING privilege levels, not with ring 0 ! * (kernel's) privileges currently active with PS.EXCM ! * set. Note that we also register a fixup routine with the ! * double exception vector in case a double exception occurs. */ *************** *** 1890,1897 **** _j 1f .align 8 ! s32i a4, a0, RSAVE_A4 // modify saved a4 _j 1f .align 8 ! s32i a5, a0, RSAVE_A5 // modify saved a5 _j 1f .align 8 --- 1891,1898 ---- _j 1f .align 8 ! s32i a2, a0, RSAVE_A4 // modify saved a4 _j 1f .align 8 ! s32i a2, a0, RSAVE_A5 // modify saved a5 _j 1f .align 8 *************** *** 3164,3165 **** --- 3165,3287 ---- #endif /* XCHAL_CP_NUM, or if at least one coproc exists */ + + + /* Entry point to panic handler of double exception vector. Control + * comes here when we are toasted. We just save off information, + * display something on the LED (if on XT2000), and loop forever. + * + * Entry conditions are: + * + * a0 is undefined + * a1 points to dispatch table + * a2 is undefined + * original a0 is in DEPC + * original a1 is in EXCSAVE_1 + * original a2 is in [ EXCSAVE_1 + TABLE_SAVEA2 ] + * DEPC saved in [ EXCSAVE_1 + TABLE_SAVEA0 ] + * All other register contain their original values. + */ + + + #define CRITICAL_SAVE_A0 0 + #define CRITICAL_SAVE_A1 4 + #define CRITICAL_SAVE_A2 8 + #define CRITICAL_SAVE_A3 12 + #define CRITICAL_SAVE_A4 16 + #define CRITICAL_SAVE_A5 20 + #define CRITICAL_SAVE_A6 24 + #define CRITICAL_SAVE_A7 28 + #define CRITICAL_SAVE_A8 32 + #define CRITICAL_SAVE_A9 36 + #define CRITICAL_SAVE_A10 40 + #define CRITICAL_SAVE_A11 44 + #define CRITICAL_SAVE_A12 48 + #define CRITICAL_SAVE_A13 52 + #define CRITICAL_SAVE_A14 56 + #define CRITICAL_SAVE_A15 60 + #define CRITICAL_SAVE_DEPC 64 + + #define CRITICAL_SAVE_TOTAL (17*4) + + .data + .align 4 + critical_save_area: + .space CRITICAL_SAVE_TOTAL, 0 + + .text + .align 4 + .global handle_critical + handle_critical: + + l32i a2, a1, TABLE_SAVEA2 + movi a0, critical_save_area + + s32i a2, a0, CRITICAL_SAVE_A2 + s32i a3, a0, CRITICAL_SAVE_A3 + s32i a4, a0, CRITICAL_SAVE_A4 + s32i a5, a0, CRITICAL_SAVE_A5 + s32i a6, a0, CRITICAL_SAVE_A6 + s32i a7, a0, CRITICAL_SAVE_A7 + s32i a8, a0, CRITICAL_SAVE_A8 + s32i a9, a0, CRITICAL_SAVE_A9 + s32i a10, a0, CRITICAL_SAVE_A10 + s32i a11, a0, CRITICAL_SAVE_A11 + s32i a12, a0, CRITICAL_SAVE_A12 + s32i a13, a0, CRITICAL_SAVE_A13 + s32i a14, a0, CRITICAL_SAVE_A14 + s32i a15, a0, CRITICAL_SAVE_A15 + + l32i a2, a1, TABLE_SAVEA0 + xsr a1, EXCSAVE_1 + s32i a2, a0, CRITICAL_SAVE_DEPC + s32i a1, a0, CRITICAL_SAVE_A1 + + mov a3, a0 + xsr a2, DEPC /* we're also restoring DEPC here */ + s32i a2, a3, CRITICAL_SAVE_A0 + + /* I suppose we could save other things, but other processor + * state is also accessible via OCD for now. Maybe in the + * future for some fancy print routine... */ + + j 2f + .align 4 + 1: .word 'C' + .word 'R' + .word 'I' + .word 'T' + .word 'I' + .word 'C' + .word 'A' + .word 'L' + .word 0 + 2: movi a2, 1b + j display_panic + + .align 4 + .global display_panic + display_panic: + + #ifdef XT2000_SYSRST_VADDR + + bnez a2, 3f + j 2f + .align 4 + 1: .word 'P' + .word 'A' + .word 'N' + .word 'I' + .word 'C' + .word 0 + 2: + movi a2, 1b /* address of string */ + 3: movi a3, XTBOARD_LED_VADDR+0xE0 /* address of LED display */ + l32i a4, a2, 0 + 4: addi a2, a2, 4 + s32i a4, a3, 0 + l32i a4, a2, 0 + addi a3, a3, 4 + bnez a4, 4b + #endif /* XT2000_SYSRST_VADDR */ + + 9: j 9b /* loop forever */ Index: vectors.S =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/vectors.S,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** vectors.S 28 Apr 2003 23:21:10 -0000 1.8 --- vectors.S 9 May 2003 20:28:39 -0000 1.9 *************** *** 40,44 **** #include <xtensa/config/core.h> #include <xtensa/config/system.h> - #include <xtensa/xt2000.h> #include <asm/ptrace.h> --- 40,43 ---- *************** *** 165,169 **** 1: l32i a0, a1, TABLE_FIXUP ! beqz a0, CriticalExc movi a2, ( 0 << EXCTYPE_DOUBLE_WIND_SHIFT ) jx a0 --- 164,168 ---- 1: l32i a0, a1, TABLE_FIXUP ! _beqz a0, CriticalExc movi a2, ( 0 << EXCTYPE_DOUBLE_WIND_SHIFT ) jx a0 *************** *** 216,297 **** - /* XTFIXME: recover_or_crit and slowdeg are dead code now, but useful - * as an alternate LED msg example. We still use CriticalExc as a - * sort of panic indicator. */ - - recover_or_crit: - j 2f - .align 4 - 1: .word 'R' - .word 'E' - .word 'C' - .word 'O' - .word 'V' - .word 'E' - .word 'R' - .word 0 - 2: movi a2, 1b - j display_panic - slowdeh: - j 2f - .align 4 - 1: .word 'S' - .word 'L' - .word 'O' - .word 'W' - .word 'D' - .word 'E' - .word 'H' - .word 0 - 2: movi a2, 1b - j display_panic CriticalExc: ! j 2f ! .align 4 ! 1: .word 'C' ! .word 'R' ! .word 'I' ! .word 'T' ! .word 'I' ! .word 'C' ! .word 'A' ! .word 'L' ! .word 0 ! 2: movi a2, 1b ! j display_panic ! ! ! /* Expensive ASCII characters!! We can improve the efficiency of ! * display_panic if it becomes more widely used. */ ! ! .align 4 ! .global display_panic ! display_panic: ! ! #ifdef XT2000_SYSRST_VADDR - bnez a2, 3f - j 2f - .align 4 - 1: .word 'P' - .word 'A' - .word 'N' - .word 'I' - .word 'C' - .word 0 - 2: - movi a2, 1b /* address of string */ - 3: movi a3, XTBOARD_LED_VADDR+0xE0 /* address of LED display */ - l32i a4, a2, 0 - 4: addi a2, a2, 4 - s32i a4, a3, 0 - l32i a4, a2, 0 - addi a3, a3, 4 - bnez a4, 4b - #endif /* XT2000_SYSRST_VADDR */ - 9: j 9b /* loop forever */ - - #if 0 --- 215,223 ---- CriticalExc: ! movi a0, handle_critical ! jx a0 #if 0 |