summaryrefslogtreecommitdiff
path: root/arch/arc/kernel
diff options
context:
space:
mode:
authorNoam Camus <noamca@mellanox.com>2017-05-28 09:52:06 +0300
committerVineet Gupta <vgupta@synopsys.com>2017-08-28 15:17:36 -0700
commit644fa02b392e25d7592951da2b2b64b4d533d1be (patch)
tree478eb451af152ed2ea0349f8c217602af9405523 /arch/arc/kernel
parent64f42cec84deb32fdaf24649481c72fcd7800dc1 (diff)
downloadlwn-644fa02b392e25d7592951da2b2b64b4d533d1be.tar.gz
lwn-644fa02b392e25d7592951da2b2b64b4d533d1be.zip
ARC: [plat-eznps] use schd.wft instruction instead of sleep at idle task
When HW threads are active we want CPU to enter idle state only for the calling HW thread and not to put on sleep all HW threads sharing this core. For this need the NPS400 got dedicated instruction so only calling thread is entring sleep and all other are still awake and can execute instructions. Signed-off-by: Noam Camus <noamca@mellanox.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com> [vgupta: reworked patch to not use inline ifdef but a new function itself]
Diffstat (limited to 'arch/arc/kernel')
-rw-r--r--arch/arc/kernel/process.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/arc/kernel/process.c b/arch/arc/kernel/process.c
index fd5b2190a957..5c631a111240 100644
--- a/arch/arc/kernel/process.c
+++ b/arch/arc/kernel/process.c
@@ -92,7 +92,18 @@ void arch_cpu_idle(void)
:"I"(arg)); /* can't be "r" has to be embedded const */
}
-#else
+#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)
{