Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+16 -7
-3
arch/arc/include/asm/irqflags-arcv2.h
··· 47 47 #define ISA_INIT_STATUS_BITS (STATUS_IE_MASK | STATUS_AD_MASK | \ 48 48 (ARCV2_IRQ_DEF_PRIO << 1)) 49 49 50 - /* SLEEP needs default irq priority (<=) which can interrupt the doze */ 51 - #define ISA_SLEEP_ARG (0x10 | ARCV2_IRQ_DEF_PRIO) 52 - 53 50 #ifndef __ASSEMBLY__ 54 51 55 52 /*
-2
arch/arc/include/asm/irqflags-compact.h
··· 43 43 44 44 #define ISA_INIT_STATUS_BITS STATUS_IE_MASK 45 45 46 - #define ISA_SLEEP_ARG 0x3 47 - 48 46 #ifndef __ASSEMBLY__ 49 47 50 48 /******************************************************************
+16 -2
arch/arc/kernel/process.c
··· 79 79 return uval; 80 80 } 81 81 82 + #ifdef CONFIG_ISA_ARCV2 83 + 82 84 void arch_cpu_idle(void) 83 85 { 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 + 85 89 __asm__ __volatile__( 86 90 "sleep %0 \n" 87 91 : 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 */ 89 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"); 101 + } 102 + 103 + #endif 90 104 91 105 asmlinkage void ret_from_fork(void); 92 106