]> xenbits.xensource.com Git - people/pauldu/xenbus.git/commitdiff
Move HypercallInitialize() earlier
authorPaul Durrant <pdurrant@amazon.com>
Fri, 27 Nov 2020 16:38:52 +0000 (16:38 +0000)
committerPaul Durrant <pdurrant@amazon.com>
Thu, 3 Dec 2020 08:14:22 +0000 (08:14 +0000)
A subsequent patch will add code called from SystemInitialize() that will need
to make hypercalls.

NOTE: There is a missing code to AcpiTeardown() in DllUnload() which is
      also fixed by this patch.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
src/xen/driver.c

index fe638d74b147106d341b6b28b5bfeeca6a209d91..9e4a18ef7dfdcac5ad3ecee37a8a5c9bc63d857f 100644 (file)
@@ -249,6 +249,8 @@ DllInitialize(
 
     __DriverSetUnplugKey(UnplugKey);
 
+    HypercallInitialize();
+
     status = AcpiInitialize();
     if (!NT_SUCCESS(status))
         goto fail6;
@@ -257,8 +259,6 @@ DllInitialize(
     if (!NT_SUCCESS(status))
         goto fail7;
 
-    HypercallInitialize();
-
     status = BugCheckInitialize();
     if (!NT_SUCCESS(status))
         goto fail8;
@@ -298,8 +298,6 @@ fail9:
 
     BugCheckTeardown();
 
-    HypercallTeardown();
-
 fail8:
     Error("fail8\n");
 
@@ -313,6 +311,8 @@ fail7:
 fail6:
     Error("fail6\n");
 
+    HypercallTeardown();
+
     RegistryCloseKey(UnplugKey);
     __DriverSetUnplugKey(NULL);
 
@@ -367,10 +367,12 @@ DllUnload(
 
     BugCheckTeardown();
 
-    HypercallTeardown();
-
     SystemTeardown();
 
+    AcpiTeardown();
+
+    HypercallTeardown();
+
     UnplugKey = __DriverGetUnplugKey();
 
     RegistryCloseKey(UnplugKey);