Skip to content

Commit e369953

Browse files
committed
xtensa: move _SimulateUserKernelVectorException out of WindowVectors
In configurations without window registers support the section .WindowVectors.text may never be linked. _SimulateUserKernelVectorException is a common handler for high priority interrupts, it does not belong in that section anyway. Move it out of that section and mark it as __XTENSA_HANDLER so it gets bundled with other vector helpers. Signed-off-by: Max Filippov <[email protected]>
1 parent 519d819 commit e369953

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

arch/xtensa/kernel/vectors.S

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,25 @@ ENTRY(_Level\level\()InterruptVector)
650650
irq_entry_level 5
651651
irq_entry_level 6
652652

653+
#if XCHAL_EXCM_LEVEL >= 2
654+
/*
655+
* Continuation of medium priority interrupt dispatch code.
656+
* On entry here, a0 contains PS, and EPC2 contains saved a0:
657+
*/
658+
__XTENSA_HANDLER
659+
.align 4
660+
_SimulateUserKernelVectorException:
661+
addi a0, a0, (1 << PS_EXCM_BIT)
662+
#if !XTENSA_FAKE_NMI
663+
wsr a0, ps
664+
#endif
665+
bbsi.l a0, PS_UM_BIT, 1f # branch if user mode
666+
xsr a0, excsave2 # restore a0
667+
j _KernelExceptionVector # simulate kernel vector exception
668+
1: xsr a0, excsave2 # restore a0
669+
j _UserExceptionVector # simulate user vector exception
670+
#endif
671+
653672

654673
/* Window overflow and underflow handlers.
655674
* The handlers must be 64 bytes apart, first starting with the underflow
@@ -680,27 +699,6 @@ ENTRY_ALIGN64(_WindowOverflow4)
680699

681700
ENDPROC(_WindowOverflow4)
682701

683-
684-
#if XCHAL_EXCM_LEVEL >= 2
685-
/* Not a window vector - but a convenient location
686-
* (where we know there's space) for continuation of
687-
* medium priority interrupt dispatch code.
688-
* On entry here, a0 contains PS, and EPC2 contains saved a0:
689-
*/
690-
.align 4
691-
_SimulateUserKernelVectorException:
692-
addi a0, a0, (1 << PS_EXCM_BIT)
693-
#if !XTENSA_FAKE_NMI
694-
wsr a0, ps
695-
#endif
696-
bbsi.l a0, PS_UM_BIT, 1f # branch if user mode
697-
xsr a0, excsave2 # restore a0
698-
j _KernelExceptionVector # simulate kernel vector exception
699-
1: xsr a0, excsave2 # restore a0
700-
j _UserExceptionVector # simulate user vector exception
701-
#endif
702-
703-
704702
/* 4-Register Window Underflow Vector (Handler) */
705703

706704
ENTRY_ALIGN64(_WindowUnderflow4)

0 commit comments

Comments
 (0)