Lines Matching +full:auto +full:- +full:switching

1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2014-15 Synopsys, Inc. (www.synopsys.com)
4 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
7 * Stack switching code can no longer reliably rely on the fact that
10 * its prologue including stack switching from user mode
13 * -Zero Overhead Loop Context shd be cleared when entering IRQ/EXcp/Trap
20 * -Modified CALLEE_REG save/restore macros to handle the fact that
22 * - Defined Stack Switching Macro to be reused in all intr/excp hdlrs
23 * - Shaved off 11 instructions from RESTORE_ALL_INT1 by using the
32 #include <asm/asm-offsets.h>
33 #include <asm/irqflags-compact.h>
121 /*--------------------------------------------------------------
124 * Entry : r9 contains pre-IRQ/exception/trap status32
126 * SP at the time of entry (K/U) saved @ pt_regs->sp
128 *-------------------------------------------------------------*/
136 * assume SP is kernel mode SP. _NO_ need to do any stack switching
143 * 2. L1 IRQ taken, ISR starts (CPU auto-switched to KERNEL mode)
157 * Above brlo alone would treat it as a valid L1-L2 scenario
160 * L1 prelogue ONLY i.e. ilink2 is less than a pre-set marker in
166 /*------Intr/Ecxp happened in kernel mode, SP already setup ------ */
167 /* save it nevertheless @ pt_regs->sp for uniformity */
170 st sp, [sp, PT_sp - SZ_PT_REGS]
172 88: /*------Intr/Ecxp happened in user mode, "switch" stack ------ */
179 /* save U mode SP @ pt_regs->sp */
180 st sp, [r9, PT_sp - SZ_PT_REGS]
187 /*------------------------------------------------------------
189 * This is to re-enable Exceptions within exception
191 *-------------------------------------------------------------*/
205 /*--------------------------------------------------------------
207 * code the rest of prolog (stack switching). This is done by stashing
208 * it to memory (non-SMP case) or SCRATCH0 Aux Reg (SMP).
210 * Before saving the full regfile - this reg is restored back, only
212 *-------------------------------------------------------------*/
221 /*--------------------------------------------------------------
223 * -Switches stack to K mode (if not already)
224 * -Saves the register file
227 *-------------------------------------------------------------*/
236 /* ARC700 doesn't provide auto-stack switching */
239 st.a r0, [sp, -8] /* orig_r0 needed for syscall (skip ECR slot) */
240 sub sp, sp, 4 /* skip pt_regs->sp, already saved above */
277 /*--------------------------------------------------------------
287 *-------------------------------------------------------------*/
323 st.a 0x003\LVL\()abcd, [sp, -4] /* Dummy ECR */
325 skip pt_regs->sp, already saved above */
347 /*--------------------------------------------------------------
355 *-------------------------------------------------------------*/
377 bic \reg, sp, (THREAD_SIZE - 1)
380 /* Get CPU-ID of this core */