Skip to content

Commit

Permalink
arm/xen: Consolidate calls to shutdown hypercall in a single helper
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
  • Loading branch information
Julien Grall authored and Juergen Gross committed May 2, 2017
1 parent 5d9404e commit fa12a87
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions arch/arm/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,20 +191,24 @@ static int xen_dying_cpu(unsigned int cpu)
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;

rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
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)
{
struct sched_shutdown r = { .reason = SHUTDOWN_poweroff };
int rc;
rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
BUG_ON(rc);
xen_reboot(SHUTDOWN_poweroff);
}

static irqreturn_t xen_arm_callback(int irq, void *arg)
Expand Down

0 comments on commit fa12a87

Please sign in to comment.