adv_power:Rename PM functions according to coding convention

Renamed functions and labels used in power management code
according to coding convention.  Only doing this to relevant
functions and not touching functions that will be removed in
future patches.

The stack used during resume would be necessary so
renamed that too.

Change-Id: I2f09a349b0f0fd6520c11b4cd73f4c8e1a13f100
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
This commit is contained in:
Ramesh Thomas 2016-02-08 22:11:54 -08:00
commit 72e248b11b
3 changed files with 15 additions and 13 deletions

View file

@ -50,7 +50,7 @@
#ifdef CONFIG_ADVANCED_IDLE
GDATA(_AdvIdleCheckSleep)
GDATA(_AdvIdleStart)
GDATA(_sys_soc_resume)
#endif /* CONFIG_ADVANCED_IDLE */
@ -133,7 +133,7 @@ __csSet:
* We use the separate stack here in order to avoid the memory
* corruption if the system recovers from deep sleep
*/
movl $_AdvIdleStack, %esp
movl $_soc_resume_stack, %esp
addl $CONFIG_ADV_IDLE_STACK_SIZE, %esp
/* align to stack boundary: ROUND_DOWN (%esp, 4) */
@ -308,10 +308,12 @@ memInitDone:
#if defined (CONFIG_ADVANCED_IDLE)
/*
* Invoke _AdvIdleStart(_Cstart, _gdt) by jumping to it.
* Invoke _sys_soc_resume(_Cstart, _gdt) by jumping to it.
* If it's a cold boot, this routine jumps to _Cstart and the normal
* kernel boot sequence continues; otherwise, it resumes execution
* at the point where system went into deep sleep (in _AdvIdleFunc)
* kernel boot sequence continues; otherwise, it uses the TSS info
* saved in the GDT to resumes kernel processing at the point it was
* when the system went into deep sleep; that is, _sys_soc_suspend()
* completes and returns a non-zero value.
*/
#if CONFIG_X86_IAMCU
@ -321,7 +323,7 @@ memInitDone:
pushl $_gdt
pushl $_Cstart
#endif
call _AdvIdleStart
call _sys_soc_resume
#else
/* Jump to C portion of kernel initialization and never return */
@ -443,6 +445,6 @@ _gdt_rom_end:
#ifdef CONFIG_ADVANCED_IDLE
.section .NOINIT
.balign 4,0x90
_AdvIdleStack:
_soc_resume_stack:
.fill CONFIG_ADV_IDLE_STACK_SIZE
#endif

View file

@ -21,8 +21,8 @@
*
* This header file specifies the custom advanced idle management interface.
* All of the APIs declared here must be supplied by the custom advanced idle
* management system, namely the _AdvIdleCheckSleep(), _AdvIdleFunc()
* and _AdvIdleStart() functions.
* management system, namely the _AdvIdleCheckSleep(), _sys_soc_suspend()
* and _sys_soc_resume() functions.
*/
#ifndef __INCadvidle
@ -51,7 +51,7 @@ extern int _AdvIdleCheckSleep(void);
* This routine checks if the system is recovering from advanced sleep and
* either continues the kernel's cold boot sequence at _Cstart or resumes
* kernel operation at the point it went to sleep; in the latter case, control
* passes to the _AdvIdleFunc() that put the system to sleep, which then
* passes to the _sys_soc_suspend() that put the system to sleep, which then
* finishes executing.
*
* @param _Cstart the address of the _Cstart function
@ -59,7 +59,7 @@ extern int _AdvIdleCheckSleep(void);
*
* @return does not return to caller
*/
extern void _AdvIdleStart(void (*_Cstart)(void), void *_gdt);
extern void _sys_soc_resume(void (*_Cstart)(void), void *_gdt);
/**
* @brief Perform advanced sleep
@ -73,7 +73,7 @@ extern void _AdvIdleStart(void (*_Cstart)(void), void *_gdt);
*
* @return non-zero if advanced sleep occurred; otherwise zero
*/
extern int _AdvIdleFunc(int32_t ticks);
extern int _sys_soc_suspend(int32_t ticks);
#endif /* CONFIG_ADVANCED_IDLE */

View file

@ -288,7 +288,7 @@ void _sys_power_save_idle(int32_t ticks)
* function returns zero immediately and we do normal idle processing.
*/
if (_AdvIdleFunc(ticks) == 0) {
if (_sys_soc_suspend(ticks) == 0) {
nano_cpu_set_idle(ticks);
nano_cpu_idle();
}