mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-13 13:56:19 +00:00
add cpu_do_idle to handle idle
add wrap function cpu_do_idle in default_idle to handle arch cpu specific idle operation. Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
b78aa347e0
commit
b1612e3072
@ -748,6 +748,11 @@ void stop_cpus()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cpu_do_idle(__unused uint16_t pcpu_id)
|
||||||
|
{
|
||||||
|
__asm __volatile("pause" ::: "memory");
|
||||||
|
}
|
||||||
|
|
||||||
void cpu_dead(uint16_t pcpu_id)
|
void cpu_dead(uint16_t pcpu_id)
|
||||||
{
|
{
|
||||||
/* For debug purposes, using a stack variable in the while loop enables
|
/* For debug purposes, using a stack variable in the while loop enables
|
||||||
|
@ -172,9 +172,8 @@ void default_idle(void)
|
|||||||
schedule();
|
schedule();
|
||||||
} else if (need_offline(pcpu_id) != 0) {
|
} else if (need_offline(pcpu_id) != 0) {
|
||||||
cpu_dead(pcpu_id);
|
cpu_dead(pcpu_id);
|
||||||
} else {
|
} else
|
||||||
__asm __volatile("pause" ::: "memory");
|
cpu_do_idle(pcpu_id);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,6 +318,7 @@ extern struct cpuinfo_x86 boot_cpu_data;
|
|||||||
#define MAX_CX_ENTRY (MAX_CSTATE - 1U)
|
#define MAX_CX_ENTRY (MAX_CSTATE - 1U)
|
||||||
|
|
||||||
/* Function prototypes */
|
/* Function prototypes */
|
||||||
|
void cpu_do_idle(__unused uint16_t pcpu_id);
|
||||||
void cpu_dead(uint16_t pcpu_id);
|
void cpu_dead(uint16_t pcpu_id);
|
||||||
void trampoline_start16(void);
|
void trampoline_start16(void);
|
||||||
bool is_vapic_supported(void);
|
bool is_vapic_supported(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user