From 3fcd8b5009b1807170cc6946b261434332c6ecae Mon Sep 17 00:00:00 2001
From: Julien Grall <julien.grall@linaro.org>
Date: Sat, 5 Apr 2014 00:52:05 +0100
Subject: [PATCH 35/48] xen/control: register pv shutdown handler for ARM

---
 sys/dev/xen/control/control.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sys/dev/xen/control/control.c b/sys/dev/xen/control/control.c
index 8504dac..7139790 100644
--- a/sys/dev/xen/control/control.c
+++ b/sys/dev/xen/control/control.c
@@ -511,6 +511,12 @@ xctrl_probe(device_t dev)
 	return (BUS_PROBE_NOWILDCARD);
 }
 
+#if defined (__arm__)
+#define has_pv_shutdown_handler() xen_hvm_domain()
+#else
+#define has_pv_shutdown_handler() xen_pv_domain()
+#endif
+
 /**
  * \brief Attach the Xen control device.
  *
@@ -532,7 +538,7 @@ xctrl_attach(device_t dev)
 	xctrl->xctrl_watch.callback_data = (uintptr_t)xctrl;
 	xs_register_watch(&xctrl->xctrl_watch);
 
-	if (xen_pv_domain())
+	if (has_pv_shutdown_handler())
 		EVENTHANDLER_REGISTER(shutdown_final, xen_pv_shutdown_final, NULL,
 		                      SHUTDOWN_PRI_LAST);
 
-- 
2.1.0

