Skip to content

Commit 64f42ce

Browse files
committed
ARC: create cpu specific version of arch_cpu_idle()
This paves way for creating a 3rd variant needed for NPS ARC700 without littering ifdey'ery all over the place Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
1 parent 1112c3b commit 64f42ce

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

‎arch/arc/include/asm/irqflags-arcv2.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@
4747
#define ISA_INIT_STATUS_BITS (STATUS_IE_MASK | STATUS_AD_MASK | \
4848
(ARCV2_IRQ_DEF_PRIO << 1))
4949

50-
/* SLEEP needs default irq priority (<=) which can interrupt the doze */
51-
#define ISA_SLEEP_ARG (0x10 | ARCV2_IRQ_DEF_PRIO)
52-
5350
#ifndef __ASSEMBLY__
5451

5552
/*

‎arch/arc/include/asm/irqflags-compact.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343

4444
#define ISA_INIT_STATUS_BITS STATUS_IE_MASK
4545

46-
#define ISA_SLEEP_ARG 0x3
47-
4846
#ifndef __ASSEMBLY__
4947

5048
/******************************************************************

‎arch/arc/kernel/process.c‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,29 @@ SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, expected, int, new)
7979
return uval;
8080
}
8181

82+
#ifdef CONFIG_ISA_ARCV2
83+
8284
void arch_cpu_idle(void)
8385
{
84-
/* sleep, but enable all interrupts before committing */
86+
/* Re-enable interrupts <= default irq priority before commiting SLEEP */
87+
const unsigned int arg = 0x10 | ARCV2_IRQ_DEF_PRIO;
88+
8589
__asm__ __volatile__(
8690
"sleep %0 \n"
8791
:
88-
:"I"(ISA_SLEEP_ARG)); /* can't be "r" has to be embedded const */
92+
:"I"(arg)); /* can't be "r" has to be embedded const */
93+
}
94+
95+
#else
96+
97+
void arch_cpu_idle(void)
98+
{
99+
/* sleep, but enable both set E1/E2 (levels of interrutps) before committing */
100+
__asm__ __volatile__("sleep 0x3 \n");
89101
}
90102

103+
#endif
104+
91105
asmlinkage void ret_from_fork(void);
92106

93107
/*

0 commit comments

Comments
 (0)