aboutsummaryrefslogtreecommitdiff
path: root/arch/arc/kernel/process.c
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2017-07-24 10:02:16 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2017-07-24 10:02:16 +1000
commite6b5bc824100caf07d0b21ea74e5472cdfbd2853 (patch)
tree6269879e2d692e5edd35d34de1b074bf657dbec8 /arch/arc/kernel/process.c
parent201202b5133eef6d1ddf93f7bc7d58800f1a789e (diff)
parent6f8119230ed026cee037dad784e7f8968ebfb052 (diff)
Merge remote-tracking branch 'arc/for-next'
Diffstat (limited to 'arch/arc/kernel/process.c')
-rw-r--r--arch/arc/kernel/process.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/arch/arc/kernel/process.c b/arch/arc/kernel/process.c
index 2a018de6d6cd..5c631a111240 100644
--- a/arch/arc/kernel/process.c
+++ b/arch/arc/kernel/process.c
@@ -79,15 +79,40 @@ done:
return uval;
}
+#ifdef CONFIG_ISA_ARCV2
+
void arch_cpu_idle(void)
{
- /* sleep, but enable all interrupts before committing */
+ /* Re-enable interrupts <= default irq priority before commiting SLEEP */
+ const unsigned int arg = 0x10 | ARCV2_IRQ_DEF_PRIO;
+
__asm__ __volatile__(
"sleep %0 \n"
:
- :"I"(ISA_SLEEP_ARG)); /* can't be "r" has to be embedded const */
+ :"I"(arg)); /* can't be "r" has to be embedded const */
}
+#elif defined(CONFIG_EZNPS_MTM_EXT) /* ARC700 variant in NPS */
+
+void arch_cpu_idle(void)
+{
+ /* only the calling HW thread needs to sleep */
+ __asm__ __volatile__(
+ ".word %0 \n"
+ :
+ :"i"(CTOP_INST_HWSCHD_WFT_IE12));
+}
+
+#else /* ARC700 */
+
+void arch_cpu_idle(void)
+{
+ /* sleep, but enable both set E1/E2 (levels of interrutps) before committing */
+ __asm__ __volatile__("sleep 0x3 \n");
+}
+
+#endif
+
asmlinkage void ret_from_fork(void);
/*