Loading arch/xtensa/kernel/align.S +1 −0 Original line number Diff line number Diff line Loading @@ -450,6 +450,7 @@ ENTRY(fast_unaligned) 1: movi a0, _user_exception jx a0 ENDPROC(fast_unaligned) #endif /* XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION */ arch/xtensa/kernel/coprocessor.S +22 −0 Original line number Diff line number Diff line Loading @@ -43,10 +43,13 @@ /* IO protection is currently unsupported. */ ENTRY(fast_io_protect) wsr a0, excsave1 movi a0, unrecoverable_exception callx0 a0 ENDPROC(fast_io_protect) #if XTENSA_HAVE_COPROCESSORS /* Loading Loading @@ -139,6 +142,7 @@ ENTRY(fast_io_protect) */ ENTRY(coprocessor_save) entry a1, 32 s32i a0, a1, 0 movi a0, .Lsave_cp_regs_jump_table Loading @@ -150,7 +154,10 @@ ENTRY(coprocessor_save) 1: l32i a0, a1, 0 retw ENDPROC(coprocessor_save) ENTRY(coprocessor_load) entry a1, 32 s32i a0, a1, 0 movi a0, .Lload_cp_regs_jump_table Loading @@ -162,6 +169,8 @@ ENTRY(coprocessor_load) 1: l32i a0, a1, 0 retw ENDPROC(coprocessor_load) /* * coprocessor_flush(struct task_info*, index) * a2 a3 Loading @@ -178,6 +187,7 @@ ENTRY(coprocessor_load) ENTRY(coprocessor_flush) entry a1, 32 s32i a0, a1, 0 movi a0, .Lsave_cp_regs_jump_table Loading @@ -191,6 +201,8 @@ ENTRY(coprocessor_flush) 1: l32i a0, a1, 0 retw ENDPROC(coprocessor_flush) ENTRY(coprocessor_restore) entry a1, 32 s32i a0, a1, 0 Loading @@ -205,6 +217,8 @@ ENTRY(coprocessor_restore) 1: l32i a0, a1, 0 retw ENDPROC(coprocessor_restore) /* * Entry condition: * Loading @@ -220,10 +234,12 @@ ENTRY(coprocessor_restore) */ ENTRY(fast_coprocessor_double) wsr a0, excsave1 movi a0, unrecoverable_exception callx0 a0 ENDPROC(fast_coprocessor_double) ENTRY(fast_coprocessor) Loading Loading @@ -327,9 +343,15 @@ ENTRY(fast_coprocessor) rfe ENDPROC(fast_coprocessor) .data ENTRY(coprocessor_owner) .fill XCHAL_CP_MAX, 4, 0 END(coprocessor_owner) #endif /* XTENSA_HAVE_COPROCESSORS */ arch/xtensa/kernel/entry.S +28 −2 Original line number Diff line number Diff line Loading @@ -219,6 +219,7 @@ _user_exception: j common_exception ENDPROC(user_exception) /* * First-level exit handler for kernel exceptions Loading Loading @@ -641,6 +642,8 @@ common_exception_exit: l32i a1, a1, PT_AREG1 rfde ENDPROC(kernel_exception) /* * Debug exception handler. * Loading Loading @@ -701,6 +704,7 @@ ENTRY(debug_exception) /* Debug exception while in exception mode. */ 1: j 1b // FIXME!! ENDPROC(debug_exception) /* * We get here in case of an unrecoverable exception. Loading Loading @@ -751,6 +755,7 @@ ENTRY(unrecoverable_exception) 1: j 1b ENDPROC(unrecoverable_exception) /* -------------------------- FAST EXCEPTION HANDLERS ----------------------- */ Loading Loading @@ -929,6 +934,7 @@ ENTRY(fast_alloca) l32i a2, a2, PT_AREG2 rfe ENDPROC(fast_alloca) /* * fast system calls. Loading Loading @@ -966,6 +972,8 @@ ENTRY(fast_syscall_kernel) j kernel_exception ENDPROC(fast_syscall_kernel) ENTRY(fast_syscall_user) /* Skip syscall. */ Loading @@ -983,6 +991,8 @@ ENTRY(fast_syscall_user) j user_exception ENDPROC(fast_syscall_user) ENTRY(fast_syscall_unrecoverable) /* Restore all states. */ Loading @@ -995,7 +1005,7 @@ ENTRY(fast_syscall_unrecoverable) movi a0, unrecoverable_exception callx0 a0 ENDPROC(fast_syscall_unrecoverable) /* * sysxtensa syscall handler Loading Loading @@ -1101,7 +1111,7 @@ CATCH movi a2, -EINVAL rfe ENDPROC(fast_syscall_xtensa) /* fast_syscall_spill_registers. Loading Loading @@ -1160,6 +1170,8 @@ ENTRY(fast_syscall_spill_registers) movi a2, 0 rfe ENDPROC(fast_syscall_spill_registers) /* Fixup handler. * * We get here if the spill routine causes an exception, e.g. tlb miss. Loading Loading @@ -1464,6 +1476,8 @@ ENTRY(_spill_registers) callx0 a0 # should not return 1: j 1b ENDPROC(_spill_registers) #ifdef CONFIG_MMU /* * We should never get here. Bail out! Loading @@ -1475,6 +1489,8 @@ ENTRY(fast_second_level_miss_double_kernel) callx0 a0 # should not return 1: j 1b ENDPROC(fast_second_level_miss_double_kernel) /* First-level entry handler for user, kernel, and double 2nd-level * TLB miss exceptions. Note that for now, user and kernel miss * exceptions share the same entry point and are handled identically. Loading Loading @@ -1682,6 +1698,7 @@ ENTRY(fast_second_level_miss) j _kernel_exception 1: j _user_exception ENDPROC(fast_second_level_miss) /* * StoreProhibitedException Loading Loading @@ -1777,6 +1794,9 @@ ENTRY(fast_store_prohibited) bbsi.l a2, PS_UM_BIT, 1f j _kernel_exception 1: j _user_exception ENDPROC(fast_store_prohibited) #endif /* CONFIG_MMU */ /* Loading @@ -1787,6 +1807,7 @@ ENTRY(fast_store_prohibited) */ ENTRY(system_call) entry a1, 32 /* regs->syscall = regs->areg[2] */ Loading Loading @@ -1831,6 +1852,8 @@ ENTRY(system_call) callx4 a4 retw ENDPROC(system_call) /* * Task switch. Loading Loading @@ -1899,6 +1922,7 @@ ENTRY(_switch_to) retw ENDPROC(_switch_to) ENTRY(ret_from_fork) Loading @@ -1914,6 +1938,8 @@ ENTRY(ret_from_fork) j common_exception_return ENDPROC(ret_from_fork) /* * Kernel thread creation helper * On entry, set up by copy_thread: a2 = thread_fn, a3 = thread_fn arg Loading arch/xtensa/kernel/head.S +10 −4 Original line number Diff line number Diff line Loading @@ -47,16 +47,19 @@ */ __HEAD .globl _start _start: _j 2f ENTRY(_start) _j 2f .align 4 1: .word _startup 2: l32r a0, 1b jx a0 ENDPROC(_start) .section .init.text, "ax" .align 4 _startup: ENTRY(_startup) /* Disable interrupts and exceptions. */ Loading Loading @@ -230,6 +233,7 @@ _startup: should_never_return: j should_never_return ENDPROC(_startup) /* * BSS section Loading @@ -239,6 +243,8 @@ __PAGE_ALIGNED_BSS #ifdef CONFIG_MMU ENTRY(swapper_pg_dir) .fill PAGE_SIZE, 1, 0 END(swapper_pg_dir) #endif ENTRY(empty_zero_page) .fill PAGE_SIZE, 1, 0 END(empty_zero_page) arch/xtensa/kernel/vectors.S +33 −18 Original line number Diff line number Diff line Loading @@ -79,6 +79,8 @@ ENTRY(_UserExceptionVector) l32i a0, a0, EXC_TABLE_FAST_USER # load handler jx a0 ENDPROC(_UserExceptionVector) /* * Kernel exception vector. (Exceptions with PS.UM == 0, PS.EXCM == 0) * Loading @@ -103,6 +105,7 @@ ENTRY(_KernelExceptionVector) l32i a0, a0, EXC_TABLE_FAST_KERNEL # load handler address jx a0 ENDPROC(_KernelExceptionVector) /* * Double exception vector (Exceptions with PS.EXCM == 1) Loading Loading @@ -344,6 +347,7 @@ ENTRY(_DoubleExceptionVector) .end literal_prefix ENDPROC(_DoubleExceptionVector) /* * Debug interrupt vector Loading @@ -355,9 +359,11 @@ ENTRY(_DoubleExceptionVector) .section .DebugInterruptVector.text, "ax" ENTRY(_DebugInterruptVector) xsr a0, SREG_EXCSAVE + XCHAL_DEBUGLEVEL jx a0 ENDPROC(_DebugInterruptVector) /* Window overflow and underflow handlers. Loading @@ -369,38 +375,43 @@ ENTRY(_DebugInterruptVector) * we try to access any page that would cause a page fault early. */ #define ENTRY_ALIGN64(name) \ .globl name; \ .align 64; \ name: .section .WindowVectors.text, "ax" /* 4-Register Window Overflow Vector (Handler) */ .align 64 .global _WindowOverflow4 _WindowOverflow4: ENTRY_ALIGN64(_WindowOverflow4) s32e a0, a5, -16 s32e a1, a5, -12 s32e a2, a5, -8 s32e a3, a5, -4 rfwo ENDPROC(_WindowOverflow4) /* 4-Register Window Underflow Vector (Handler) */ .align 64 .global _WindowUnderflow4 _WindowUnderflow4: ENTRY_ALIGN64(_WindowUnderflow4) l32e a0, a5, -16 l32e a1, a5, -12 l32e a2, a5, -8 l32e a3, a5, -4 rfwu ENDPROC(_WindowUnderflow4) /* 8-Register Window Overflow Vector (Handler) */ .align 64 .global _WindowOverflow8 _WindowOverflow8: ENTRY_ALIGN64(_WindowOverflow8) s32e a0, a9, -16 l32e a0, a1, -12 s32e a2, a9, -8 Loading @@ -412,11 +423,12 @@ _WindowOverflow8: s32e a7, a0, -20 rfwo ENDPROC(_WindowOverflow8) /* 8-Register Window Underflow Vector (Handler) */ .align 64 .global _WindowUnderflow8 _WindowUnderflow8: ENTRY_ALIGN64(_WindowUnderflow8) l32e a1, a9, -12 l32e a0, a9, -16 l32e a7, a1, -12 Loading @@ -428,12 +440,12 @@ _WindowUnderflow8: l32e a7, a7, -20 rfwu ENDPROC(_WindowUnderflow8) /* 12-Register Window Overflow Vector (Handler) */ .align 64 .global _WindowOverflow12 _WindowOverflow12: ENTRY_ALIGN64(_WindowOverflow12) s32e a0, a13, -16 l32e a0, a1, -12 s32e a1, a13, -12 Loading @@ -449,11 +461,12 @@ _WindowOverflow12: s32e a11, a0, -20 rfwo ENDPROC(_WindowOverflow12) /* 12-Register Window Underflow Vector (Handler) */ .align 64 .global _WindowUnderflow12 _WindowUnderflow12: ENTRY_ALIGN64(_WindowUnderflow12) l32e a1, a13, -12 l32e a0, a13, -16 l32e a11, a1, -12 Loading @@ -469,6 +482,8 @@ _WindowUnderflow12: l32e a11, a11, -20 rfwu ENDPROC(_WindowUnderflow12) .text Loading
arch/xtensa/kernel/align.S +1 −0 Original line number Diff line number Diff line Loading @@ -450,6 +450,7 @@ ENTRY(fast_unaligned) 1: movi a0, _user_exception jx a0 ENDPROC(fast_unaligned) #endif /* XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION */
arch/xtensa/kernel/coprocessor.S +22 −0 Original line number Diff line number Diff line Loading @@ -43,10 +43,13 @@ /* IO protection is currently unsupported. */ ENTRY(fast_io_protect) wsr a0, excsave1 movi a0, unrecoverable_exception callx0 a0 ENDPROC(fast_io_protect) #if XTENSA_HAVE_COPROCESSORS /* Loading Loading @@ -139,6 +142,7 @@ ENTRY(fast_io_protect) */ ENTRY(coprocessor_save) entry a1, 32 s32i a0, a1, 0 movi a0, .Lsave_cp_regs_jump_table Loading @@ -150,7 +154,10 @@ ENTRY(coprocessor_save) 1: l32i a0, a1, 0 retw ENDPROC(coprocessor_save) ENTRY(coprocessor_load) entry a1, 32 s32i a0, a1, 0 movi a0, .Lload_cp_regs_jump_table Loading @@ -162,6 +169,8 @@ ENTRY(coprocessor_load) 1: l32i a0, a1, 0 retw ENDPROC(coprocessor_load) /* * coprocessor_flush(struct task_info*, index) * a2 a3 Loading @@ -178,6 +187,7 @@ ENTRY(coprocessor_load) ENTRY(coprocessor_flush) entry a1, 32 s32i a0, a1, 0 movi a0, .Lsave_cp_regs_jump_table Loading @@ -191,6 +201,8 @@ ENTRY(coprocessor_flush) 1: l32i a0, a1, 0 retw ENDPROC(coprocessor_flush) ENTRY(coprocessor_restore) entry a1, 32 s32i a0, a1, 0 Loading @@ -205,6 +217,8 @@ ENTRY(coprocessor_restore) 1: l32i a0, a1, 0 retw ENDPROC(coprocessor_restore) /* * Entry condition: * Loading @@ -220,10 +234,12 @@ ENTRY(coprocessor_restore) */ ENTRY(fast_coprocessor_double) wsr a0, excsave1 movi a0, unrecoverable_exception callx0 a0 ENDPROC(fast_coprocessor_double) ENTRY(fast_coprocessor) Loading Loading @@ -327,9 +343,15 @@ ENTRY(fast_coprocessor) rfe ENDPROC(fast_coprocessor) .data ENTRY(coprocessor_owner) .fill XCHAL_CP_MAX, 4, 0 END(coprocessor_owner) #endif /* XTENSA_HAVE_COPROCESSORS */
arch/xtensa/kernel/entry.S +28 −2 Original line number Diff line number Diff line Loading @@ -219,6 +219,7 @@ _user_exception: j common_exception ENDPROC(user_exception) /* * First-level exit handler for kernel exceptions Loading Loading @@ -641,6 +642,8 @@ common_exception_exit: l32i a1, a1, PT_AREG1 rfde ENDPROC(kernel_exception) /* * Debug exception handler. * Loading Loading @@ -701,6 +704,7 @@ ENTRY(debug_exception) /* Debug exception while in exception mode. */ 1: j 1b // FIXME!! ENDPROC(debug_exception) /* * We get here in case of an unrecoverable exception. Loading Loading @@ -751,6 +755,7 @@ ENTRY(unrecoverable_exception) 1: j 1b ENDPROC(unrecoverable_exception) /* -------------------------- FAST EXCEPTION HANDLERS ----------------------- */ Loading Loading @@ -929,6 +934,7 @@ ENTRY(fast_alloca) l32i a2, a2, PT_AREG2 rfe ENDPROC(fast_alloca) /* * fast system calls. Loading Loading @@ -966,6 +972,8 @@ ENTRY(fast_syscall_kernel) j kernel_exception ENDPROC(fast_syscall_kernel) ENTRY(fast_syscall_user) /* Skip syscall. */ Loading @@ -983,6 +991,8 @@ ENTRY(fast_syscall_user) j user_exception ENDPROC(fast_syscall_user) ENTRY(fast_syscall_unrecoverable) /* Restore all states. */ Loading @@ -995,7 +1005,7 @@ ENTRY(fast_syscall_unrecoverable) movi a0, unrecoverable_exception callx0 a0 ENDPROC(fast_syscall_unrecoverable) /* * sysxtensa syscall handler Loading Loading @@ -1101,7 +1111,7 @@ CATCH movi a2, -EINVAL rfe ENDPROC(fast_syscall_xtensa) /* fast_syscall_spill_registers. Loading Loading @@ -1160,6 +1170,8 @@ ENTRY(fast_syscall_spill_registers) movi a2, 0 rfe ENDPROC(fast_syscall_spill_registers) /* Fixup handler. * * We get here if the spill routine causes an exception, e.g. tlb miss. Loading Loading @@ -1464,6 +1476,8 @@ ENTRY(_spill_registers) callx0 a0 # should not return 1: j 1b ENDPROC(_spill_registers) #ifdef CONFIG_MMU /* * We should never get here. Bail out! Loading @@ -1475,6 +1489,8 @@ ENTRY(fast_second_level_miss_double_kernel) callx0 a0 # should not return 1: j 1b ENDPROC(fast_second_level_miss_double_kernel) /* First-level entry handler for user, kernel, and double 2nd-level * TLB miss exceptions. Note that for now, user and kernel miss * exceptions share the same entry point and are handled identically. Loading Loading @@ -1682,6 +1698,7 @@ ENTRY(fast_second_level_miss) j _kernel_exception 1: j _user_exception ENDPROC(fast_second_level_miss) /* * StoreProhibitedException Loading Loading @@ -1777,6 +1794,9 @@ ENTRY(fast_store_prohibited) bbsi.l a2, PS_UM_BIT, 1f j _kernel_exception 1: j _user_exception ENDPROC(fast_store_prohibited) #endif /* CONFIG_MMU */ /* Loading @@ -1787,6 +1807,7 @@ ENTRY(fast_store_prohibited) */ ENTRY(system_call) entry a1, 32 /* regs->syscall = regs->areg[2] */ Loading Loading @@ -1831,6 +1852,8 @@ ENTRY(system_call) callx4 a4 retw ENDPROC(system_call) /* * Task switch. Loading Loading @@ -1899,6 +1922,7 @@ ENTRY(_switch_to) retw ENDPROC(_switch_to) ENTRY(ret_from_fork) Loading @@ -1914,6 +1938,8 @@ ENTRY(ret_from_fork) j common_exception_return ENDPROC(ret_from_fork) /* * Kernel thread creation helper * On entry, set up by copy_thread: a2 = thread_fn, a3 = thread_fn arg Loading
arch/xtensa/kernel/head.S +10 −4 Original line number Diff line number Diff line Loading @@ -47,16 +47,19 @@ */ __HEAD .globl _start _start: _j 2f ENTRY(_start) _j 2f .align 4 1: .word _startup 2: l32r a0, 1b jx a0 ENDPROC(_start) .section .init.text, "ax" .align 4 _startup: ENTRY(_startup) /* Disable interrupts and exceptions. */ Loading Loading @@ -230,6 +233,7 @@ _startup: should_never_return: j should_never_return ENDPROC(_startup) /* * BSS section Loading @@ -239,6 +243,8 @@ __PAGE_ALIGNED_BSS #ifdef CONFIG_MMU ENTRY(swapper_pg_dir) .fill PAGE_SIZE, 1, 0 END(swapper_pg_dir) #endif ENTRY(empty_zero_page) .fill PAGE_SIZE, 1, 0 END(empty_zero_page)
arch/xtensa/kernel/vectors.S +33 −18 Original line number Diff line number Diff line Loading @@ -79,6 +79,8 @@ ENTRY(_UserExceptionVector) l32i a0, a0, EXC_TABLE_FAST_USER # load handler jx a0 ENDPROC(_UserExceptionVector) /* * Kernel exception vector. (Exceptions with PS.UM == 0, PS.EXCM == 0) * Loading @@ -103,6 +105,7 @@ ENTRY(_KernelExceptionVector) l32i a0, a0, EXC_TABLE_FAST_KERNEL # load handler address jx a0 ENDPROC(_KernelExceptionVector) /* * Double exception vector (Exceptions with PS.EXCM == 1) Loading Loading @@ -344,6 +347,7 @@ ENTRY(_DoubleExceptionVector) .end literal_prefix ENDPROC(_DoubleExceptionVector) /* * Debug interrupt vector Loading @@ -355,9 +359,11 @@ ENTRY(_DoubleExceptionVector) .section .DebugInterruptVector.text, "ax" ENTRY(_DebugInterruptVector) xsr a0, SREG_EXCSAVE + XCHAL_DEBUGLEVEL jx a0 ENDPROC(_DebugInterruptVector) /* Window overflow and underflow handlers. Loading @@ -369,38 +375,43 @@ ENTRY(_DebugInterruptVector) * we try to access any page that would cause a page fault early. */ #define ENTRY_ALIGN64(name) \ .globl name; \ .align 64; \ name: .section .WindowVectors.text, "ax" /* 4-Register Window Overflow Vector (Handler) */ .align 64 .global _WindowOverflow4 _WindowOverflow4: ENTRY_ALIGN64(_WindowOverflow4) s32e a0, a5, -16 s32e a1, a5, -12 s32e a2, a5, -8 s32e a3, a5, -4 rfwo ENDPROC(_WindowOverflow4) /* 4-Register Window Underflow Vector (Handler) */ .align 64 .global _WindowUnderflow4 _WindowUnderflow4: ENTRY_ALIGN64(_WindowUnderflow4) l32e a0, a5, -16 l32e a1, a5, -12 l32e a2, a5, -8 l32e a3, a5, -4 rfwu ENDPROC(_WindowUnderflow4) /* 8-Register Window Overflow Vector (Handler) */ .align 64 .global _WindowOverflow8 _WindowOverflow8: ENTRY_ALIGN64(_WindowOverflow8) s32e a0, a9, -16 l32e a0, a1, -12 s32e a2, a9, -8 Loading @@ -412,11 +423,12 @@ _WindowOverflow8: s32e a7, a0, -20 rfwo ENDPROC(_WindowOverflow8) /* 8-Register Window Underflow Vector (Handler) */ .align 64 .global _WindowUnderflow8 _WindowUnderflow8: ENTRY_ALIGN64(_WindowUnderflow8) l32e a1, a9, -12 l32e a0, a9, -16 l32e a7, a1, -12 Loading @@ -428,12 +440,12 @@ _WindowUnderflow8: l32e a7, a7, -20 rfwu ENDPROC(_WindowUnderflow8) /* 12-Register Window Overflow Vector (Handler) */ .align 64 .global _WindowOverflow12 _WindowOverflow12: ENTRY_ALIGN64(_WindowOverflow12) s32e a0, a13, -16 l32e a0, a1, -12 s32e a1, a13, -12 Loading @@ -449,11 +461,12 @@ _WindowOverflow12: s32e a11, a0, -20 rfwo ENDPROC(_WindowOverflow12) /* 12-Register Window Underflow Vector (Handler) */ .align 64 .global _WindowUnderflow12 _WindowUnderflow12: ENTRY_ALIGN64(_WindowUnderflow12) l32e a1, a13, -12 l32e a0, a13, -16 l32e a11, a1, -12 Loading @@ -469,6 +482,8 @@ _WindowUnderflow12: l32e a11, a11, -20 rfwu ENDPROC(_WindowUnderflow12) .text