Commit fa12a870 authored by Julien Grall's avatar Julien Grall Committed by Juergen Gross

arm/xen: Consolidate calls to shutdown hypercall in a single helper

Signed-off-by: default avatarJulien Grall <julien.grall@arm.com>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
parent 5d9404e1
...@@ -191,20 +191,24 @@ static int xen_dying_cpu(unsigned int cpu) ...@@ -191,20 +191,24 @@ static int xen_dying_cpu(unsigned int cpu)
return 0; return 0;
} }
static void xen_restart(enum reboot_mode reboot_mode, const char *cmd) void xen_reboot(int reason)
{ {
struct sched_shutdown r = { .reason = SHUTDOWN_reboot }; struct sched_shutdown r = { .reason = reason };
int rc; int rc;
rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r); rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
BUG_ON(rc); BUG_ON(rc);
} }
static void xen_restart(enum reboot_mode reboot_mode, const char *cmd)
{
xen_reboot(SHUTDOWN_reboot);
}
static void xen_power_off(void) static void xen_power_off(void)
{ {
struct sched_shutdown r = { .reason = SHUTDOWN_poweroff }; xen_reboot(SHUTDOWN_poweroff);
int rc;
rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
BUG_ON(rc);
} }
static irqreturn_t xen_arm_callback(int irq, void *arg) static irqreturn_t xen_arm_callback(int irq, void *arg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment