summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorDmitriy Korovkin <dmitriy.korovkin@windriver.com>2016-10-12 11:09:58 -0400
committerAnas Nashif <nashif@linux.intel.com>2016-10-22 01:27:01 +0000
commitdc76dbf2ef70428b9ab361bc239b752fead01790 (patch)
tree21c34f2a1757181cfcaee68c896766485a91201a /arch
parent3c90651fd87a76d2ace2f320cea7a503e64962a4 (diff)
unified: Add tickless idle support for ARC
Change-Id: I89684e7bee379be0a18f64e4f2c39ae132fe7e6d Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arc/core/isr_wrapper.S21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arc/core/isr_wrapper.S b/arch/arc/core/isr_wrapper.S
index 75c44e813..7c36ca8bd 100644
--- a/arch/arc/core/isr_wrapper.S
+++ b/arch/arc/core/isr_wrapper.S
@@ -44,6 +44,8 @@ SECTION_VAR(BSS, saved_r0)
#if defined(CONFIG_NANOKERNEL) && defined(CONFIG_TICKLESS_IDLE)
GTEXT(_power_save_idle_exit)
+#elif defined(CONFIG_KERNEL_V2) && defined(CONFIG_SYS_POWER_MANAGEMENT)
+GTEXT(_sys_power_save_idle_exit)
#endif
/*
@@ -319,6 +321,25 @@ GTEXT(_sys_k_event_logger_interrupt)
pop_s r0
seti r0
.endm
+#elif defined(CONFIG_KERNEL_V2) && defined(CONFIG_SYS_POWER_MANAGEMENT)
+.macro exit_tickless_idle
+ clri r0 /* do not interrupt exiting tickless idle operations */
+ push_s r1
+ push_s r0
+ mov_s r1, _nanokernel
+ ld_s r0, [r1, __tNANO_idle_OFFSET] /* requested idle duration */
+ breq r0, 0, _skip_sys_power_save_idle_exit
+
+ st 0, [r1, __tNANO_idle_OFFSET] /* zero idle duration */
+ push_s blink
+ jl _sys_power_save_idle_exit
+ pop_s blink
+
+_skip_sys_power_save_idle_exit:
+ pop_s r0
+ pop_s r1
+ seti r0
+.endm
#else
#define exit_tickless_idle
#endif