.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2014-15 Synopsys, Inc. (www.synopsys.com) |
---|
3 | 4 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify |
---|
6 | | - * it under the terms of the GNU General Public License version 2 as |
---|
7 | | - * published by the Free Software Foundation. |
---|
8 | 5 | * |
---|
9 | 6 | * Vineetg: March 2009 (Supporting 2 levels of Interrupts) |
---|
10 | 7 | * Stack switching code can no longer reliably rely on the fact that |
---|
.. | .. |
---|
35 | 32 | #include <asm/asm-offsets.h> |
---|
36 | 33 | #include <asm/irqflags-compact.h> |
---|
37 | 34 | #include <asm/thread_info.h> /* For THREAD_SIZE */ |
---|
38 | | - |
---|
39 | | -#ifdef CONFIG_ARC_PLAT_EZNPS |
---|
40 | | -#include <plat/ctop.h> |
---|
41 | | -#endif |
---|
42 | 35 | |
---|
43 | 36 | /*-------------------------------------------------------------- |
---|
44 | 37 | * Switch to Kernel Mode stack if SP points to User Mode stack |
---|
.. | .. |
---|
133 | 126 | * to be saved again on kernel mode stack, as part of pt_regs. |
---|
134 | 127 | *-------------------------------------------------------------*/ |
---|
135 | 128 | .macro PROLOG_FREEUP_REG reg, mem |
---|
136 | | -#ifdef CONFIG_SMP |
---|
| 129 | +#ifndef ARC_USE_SCRATCH_REG |
---|
137 | 130 | sr \reg, [ARC_REG_SCRATCH_DATA0] |
---|
138 | 131 | #else |
---|
139 | 132 | st \reg, [\mem] |
---|
.. | .. |
---|
141 | 134 | .endm |
---|
142 | 135 | |
---|
143 | 136 | .macro PROLOG_RESTORE_REG reg, mem |
---|
144 | | -#ifdef CONFIG_SMP |
---|
| 137 | +#ifndef ARC_USE_SCRATCH_REG |
---|
145 | 138 | lr \reg, [ARC_REG_SCRATCH_DATA0] |
---|
146 | 139 | #else |
---|
147 | 140 | ld \reg, [\mem] |
---|
.. | .. |
---|
192 | 185 | PUSHAX lp_start |
---|
193 | 186 | PUSHAX erbta |
---|
194 | 187 | |
---|
195 | | -#ifdef CONFIG_ARC_PLAT_EZNPS |
---|
196 | | - .word CTOP_INST_SCHD_RW |
---|
197 | | - PUSHAX CTOP_AUX_GPA1 |
---|
198 | | - PUSHAX CTOP_AUX_EFLAGS |
---|
199 | | -#endif |
---|
200 | | - |
---|
201 | | - lr r9, [ecr] |
---|
202 | | - st r9, [sp, PT_event] /* EV_Trap expects r9 to have ECR */ |
---|
| 188 | + lr r10, [ecr] |
---|
| 189 | + st r10, [sp, PT_event] /* EV_Trap expects r10 to have ECR */ |
---|
203 | 190 | .endm |
---|
204 | 191 | |
---|
205 | 192 | /*-------------------------------------------------------------- |
---|
.. | .. |
---|
214 | 201 | * by hardware and that is not good. |
---|
215 | 202 | *-------------------------------------------------------------*/ |
---|
216 | 203 | .macro EXCEPTION_EPILOGUE |
---|
217 | | -#ifdef CONFIG_ARC_PLAT_EZNPS |
---|
218 | | - .word CTOP_INST_SCHD_RW |
---|
219 | | - POPAX CTOP_AUX_EFLAGS |
---|
220 | | - POPAX CTOP_AUX_GPA1 |
---|
221 | | -#endif |
---|
222 | 204 | |
---|
223 | 205 | POPAX erbta |
---|
224 | 206 | POPAX lp_start |
---|
.. | .. |
---|
281 | 263 | PUSHAX lp_start |
---|
282 | 264 | PUSHAX bta_l\LVL\() |
---|
283 | 265 | |
---|
284 | | -#ifdef CONFIG_ARC_PLAT_EZNPS |
---|
285 | | - .word CTOP_INST_SCHD_RW |
---|
286 | | - PUSHAX CTOP_AUX_GPA1 |
---|
287 | | - PUSHAX CTOP_AUX_EFLAGS |
---|
288 | | -#endif |
---|
289 | 266 | .endm |
---|
290 | 267 | |
---|
291 | 268 | /*-------------------------------------------------------------- |
---|
.. | .. |
---|
298 | 275 | * by hardware and that is not good. |
---|
299 | 276 | *-------------------------------------------------------------*/ |
---|
300 | 277 | .macro INTERRUPT_EPILOGUE LVL |
---|
301 | | -#ifdef CONFIG_ARC_PLAT_EZNPS |
---|
302 | | - .word CTOP_INST_SCHD_RW |
---|
303 | | - POPAX CTOP_AUX_EFLAGS |
---|
304 | | - POPAX CTOP_AUX_GPA1 |
---|
305 | | -#endif |
---|
306 | 278 | |
---|
307 | 279 | POPAX bta_l\LVL\() |
---|
308 | 280 | POPAX lp_start |
---|
.. | .. |
---|
330 | 302 | bic \reg, sp, (THREAD_SIZE - 1) |
---|
331 | 303 | .endm |
---|
332 | 304 | |
---|
333 | | -#ifndef CONFIG_ARC_PLAT_EZNPS |
---|
334 | 305 | /* Get CPU-ID of this core */ |
---|
335 | 306 | .macro GET_CPU_ID reg |
---|
336 | 307 | lr \reg, [identity] |
---|
337 | 308 | lsr \reg, \reg, 8 |
---|
338 | 309 | bmsk \reg, \reg, 7 |
---|
339 | 310 | .endm |
---|
340 | | -#endif |
---|
341 | 311 | |
---|
342 | 312 | #endif /* __ASM_ARC_ENTRY_COMPACT_H */ |
---|