Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 374261
b: refs/heads/master
c: 6abb749
h: refs/heads/master
i:
  374259: 299c6d8
v: v3
  • Loading branch information
Stefano Stabellini committed Apr 25, 2013
1 parent 73ef7a2 commit 3770dcb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d37a6e1687303ea0fcea89980373e3017b449963
refs/heads/master: 6abb749e83cf100bc4c71537e4c4e97ccdadcafe
24 changes: 24 additions & 0 deletions trunk/arch/arm/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
#include <xen/platform_pci.h>
#include <xen/xenbus.h>
#include <xen/page.h>
#include <xen/xen.h>
#include <xen/interface/sched.h>
#include <xen/xen-ops.h>
#include <asm/xen/hypervisor.h>
#include <asm/xen/hypercall.h>
#include <asm/system_misc.h>
#include <linux/interrupt.h>
#include <linux/irqreturn.h>
#include <linux/module.h>
Expand Down Expand Up @@ -173,6 +176,24 @@ static int __init xen_secondary_init(unsigned int cpu)
return 0;
}

static void xen_restart(char str, const char *cmd)
{
struct sched_shutdown r = { .reason = SHUTDOWN_reboot };
int rc;
rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
if (rc)
BUG();
}

static void xen_power_off(void)
{
struct sched_shutdown r = { .reason = SHUTDOWN_poweroff };
int rc;
rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
if (rc)
BUG();
}

/*
* see Documentation/devicetree/bindings/arm/xen.txt for the
* documentation of the Xen Device Tree format.
Expand Down Expand Up @@ -252,6 +273,9 @@ static int __init xen_guest_init(void)
if (!xen_initial_domain())
xenbus_probe(NULL);

pm_power_off = xen_power_off;
arm_pm_restart = xen_restart;

return 0;
}
core_initcall(xen_guest_init);
Expand Down

0 comments on commit 3770dcb

Please sign in to comment.