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 * it's 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>
36 /*--------------------------------------------------------------
39 * Entry : r9 contains pre-IRQ/exception/trap status32
41 * SP at the time of entry (K/U) saved @ pt_regs->sp
43 *-------------------------------------------------------------*/
51 * assume SP is kernel mode SP. _NO_ need to do any stack switching
58 * 2. L1 IRQ taken, ISR starts (CPU auto-switched to KERNEL mode)
72 * Above brlo alone would treat it as a valid L1-L2 scenario
75 * L1 prelogue ONLY i.e. ilink2 is less than a pre-set marker in
81 /*------Intr/Ecxp happened in kernel mode, SP already setup ------ */
82 /* save it nevertheless @ pt_regs->sp for uniformity */
85 st sp, [sp, PT_sp - SZ_PT_REGS]
87 88: /*------Intr/Ecxp happened in user mode, "switch" stack ------ */
94 /* save U mode SP @ pt_regs->sp */
95 st sp, [r9, PT_sp - SZ_PT_REGS]
102 /*------------------------------------------------------------
104 * This is to re-enable Exceptions within exception
106 *-------------------------------------------------------------*/
120 /*--------------------------------------------------------------
122 * code the rest of prolog (stack switching). This is done by stashing
123 * it to memory (non-SMP case) or SCRATCH0 Aux Reg (SMP).
125 * Before saving the full regfile - this reg is restored back, only
127 *-------------------------------------------------------------*/
136 /*--------------------------------------------------------------
138 * -Switches stack to K mode (if not already)
139 * -Saves the register file
142 *-------------------------------------------------------------*/
151 /* ARC700 doesn't provide auto-stack switching */
154 st.a r0, [sp, -8] /* orig_r0 needed for syscall (skip ECR slot) */
155 sub sp, sp, 4 /* skip pt_regs->sp, already saved above */
192 /*--------------------------------------------------------------
202 *-------------------------------------------------------------*/
240 skip pt_regs->sp, already saved above */
262 /*--------------------------------------------------------------
270 *-------------------------------------------------------------*/
292 bic \reg, sp, (THREAD_SIZE - 1)
295 /* Get CPU-ID of this core */