Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932704Ab3DYQ6N (ORCPT ); Thu, 25 Apr 2013 12:58:13 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:17806 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932616Ab3DYQ6G (ORCPT ); Thu, 25 Apr 2013 12:58:06 -0400 X-IronPort-AV: E=Sophos;i="4.87,551,1363132800"; d="scan'208";a="20573176" From: Stefano Stabellini To: CC: , , , , , Stefano Stabellini Subject: [PATCH v5 7/7] xen/arm: use sched_op hypercalls for machine reboot and power off Date: Thu, 25 Apr 2013 17:57:55 +0100 Message-ID: <1366909075-28775-7-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1871 Lines: 69 Changes in v5: - set pm_power_off and arm_pm_restart from the Xen specific intialization code. Signed-off-by: Stefano Stabellini --- arch/arm/xen/enlighten.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 6c87d11..9a0a917 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -10,9 +10,12 @@ #include #include #include +#include +#include #include #include #include +#include #include #include #include @@ -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. @@ -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); -- 1.7.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/