Lines Matching +full:auto +full:- +full:mode

1 /* SPDX-License-Identifier: GPL-2.0 */
6 #include <asm/asm-offsets.h>
7 #include <asm/dsp-impl.h>
8 #include <asm/irqflags-arcv2.h>
17 * manual --------------------- manual
28 * hw autosave ---------------------
42 * ---------------------
45 * ---------------------
48 /*------------------------------------------------------------------------*/
51 ; Before jumping to Interrupt Vector, hardware micro-ops did following:
52 ; 1. SP auto-switched to kernel mode stack
53 ; 2. STATUS32.Z flag set if in U mode at time of interrupt (U:1,K:0)
54 ; 3. Auto save: (mandatory) Push PC and STAT32 on stack
56 ; 4a. Auto save: (optional) r0-r11, blink, LPE,LPS,LPC, JLI,LDI,EI
59 ; 4b. If Auto-save (optional) not enabled in hw, manually save them
66 sub sp, sp, SZ_PT_REGS - 8
77 /*------------------------------------------------------------------------*/
80 ; Before jumping to Exception Vector, hardware micro-ops did following:
81 ; 1. SP auto-switched to kernel mode stack
82 ; 2. STATUS32.Z flag set if in U mode at time of exception (U:1,K:0)
117 /*------------------------------------------------------------------------
120 * - exception handlers (which don't have autosave)
121 * - interrupt autosave disabled due to CONFIG_ARC_IRQ_NO_AUTOSAVE
143 /*------------------------------------------------------------------------
146 * - r12: the last caller saved scratch reg since hardware saves in pairs so r0-r11
147 * - r30: free reg, used by gcc as scratch
148 * - ACCL/ACCH pair when they exist
157 ; Saving pt_regs->sp correctly requires some extra work due to the way
158 ; Auto stack switch works
159 ; - U mode: retrieve it from AUX_USER_SP
160 ; - K mode: add the offset from current SP where H/w starts auto push
162 ; 1. Utilize the fact that Z bit is set if Intr taken in U mode
164 ; but on return, restored only if U mode
166 lr r10, [AUX_USER_SP] ; U mode SP
170 add2.nz r10, r10, SZ_PT_REGS/4 ; K mode SP
172 st r10, [sp, PT_sp] ; SP (pt_regs->sp)
187 /*------------------------------------------------------------------------*/
195 ; Restore SP (into AUX_USER_SP) only if returning to U mode
196 ; - for K mode, it will be implicitly restored as stack is unwound
197 ; - Z flag set on K is inverse of what hardware does on interrupt entry
201 ld r10, [sp, PT_sp] ; SP (pt_regs->sp)
213 /*------------------------------------------------------------------------*/
234 /*------------------------------------------------------------------------*/
238 ; INPUT: Z flag set if returning to K mode
248 add sp, sp, SZ_PT_REGS - 8
255 /*------------------------------------------------------------------------*/
284 bmskn \reg, sp, THREAD_SHIFT - 1
287 /* Get CPU-ID of this core */
291 /* M = 8-1 N = 8 */