From db4ab7e5fa20d34f5df7b09ccd6e783ae68c5899 Mon Sep 17 00:00:00 2001
From: Roger Pau Monne <roger.pau@citrix.com>
Date: Wed, 18 Dec 2013 10:11:14 +0100
Subject: [PATCH 13/31] xen: change order of Xen intr init and IO APIC
 registration

Change order of some of the services in the SI_SUB_INTR stage, so
that it follows the order:

- System intr initialization
- Xen intr initalization
- IO APIC source registration

Approved by: xxx
Sponsored by: Citrix Systems R&D

x86/x86/local_apic.c:
 - Change order of apic_setup_io to be called after xen interrupt
   subsystem is setup.

x86/xen/xen_intr.c:
 - Init Xen event channels before apic_setup_io.
---
 sys/x86/x86/local_apic.c |    2 +-
 sys/x86/xen/xen_intr.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c
index 59aa6d9..e5a5ebf 100644
--- a/sys/x86/x86/local_apic.c
+++ b/sys/x86/x86/local_apic.c
@@ -1445,7 +1445,7 @@ apic_setup_io(void *dummy __unused)
 	/* Enable the MSI "pic". */
 	msi_init();
 }
-SYSINIT(apic_setup_io, SI_SUB_INTR, SI_ORDER_SECOND, apic_setup_io, NULL);
+SYSINIT(apic_setup_io, SI_SUB_INTR, SI_ORDER_THIRD, apic_setup_io, NULL);
 
 #ifdef SMP
 /*
diff --git a/sys/x86/xen/xen_intr.c b/sys/x86/xen/xen_intr.c
index 1f08615..2f4e28e 100644
--- a/sys/x86/xen/xen_intr.c
+++ b/sys/x86/xen/xen_intr.c
@@ -612,7 +612,7 @@ xen_intr_init(void *dummy __unused)
 
 	return (0);
 }
-SYSINIT(xen_intr_init, SI_SUB_INTR, SI_ORDER_MIDDLE, xen_intr_init, NULL);
+SYSINIT(xen_intr_init, SI_SUB_INTR, SI_ORDER_SECOND, xen_intr_init, NULL);
 
 /*--------------------------- Common PIC Functions ---------------------------*/
 /**
-- 
1.7.7.5 (Apple Git-26)

