diff --git a/arch/x86/core/crt0.S b/arch/x86/core/crt0.S index de9c9d2c3bc..3f8a0f26890 100644 --- a/arch/x86/core/crt0.S +++ b/arch/x86/core/crt0.S @@ -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 diff --git a/arch/x86/include/advidle.h b/arch/x86/include/advidle.h index 31bd68eae84..ea67b36a4ae 100644 --- a/arch/x86/include/advidle.h +++ b/arch/x86/include/advidle.h @@ -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 */ diff --git a/kernel/microkernel/k_idle.c b/kernel/microkernel/k_idle.c index 16e5319c111..428f61605af 100644 --- a/kernel/microkernel/k_idle.c +++ b/kernel/microkernel/k_idle.c @@ -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(); }