summaryrefslogtreecommitdiffstats
path: root/arch/arm/xen
diff options
context:
space:
mode:
authorJulien Grall <julien.grall@arm.com>2017-04-24 18:58:38 +0100
committerJuergen Gross <jgross@suse.com>2017-05-02 12:05:32 +0200
commitfa12a870a9d594ba458242a04a4d17a76fc816a4 (patch)
treed17069e91b26fddde77cbf19c232aa3ac54c31b4 /arch/arm/xen
parent5d9404e1185de8d508cd042761306495f727d7eb (diff)
downloadop-kernel-dev-fa12a870a9d594ba458242a04a4d17a76fc816a4.zip
op-kernel-dev-fa12a870a9d594ba458242a04a4d17a76fc816a4.tar.gz
arm/xen: Consolidate calls to shutdown hypercall in a single helper
Signed-off-by: Julien Grall <julien.grall@arm.com> Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'arch/arm/xen')
-rw-r--r--arch/arm/xen/enlighten.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index 81e3217..ba7f4c8 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -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)
OpenPOWER on IntegriCloud