提交 77ba5038 编写于 作者: D Dai Xin 提交者: guzitao

sw64: split out the idle loop in idle.c

Sunway inclusion
category: performance
bugzilla: https://gitee.com/openeuler/kernel/issues/I5XTK7

--------------------------------
Signed-off-by: NDai Xin <daixin@wxiat.com>
Reviewed-by: NHe Sheng <hesheng@wxiat.com>
Signed-off-by: NGu Zitao <guzitao@wxiat.com>
上级 eaadeb46
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_SW64_IDLE_H
#define _ASM_SW64_IDLE_H
extern void arch_cpu_idle(void);
#endif /* _ASM_SW64_IDLE_H */
......@@ -17,7 +17,7 @@ obj-y := entry.o fpu.o traps.o process.o sys_sw64.o irq.o \
irq_sw64.o signal.o setup.o ptrace.o time.o \
systbls.o dup_print.o tc.o timer.o \
insn.o early_init.o topology.o cacheinfo.o \
vdso.o vdso/ hmcall.o stacktrace.o
vdso.o vdso/ hmcall.o stacktrace.o idle.o
obj-$(CONFIG_ACPI) += acpi.o
obj-$(CONFIG_SMP) += smp.o
......
// SPDX-License-Identifier: GPL-2.0
/*
* sw64 idle loop support.
*
*/
#include <linux/cpu.h>
#include <linux/irqflags.h>
#include <asm/cpu.h>
#include <asm/idle.h>
#ifdef CONFIG_HOTPLUG_CPU
void arch_cpu_idle_dead(void)
{
play_dead();
}
#endif
void cpu_idle(void)
{
int i;
local_irq_enable();
cpu_relax();
if (is_in_guest())
hcall(HCALL_HALT, 0, 0, 0);
else {
for (i = 0; i < 16; i++)
asm("nop");
asm("halt");
}
}
void arch_cpu_idle(void)
{
cpu_idle();
}
......@@ -26,29 +26,6 @@ struct halt_info {
char *restart_cmd;
};
#ifdef CONFIG_HOTPLUG_CPU
void arch_cpu_idle_dead(void)
{
play_dead();
}
#endif
void arch_cpu_idle(void)
{
int i;
local_irq_enable();
cpu_relax();
if (is_in_guest())
hcall(HCALL_HALT, 0, 0, 0);
else {
for (i = 0; i < 16; i++)
asm("nop");
asm("halt");
}
}
static void common_shutdown_1(void *generic_ptr)
{
struct halt_info *how = (struct halt_info *)generic_ptr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册