aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/include/asm/entry.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arc/include/asm/entry.h')
-rw-r--r--arch/arc/include/asm/entry.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/arch/arc/include/asm/entry.h b/arch/arc/include/asm/entry.h
index 23ef2de1e09f..23daa326fc9b 100644
--- a/arch/arc/include/asm/entry.h
+++ b/arch/arc/include/asm/entry.h
@@ -389,11 +389,19 @@
389 * to be saved again on kernel mode stack, as part of ptregs. 389 * to be saved again on kernel mode stack, as part of ptregs.
390 *-------------------------------------------------------------*/ 390 *-------------------------------------------------------------*/
391.macro EXCPN_PROLOG_FREEUP_REG reg 391.macro EXCPN_PROLOG_FREEUP_REG reg
392#ifdef CONFIG_SMP
393 sr \reg, [ARC_REG_SCRATCH_DATA0]
394#else
392 st \reg, [@ex_saved_reg1] 395 st \reg, [@ex_saved_reg1]
396#endif
393.endm 397.endm
394 398
395.macro EXCPN_PROLOG_RESTORE_REG reg 399.macro EXCPN_PROLOG_RESTORE_REG reg
400#ifdef CONFIG_SMP
401 lr \reg, [ARC_REG_SCRATCH_DATA0]
402#else
396 ld \reg, [@ex_saved_reg1] 403 ld \reg, [@ex_saved_reg1]
404#endif
397.endm 405.endm
398 406
399/*-------------------------------------------------------------- 407/*--------------------------------------------------------------
@@ -508,7 +516,11 @@
508 /* restore original r9 , saved in int1_saved_reg 516 /* restore original r9 , saved in int1_saved_reg
509 * It will be saved on stack in macro: SAVE_CALLER_SAVED 517 * It will be saved on stack in macro: SAVE_CALLER_SAVED
510 */ 518 */
519#ifdef CONFIG_SMP
520 lr r9, [ARC_REG_SCRATCH_DATA0]
521#else
511 ld r9, [@int1_saved_reg] 522 ld r9, [@int1_saved_reg]
523#endif
512 524
513 /* now we are ready to save the remaining context :) */ 525 /* now we are ready to save the remaining context :) */
514 st orig_r8_IS_IRQ1, [sp, 8] /* Event Type */ 526 st orig_r8_IS_IRQ1, [sp, 8] /* Event Type */
@@ -639,6 +651,41 @@
639 bmsk \reg, \reg, 7 651 bmsk \reg, \reg, 7
640.endm 652.endm
641 653
654#ifdef CONFIG_SMP
655
656/*-------------------------------------------------
657 * Retrieve the current running task on this CPU
658 * 1. Determine curr CPU id.
659 * 2. Use it to index into _current_task[ ]
660 */
661.macro GET_CURR_TASK_ON_CPU reg
662 GET_CPU_ID \reg
663 ld.as \reg, [@_current_task, \reg]
664.endm
665
666/*-------------------------------------------------
667 * Save a new task as the "current" task on this CPU
668 * 1. Determine curr CPU id.
669 * 2. Use it to index into _current_task[ ]
670 *
671 * Coded differently than GET_CURR_TASK_ON_CPU (which uses LD.AS)
672 * because ST r0, [r1, offset] can ONLY have s9 @offset
673 * while LD can take s9 (4 byte insn) or LIMM (8 byte insn)
674 */
675
676.macro SET_CURR_TASK_ON_CPU tsk, tmp
677 GET_CPU_ID \tmp
678 add2 \tmp, @_current_task, \tmp
679 st \tsk, [\tmp]
680#ifdef CONFIG_ARC_CURR_IN_REG
681 mov r25, \tsk
682#endif
683
684.endm
685
686
687#else /* Uniprocessor implementation of macros */
688
642.macro GET_CURR_TASK_ON_CPU reg 689.macro GET_CURR_TASK_ON_CPU reg
643 ld \reg, [@_current_task] 690 ld \reg, [@_current_task]
644.endm 691.endm
@@ -650,6 +697,8 @@
650#endif 697#endif
651.endm 698.endm
652 699
700#endif /* SMP / UNI */
701
653/* ------------------------------------------------------------------ 702/* ------------------------------------------------------------------
654 * Get the ptr to some field of Current Task at @off in task struct 703 * Get the ptr to some field of Current Task at @off in task struct
655 * -Uses r25 for Current task ptr if that is enabled 704 * -Uses r25 for Current task ptr if that is enabled