unified: Add tickless idle support for ARC

Change-Id: I89684e7bee379be0a18f64e4f2c39ae132fe7e6d
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
This commit is contained in:
Dmitriy Korovkin 2016-10-12 11:09:58 -04:00 committed by Anas Nashif
commit dc76dbf2ef
2 changed files with 24 additions and 2 deletions

View file

@ -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

View file

@ -176,11 +176,12 @@ void _timer_int_handler(void *unused)
timer_count <= (cycles_per_tick - 1),
"timer_count: %d, limit %d\n", timer_count, cycles_per_tick - 1);
_sys_idle_elapsed_ticks = 1;
_sys_clock_final_tick_announce();
#else
_sys_clock_tick_announce();
#endif
update_accumulated_count();
_sys_clock_tick_announce();
}
#if defined(CONFIG_TICKLESS_IDLE)