From: Chris Zankel Date: Tue, 23 Aug 2011 02:28:46 +0000 (-0700) Subject: xtensa: remove defining register numbers X-Git-Tag: next-20110830~78^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=29aced688a9321e3da04a45ad94407dfe7c903f7;p=karo-tx-linux.git xtensa: remove defining register numbers We used to define register numbers instead of letting the assembler handling them by name. One of the registers, PS, clashed with a definition in irq/debug.h Signed-off-by: Chris Zankel --- diff --git a/arch/xtensa/include/asm/irqflags.h b/arch/xtensa/include/asm/irqflags.h index dae9a8bdcb17..6015371be49e 100644 --- a/arch/xtensa/include/asm/irqflags.h +++ b/arch/xtensa/include/asm/irqflags.h @@ -12,6 +12,7 @@ #define _XTENSA_IRQFLAGS_H #include +#include static inline unsigned long arch_local_save_flags(void) { diff --git a/arch/xtensa/include/asm/regs.h b/arch/xtensa/include/asm/regs.h index d4baed246928..f30b8bc59516 100644 --- a/arch/xtensa/include/asm/regs.h +++ b/arch/xtensa/include/asm/regs.h @@ -25,48 +25,49 @@ #ifndef _XTENSA_REGS_H #define _XTENSA_REGS_H -/* Special registers. */ - -#define LBEG 0 -#define LEND 1 -#define LCOUNT 2 -#define SAR 3 -#define BR 4 -#define SCOMPARE1 12 -#define ACCHI 16 -#define ACCLO 17 -#define MR 32 -#define WINDOWBASE 72 -#define WINDOWSTART 73 -#define PTEVADDR 83 -#define RASID 90 -#define ITLBCFG 91 -#define DTLBCFG 92 -#define IBREAKENABLE 96 -#define DDR 104 -#define IBREAKA 128 -#define DBREAKA 144 -#define DBREAKC 160 -#define EPC 176 -#define EPC_1 177 -#define DEPC 192 -#define EPS 192 -#define EPS_1 193 -#define EXCSAVE 208 -#define EXCSAVE_1 209 -#define INTERRUPT 226 -#define INTENABLE 228 -#define PS 230 -#define THREADPTR 231 -#define EXCCAUSE 232 -#define DEBUGCAUSE 233 -#define CCOUNT 234 -#define PRID 235 -#define ICOUNT 236 -#define ICOUNTLEVEL 237 -#define EXCVADDR 238 -#define CCOMPARE 240 -#define MISC 244 +/* Special register numbers + * + * LBEG 0 + * LEND 1 + * LCOUNT 2 + * SAR 3 + * BR 4 + * SCOMPARE1 12 + * ACCHI 16 + * ACCLO 17 + * MR 32 + * WINDOWBASE 72 + * WINDOWSTART 73 + * PTEVADDR 83 + * RASID 90 + * ITLBCFG 91 + * DTLBCFG 92 + * IBREAKENABLE 96 + * DDR 104 + * IBREAKA 128 + * DBREAKA 144 + * DBREAKC 160 + * EPC 176 + * EPC1 177 + * DEPC 192 + * EPS 192 + * EPS1 193 + * EXCSAVE 208 + * EXCSAVE1 209 + * INTERRUPT 226 + * INTENABLE 228 + * PS 230 + * THREADPTR 231 + * EXCCAUSE 232 + * DEBUGCAUSE 233 + * CCOUNT 234 + * PRID 235 + * ICOUNT 236 + * ICOUNTLEVEL 237 + * EXCVADDR 238 + * CCOMPARE 240 + * MISC 244 + */ /* Special names for read-only and write-only interrupt registers. */ @@ -74,6 +75,12 @@ #define INTSET 226 #define INTCLEAR 227 +#define XTREG_EPS(x) (192+(x)) +#define XTREG_EPC(x) (176+(x)) +#define XTREG_EXCSAVE(x) (208+(x)) +#define XTREG_CCOMPARE(x) (240+(x)) +#define XTREG_DBREAKC(x) (160+(x)) + /* EXCCAUSE register fields */ #define EXCCAUSE_EXCCAUSE_SHIFT 0 diff --git a/arch/xtensa/include/asm/timex.h b/arch/xtensa/include/asm/timex.h index 053bc4272106..5ec20e13a774 100644 --- a/arch/xtensa/include/asm/timex.h +++ b/arch/xtensa/include/asm/timex.h @@ -65,8 +65,8 @@ extern cycles_t cacheflush_time; #define WSR_CCOUNT(r) asm volatile ("wsr %0,"__stringify(CCOUNT) :: "a" (r)) #define RSR_CCOUNT(r) asm volatile ("rsr %0,"__stringify(CCOUNT) : "=a" (r)) -#define WSR_CCOMPARE(x,r) asm volatile ("wsr %0,"__stringify(CCOMPARE)"+"__stringify(x) :: "a"(r)) -#define RSR_CCOMPARE(x,r) asm volatile ("rsr %0,"__stringify(CCOMPARE)"+"__stringify(x) : "=a"(r)) +#define WSR_CCOMPARE(x,r) asm volatile ("wsr %0,"__stringify(XTREG_CCOMPARE(x)) :: "a"(r)) +#define RSR_CCOMPARE(x,r) asm volatile ("rsr %0,"__stringify(XTREG_CCOMPARE(x)) : "=a"(r)) static inline unsigned long get_ccount (void) { diff --git a/arch/xtensa/kernel/align.S b/arch/xtensa/kernel/align.S index 33d6e9d2e83c..26bf88337c22 100644 --- a/arch/xtensa/kernel/align.S +++ b/arch/xtensa/kernel/align.S @@ -148,7 +148,7 @@ * a2: new stack pointer, original in DEPC * a3: dispatch table * depc: a2, original value saved on stack (PT_DEPC) - * excsave_1: a3 + * excsave1: a3 * * PT_DEPC >= VALID_DOUBLE_EXCEPTION_ADDRESS: double exception, DEPC * < VALID_DOUBLE_EXCEPTION_ADDRESS: regular exception @@ -171,7 +171,7 @@ ENTRY(fast_unaligned) s32i a8, a2, PT_AREG8 rsr a0, DEPC - xsr a3, EXCSAVE_1 + xsr a3, EXCSAVE1 s32i a0, a2, PT_AREG2 s32i a3, a2, PT_AREG3 @@ -184,7 +184,7 @@ ENTRY(fast_unaligned) * * The only possible danger of a double exception on the * following l32i instructions is kernel code in vmalloc - * memory. The processor was just executing at the EPC_1 + * memory. The processor was just executing at the EPC1 * address, and indeed, already fetched the instruction. That * guarantees a TLB mapping, which hasn't been replaced by * this unaligned exception handler that uses only static TLB @@ -197,7 +197,7 @@ ENTRY(fast_unaligned) /* Extract the instruction that caused the unaligned access. */ - rsr a7, EPC_1 # load exception address + rsr a7, EPC1 # load exception address movi a3, ~3 and a3, a3, a7 # mask lower bits @@ -284,7 +284,7 @@ ENTRY(fast_unaligned) wsr a5, LCOUNT #endif -1: wsr a7, EPC_1 # skip load instruction +1: wsr a7, EPC1 # skip load instruction extui a4, a4, INSN_T, 4 # extract target register movi a5, .Lload_table addx8 a4, a4, a5 @@ -364,7 +364,7 @@ ENTRY(fast_unaligned) wsr a4, LCOUNT #endif -1: wsr a7, EPC_1 # skip store instruction +1: wsr a7, EPC1 # skip store instruction movi a4, ~3 and a4, a4, a8 # align memory address @@ -406,7 +406,7 @@ ENTRY(fast_unaligned) .Lexit: movi a4, 0 - rsr a3, EXCSAVE_1 + rsr a3, EXCSAVE1 s32i a4, a3, EXC_TABLE_FIXUP /* Restore working register */ diff --git a/arch/xtensa/kernel/coprocessor.S b/arch/xtensa/kernel/coprocessor.S index 2bc1e145c0a4..095082f2555c 100644 --- a/arch/xtensa/kernel/coprocessor.S +++ b/arch/xtensa/kernel/coprocessor.S @@ -34,7 +34,7 @@ * a2: new stack pointer, original in DEPC * a3: dispatch table * depc: a2, original value saved on stack (PT_DEPC) - * excsave_1: a3 + * excsave1: a3 * * PT_DEPC >= VALID_DOUBLE_EXCEPTION_ADDRESS: double exception, DEPC * < VALID_DOUBLE_EXCEPTION_ADDRESS: regular exception @@ -43,7 +43,7 @@ /* IO protection is currently unsupported. */ ENTRY(fast_io_protect) - wsr a0, EXCSAVE_1 + wsr a0, EXCSAVE1 movi a0, unrecoverable_exception callx0 a0 @@ -213,14 +213,14 @@ ENTRY(coprocessor_restore) * a2: new stack pointer, original in DEPC * a3: dispatch table * depc: a2, original value saved on stack (PT_DEPC) - * excsave_1: a3 + * excsave1: a3 * * PT_DEPC >= VALID_DOUBLE_EXCEPTION_ADDRESS: double exception, DEPC * < VALID_DOUBLE_EXCEPTION_ADDRESS: regular exception */ ENTRY(fast_coprocessor_double) - wsr a0, EXCSAVE_1 + wsr a0, EXCSAVE1 movi a0, unrecoverable_exception callx0 a0 @@ -229,7 +229,7 @@ ENTRY(fast_coprocessor) /* Save remaining registers a1-a3 and SAR */ - xsr a3, EXCSAVE_1 + xsr a3, EXCSAVE1 s32i a3, a2, PT_AREG3 rsr a3, SAR s32i a1, a2, PT_AREG1 diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index 6223f3346b5c..b0d23a141fba 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S @@ -110,9 +110,9 @@ ENTRY(user_exception) - /* Save a2, a3, and depc, restore excsave_1 and set SP. */ + /* Save a2, a3, and depc, restore excsave1 and set SP. */ - xsr a3, EXCSAVE_1 + xsr a3, EXCSAVE1 rsr a0, DEPC s32i a1, a2, PT_AREG1 s32i a0, a2, PT_AREG2 @@ -234,7 +234,7 @@ _user_exception: * a2: new stack pointer, original in DEPC * a3: dispatch table * depc: a2, original value saved on stack (PT_DEPC) - * excsave_1: a3 + * excsave1: a3 * * PT_DEPC >= VALID_DOUBLE_EXCEPTION_ADDRESS: double exception, DEPC * < VALID_DOUBLE_EXCEPTION_ADDRESS: regular exception @@ -252,7 +252,7 @@ ENTRY(kernel_exception) /* Save a0, a2, a3, DEPC and set SP. */ - xsr a3, EXCSAVE_1 # restore a3, excsave_1 + xsr a3, EXCSAVE1 # restore a3, excsave1 rsr a0, DEPC # get a2 s32i a1, a2, PT_AREG1 s32i a0, a2, PT_AREG2 @@ -324,7 +324,7 @@ common_exception: /* Save some registers, disable loops and clear the syscall flag. */ rsr a2, DEBUGCAUSE - rsr a3, EPC_1 + rsr a3, EPC1 s32i a2, a1, PT_DEBUGCAUSE s32i a3, a1, PT_PC @@ -340,7 +340,7 @@ common_exception: rsr a0, EXCCAUSE movi a3, 0 - rsr a2, EXCSAVE_1 + rsr a2, EXCSAVE1 s32i a0, a1, PT_EXCCAUSE s32i a3, a2, EXC_TABLE_FIXUP @@ -604,7 +604,7 @@ common_exception_exit: 1: l32i a2, a1, PT_PC l32i a3, a1, PT_SAR - wsr a2, EPC_1 + wsr a2, EPC1 wsr a3, SAR /* Restore LBEG, LEND, LCOUNT */ @@ -651,14 +651,14 @@ common_exception_exit: ENTRY(debug_exception) - rsr a0, EPS + XCHAL_DEBUGLEVEL + rsr a0, XTREG_EPS(XCHAL_DEBUGLEVEL) bbsi.l a0, PS_EXCM_BIT, 1f # exception mode - /* Set EPC_1 and EXCCAUSE */ + /* Set EPC1 and EXCCAUSE */ wsr a2, DEPC # save a2 temporarily - rsr a2, EPC + XCHAL_DEBUGLEVEL - wsr a2, EPC_1 + rsr a2, XTREG_EPC(XCHAL_DEBUGLEVEL) + wsr a2, EPC1 movi a2, EXCCAUSE_MAPPED_DEBUG wsr a2, EXCCAUSE @@ -669,7 +669,7 @@ ENTRY(debug_exception) or a2, a0, a2 movi a0, debug_exception # restore a3, debug jump vector wsr a2, PS - xsr a0, EXCSAVE + XCHAL_DEBUGLEVEL + xsr a0, XTREG_EXCSAVE(XCHAL_DEBUGLEVEL) /* Switch to kernel/user stack, restore jump vector, and save a0 */ @@ -686,7 +686,7 @@ ENTRY(debug_exception) mov a1, a2 j _kernel_exception -2: rsr a2, EXCSAVE_1 +2: rsr a2, EXCSAVE1 l32i a2, a2, EXC_TABLE_KSTK # load kernel stack pointer s32i a0, a2, PT_AREG0 movi a0, 0 @@ -772,7 +772,7 @@ ENTRY(unrecoverable_exception) * a2: new stack pointer, original in DEPC * a3: dispatch table * depc: a2, original value saved on stack (PT_DEPC) - * excsave_1: a3 + * excsave1: a3 * * PT_DEPC >= VALID_DOUBLE_EXCEPTION_ADDRESS: double exception, DEPC * < VALID_DOUBLE_EXCEPTION_ADDRESS: regular exception @@ -802,10 +802,10 @@ ENTRY(fast_alloca) movi a0, 0 s32i a0, a3, EXC_TABLE_FIXUP - /* Restore a3, excsave_1 */ + /* Restore a3, excsave1 */ - xsr a3, EXCSAVE_1 # make sure excsave_1 is valid for dbl. - rsr a4, EPC_1 # get exception address + xsr a3, EXCSAVE1 # make sure excsave1 is valid for dbl. + rsr a4, EPC1 # get exception address s32i a3, a2, PT_AREG3 # save a3 to stack #ifdef ALLOCA_EXCEPTION_IN_IRAM @@ -820,7 +820,7 @@ ENTRY(fast_alloca) jx a3 .Lunhandled_double: - wsr a0, EXCSAVE_1 + wsr a0, EXCSAVE1 movi a0, unrecoverable_exception callx0 a0 @@ -852,7 +852,7 @@ ENTRY(fast_alloca) #endif addi a4, a4, 3 # step over movsp _EXTUI_MOVSP_DST(a0) # extract destination register - wsr a4, EPC_1 # save new epc_1 + wsr a4, EPC1 # save new epc1 _bnei a0, 1, 1f # no 'movsp a1, ax': jump @@ -946,16 +946,16 @@ ENTRY(fast_alloca) * a2: new stack pointer, original in DEPC * a3: dispatch table * depc: a2, original value saved on stack (PT_DEPC) - * excsave_1: a3 + * excsave1: a3 */ ENTRY(fast_syscall_kernel) /* Skip syscall. */ - rsr a0, EPC_1 + rsr a0, EPC1 addi a0, a0, 3 - wsr a0, EPC_1 + wsr a0, EPC1 l32i a0, a2, PT_DEPC bgeui a0, VALID_DOUBLE_EXCEPTION_ADDRESS, fast_syscall_unrecoverable @@ -970,9 +970,9 @@ ENTRY(fast_syscall_user) /* Skip syscall. */ - rsr a0, EPC_1 + rsr a0, EPC1 addi a0, a0, 3 - wsr a0, EPC_1 + wsr a0, EPC1 l32i a0, a2, PT_DEPC bgeui a0, VALID_DOUBLE_EXCEPTION_ADDRESS, fast_syscall_unrecoverable @@ -989,9 +989,9 @@ ENTRY(fast_syscall_unrecoverable) l32i a0, a2, PT_AREG0 # restore a0 xsr a2, DEPC # restore a2, depc - rsr a3, EXCSAVE_1 + rsr a3, EXCSAVE1 - wsr a0, EXCSAVE_1 + wsr a0, EXCSAVE1 movi a0, unrecoverable_exception callx0 a0 @@ -1011,10 +1011,10 @@ ENTRY(fast_syscall_unrecoverable) * a0: a2 (syscall-nr), original value saved on stack (PT_AREG0) * a1: a1 * a2: new stack pointer, original in a0 and DEPC - * a3: dispatch table, original in excsave_1 + * a3: dispatch table, original in excsave1 * a4..a15: unchanged * depc: a2, original value saved on stack (PT_DEPC) - * excsave_1: a3 + * excsave1: a3 * * PT_DEPC >= VALID_DOUBLE_EXCEPTION_ADDRESS: double exception, DEPC * < VALID_DOUBLE_EXCEPTION_ADDRESS: regular exception @@ -1047,7 +1047,7 @@ ENTRY(fast_syscall_unrecoverable) ENTRY(fast_syscall_xtensa) - xsr a3, EXCSAVE_1 # restore a3, excsave1 + xsr a3, EXCSAVE1 # restore a3, excsave1 s32i a7, a2, PT_AREG7 # we need an additional register movi a7, 4 # sizeof(unsigned int) @@ -1113,7 +1113,7 @@ CATCH * a2: new stack pointer, original in DEPC * a3: dispatch table * depc: a2, original value saved on stack (PT_DEPC) - * excsave_1: a3 + * excsave1: a3 * * Note: We assume the stack pointer is EXC_TABLE_KSTK in the fixup handler. */ @@ -1130,7 +1130,7 @@ ENTRY(fast_syscall_spill_registers) /* Save a3 and SAR on stack. */ rsr a0, SAR - xsr a3, EXCSAVE_1 # restore a3 and excsave_1 + xsr a3, EXCSAVE1 # restore a3 and excsave1 s32i a3, a2, PT_AREG3 s32i a4, a2, PT_AREG4 s32i a0, a2, PT_AREG5 # store SAR to PT_AREG5 @@ -1182,7 +1182,7 @@ fast_syscall_spill_registers_fixup: * in WS, so that the exception handlers save them to the task stack. */ - rsr a3, EXCSAVE_1 # get spill-mask + rsr a3, EXCSAVE1 # get spill-mask slli a2, a3, 1 # shift left by one slli a3, a2, 32-WSBITS @@ -1196,9 +1196,9 @@ fast_syscall_spill_registers_fixup: /* Return to the original (user task) WINDOWBASE. * We leave the following frame behind: * a0, a1, a2 same - * a3: trashed (saved in excsave_1) + * a3: trashed (saved in excsave1) * depc: depc (we have to return to that address) - * excsave_1: a3 + * excsave1: a3 */ wsr a3, WINDOWBASE @@ -1208,7 +1208,7 @@ fast_syscall_spill_registers_fixup: * a0: return address * a1: used, stack pointer * a2: kernel stack pointer - * a3: available, saved in EXCSAVE_1 + * a3: available, saved in EXCSAVE1 * depc: exception address * excsave: a3 * Note: This frame might be the same as above. @@ -1240,7 +1240,7 @@ fast_syscall_spill_registers_fixup_return: /* Restore fixup handler. */ - xsr a3, EXCSAVE_1 + xsr a3, EXCSAVE1 movi a2, fast_syscall_spill_registers_fixup s32i a2, a3, EXC_TABLE_FIXUP rsr a2, WINDOWBASE @@ -1257,7 +1257,7 @@ fast_syscall_spill_registers_fixup_return: /* Restore a3 and return. */ movi a3, exc_table - xsr a3, EXCSAVE_1 + xsr a3, EXCSAVE1 rfde @@ -1447,7 +1447,7 @@ ENTRY(_spill_registers) movi a3, exc_table l32i a1, a3, EXC_TABLE_KSTK - wsr a3, EXCSAVE_1 + wsr a3, EXCSAVE1 movi a4, (1 << PS_WOE_BIT) | 1 wsr a4, PS @@ -1459,7 +1459,7 @@ ENTRY(_spill_registers) 1: /* Kernel space: PANIC! */ - wsr a0, EXCSAVE_1 + wsr a0, EXCSAVE1 movi a0, unrecoverable_exception callx0 a0 # should not return 1: j 1b @@ -1489,7 +1489,7 @@ ENTRY(fast_second_level_miss_double_kernel) * a2: new stack pointer, original in DEPC * a3: dispatch table * depc: a2, original value saved on stack (PT_DEPC) - * excsave_1: a3 + * excsave1: a3 * * PT_DEPC >= VALID_DOUBLE_EXCEPTION_ADDRESS: double exception, DEPC * < VALID_DOUBLE_EXCEPTION_ADDRESS: regular exception @@ -1583,7 +1583,7 @@ ENTRY(fast_second_level_miss) l32i a0, a2, PT_AREG0 l32i a1, a2, PT_AREG1 l32i a2, a2, PT_DEPC - xsr a3, EXCSAVE_1 + xsr a3, EXCSAVE1 bgeui a2, VALID_DOUBLE_EXCEPTION_ADDRESS, 1f @@ -1618,7 +1618,7 @@ ENTRY(fast_second_level_miss) /* Make sure the exception originated in the special functions */ movi a0, __tlbtemp_mapping_start - rsr a3, EPC_1 + rsr a3, EPC1 bltu a3, a0, 2f movi a0, __tlbtemp_mapping_end bgeu a3, a0, 2f @@ -1635,7 +1635,7 @@ ENTRY(fast_second_level_miss) /* Check if we have to restore an ITLB mapping. */ movi a1, __tlbtemp_mapping_itlb - rsr a3, EPC_1 + rsr a3, EPC1 sub a3, a3, a1 /* Calculate VPN */ @@ -1672,7 +1672,7 @@ ENTRY(fast_second_level_miss) movi a3, exc_table rsr a1, DEPC - xsr a3, EXCSAVE_1 + xsr a3, EXCSAVE1 s32i a1, a2, PT_AREG2 s32i a3, a2, PT_AREG3 mov a1, a2 @@ -1695,7 +1695,7 @@ ENTRY(fast_second_level_miss) * a2: new stack pointer, original in DEPC * a3: dispatch table * depc: a2, original value saved on stack (PT_DEPC) - * excsave_1: a3 + * excsave1: a3 * * PT_DEPC >= VALID_DOUBLE_EXCEPTION_ADDRESS: double exception, DEPC * < VALID_DOUBLE_EXCEPTION_ADDRESS: regular exception @@ -1749,7 +1749,7 @@ ENTRY(fast_store_prohibited) /* Restore excsave1 and a3. */ - xsr a3, EXCSAVE_1 + xsr a3, EXCSAVE1 bgeui a2, VALID_DOUBLE_EXCEPTION_ADDRESS, 1f rsr a2, DEPC @@ -1767,7 +1767,7 @@ ENTRY(fast_store_prohibited) 2: /* If there was a problem, handle fault in C */ rsr a4, DEPC # still holds a2 - xsr a3, EXCSAVE_1 + xsr a3, EXCSAVE1 s32i a4, a2, PT_AREG2 s32i a3, a2, PT_AREG3 l32i a4, a2, PT_AREG4 @@ -1902,7 +1902,7 @@ ENTRY(_switch_to) movi a14, (1 << PS_EXCM_BIT) | LOCKLEVEL xsr a14, PS - rsr a3, EXCSAVE_1 + rsr a3, EXCSAVE1 rsync s32i a3, a3, EXC_TABLE_FIXUP /* enter critical section */ @@ -1924,7 +1924,7 @@ ENTRY(_switch_to) * we return from kernel space. */ - rsr a3, EXCSAVE_1 # exc_table + rsr a3, EXCSAVE1 # exc_table movi a6, 0 addi a7, a5, PT_REGS_OFFSET s32i a6, a3, EXC_TABLE_FIXUP diff --git a/arch/xtensa/kernel/head.S b/arch/xtensa/kernel/head.S index 3ef91a73652d..68648c3700fc 100644 --- a/arch/xtensa/kernel/head.S +++ b/arch/xtensa/kernel/head.S @@ -63,9 +63,9 @@ _startup: movi a0, LOCKLEVEL wsr a0, PS - /* Preserve the pointer to the boot parameter list in EXCSAVE_1 */ + /* Preserve the pointer to the boot parameter list in EXCSAVE1 */ - wsr a2, EXCSAVE_1 + wsr a2, EXCSAVE1 /* Start with a fresh windowbase and windowstart. */ @@ -89,7 +89,7 @@ _startup: .set _index, 0 .rept XCHAL_NUM_DBREAK - 1 - wsr a0, DBREAKC + _index + wsr a0, XTREG_DBREAKC(_index) .set _index, _index + 1 .endr #endif @@ -108,7 +108,7 @@ _startup: .set _index, 0 .rept XCHAL_NUM_TIMERS - 1 - wsr a0, CCOMPARE + _index + wsr a0, XTREG_CCOMPARE(_index) .set _index, _index + 1 .endr @@ -212,12 +212,12 @@ _startup: /* Set up EXCSAVE[DEBUGLEVEL] to point to the Debug Exception Handler.*/ movi a2, debug_exception - wsr a2, EXCSAVE + XCHAL_DEBUGLEVEL + wsr a2, XTREG_EXCSAVE(XCHAL_DEBUGLEVEL) /* Set up EXCSAVE[1] to point to the exc_table. */ movi a6, exc_table - xsr a6, EXCSAVE_1 + xsr a6, EXCSAVE1 /* init_arch kick-starts the linux kernel */ diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c index e64efac3b9db..14e0b402ecd7 100644 --- a/arch/xtensa/kernel/traps.c +++ b/arch/xtensa/kernel/traps.c @@ -336,10 +336,10 @@ void __init trap_init(void) set_handler (EXC_TABLE_FAST_KERNEL/4 + cause, handler); } - /* Initialize EXCSAVE_1 to hold the address of the exception table. */ + /* Initialize EXCSAVE1 to hold the address of the exception table. */ i = (unsigned long)exc_table; - __asm__ __volatile__("wsr %0, "__stringify(EXCSAVE_1)"\n" : : "a" (i)); + __asm__ __volatile__("wsr %0, EXCSAVE1\n" : : "a" (i)); } /* diff --git a/arch/xtensa/kernel/vectors.S b/arch/xtensa/kernel/vectors.S index 70066e3582d0..5570ccb1d901 100644 --- a/arch/xtensa/kernel/vectors.S +++ b/arch/xtensa/kernel/vectors.S @@ -30,7 +30,7 @@ * a2: new stack pointer, original value in depc * a3: dispatch table * depc: a2, original value saved on stack (PT_DEPC) - * excsave_1: a3 + * excsave1: a3 * * The value for PT_DEPC saved to stack also functions as a boolean to * indicate that the exception is either a double or a regular exception: @@ -69,7 +69,7 @@ ENTRY(_UserExceptionVector) - xsr a3, EXCSAVE_1 # save a3 and get dispatch table + xsr a3, EXCSAVE1 # save a3 and get dispatch table wsr a2, DEPC # save a2 l32i a2, a3, EXC_TABLE_KSTK # load kernel stack to a2 s32i a0, a2, PT_AREG0 # save a0 to ESF @@ -93,7 +93,7 @@ ENTRY(_UserExceptionVector) ENTRY(_KernelExceptionVector) - xsr a3, EXCSAVE_1 # save a3, and get dispatch table + xsr a3, EXCSAVE1 # save a3, and get dispatch table wsr a2, DEPC # save a2 addi a2, a1, -16-PT_SIZE # adjust stack pointer s32i a0, a2, PT_AREG0 # save a0 to ESF @@ -126,7 +126,7 @@ ENTRY(_KernelExceptionVector) * processing occurs. Also in kernel mode, TLB misses can occur if accessing * vmalloc memory, possibly requiring repair in a double exception handler. * - * The variable at TABLE_FIXUP offset from the pointer in EXCSAVE_1 doubles as + * The variable at TABLE_FIXUP offset from the pointer in EXCSAVE1 doubles as * a boolean variable and a pointer to a fixup routine. If the variable * EXC_TABLE_FIXUP is non-zero, this handler jumps to that address. A value of * zero indicates to use the default kernel/user exception handler. @@ -167,7 +167,7 @@ ENTRY(_KernelExceptionVector) * a2: trashed, original value in EXC_TABLE_DOUBLE_A2 * a3: exctable * depc: a0 - * excsave_1: a3 + * excsave1: a3 * * - When the kernel enters the fixup handler, it still assumes it is in a * critical section, so EXC_TABLE_FIXUP variable is set to exc_table. @@ -189,7 +189,7 @@ ENTRY(_KernelExceptionVector) * All registers a0...a15 are unchanged from the last exception, except: * * a0: last address before we jumped to the unrecoverable_exception. - * excsave_1: a0 + * excsave1: a0 * * * See the handle_alloca_user and spill_registers routines for example clients. @@ -205,7 +205,7 @@ ENTRY(_DoubleExceptionVector) /* Deliberately destroy excsave (don't assume it's value was valid). */ - wsr a3, EXCSAVE_1 # save a3 + wsr a3, EXCSAVE1 # save a3 /* Check for kernel double exception (usually fatal). */ @@ -254,7 +254,7 @@ ENTRY(_DoubleExceptionVector) xsr a2, DEPC # save a2 and get stack pointer s32i a0, a2, PT_AREG0 - wsr a3, EXCSAVE_1 # save a3 + wsr a3, EXCSAVE1 # save a3 movi a3, exc_table rsr a0, EXCCAUSE @@ -331,8 +331,8 @@ ENTRY(_DoubleExceptionVector) xsr a0, DEPC .Lunrecoverable: - rsr a3, EXCSAVE_1 - wsr a0, EXCSAVE_1 + rsr a3, EXCSAVE1 + wsr a0, EXCSAVE1 movi a0, unrecoverable_exception callx0 a0 @@ -349,7 +349,7 @@ ENTRY(_DoubleExceptionVector) .section .DebugInterruptVector.text, "ax" ENTRY(_DebugInterruptVector) - xsr a0, EXCSAVE + XCHAL_DEBUGLEVEL + xsr a0, XTREG_EXCSAVE(XCHAL_DEBUGLEVEL) jx a0 diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S index 88ecea3facb4..6de5ec450862 100644 --- a/arch/xtensa/kernel/vmlinux.lds.S +++ b/arch/xtensa/kernel/vmlinux.lds.S @@ -113,6 +113,7 @@ SECTIONS /* Data section */ _fdata = .; + _sdata = .; RW_DATA_SECTION(XCHAL_ICACHE_LINESIZE, PAGE_SIZE, THREAD_SIZE) _edata = .;