]> xenbits.xensource.com Git - people/julieng/xen-unstable.git/commitdiff
libxc: make arch_setup_boot{init/late} xc_dom_arch hooks
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 2 Oct 2015 15:48:38 +0000 (17:48 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 8 Oct 2015 11:22:44 +0000 (12:22 +0100)
This should not introduce any functional change.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
tools/libxc/include/xc_dom.h
tools/libxc/xc_dom_arm.c
tools/libxc/xc_dom_boot.c
tools/libxc/xc_dom_x86.c

index 01739fa5000389da7df662da4eb0ea34ac30bc0e..ced6ae2848cbcb63c9d16f493471592d38f7ad45 100644 (file)
@@ -220,6 +220,8 @@ struct xc_dom_arch {
     int (*start_info) (struct xc_dom_image * dom);
     int (*shared_info) (struct xc_dom_image * dom, void *shared_info);
     int (*vcpu) (struct xc_dom_image * dom, void *vcpu_ctxt);
+    int (*bootearly) (struct xc_dom_image * dom);
+    int (*bootlate) (struct xc_dom_image * dom);
 
     /* arch-specific memory initialization. */
     int (*meminit) (struct xc_dom_image * dom);
@@ -399,11 +401,6 @@ static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
     return dom->p2m_host[pfn - dom->rambase_pfn];
 }
 
-/* --- arch bits --------------------------------------------------- */
-
-int arch_setup_bootearly(struct xc_dom_image *dom);
-int arch_setup_bootlate(struct xc_dom_image *dom);
-
 /*
  * Local variables:
  * mode: C
index e8a075648a98bf557166b886e0e173a3a2749751..ec3a757962153d7251f197be1c680d9d49f56820 100644 (file)
@@ -489,13 +489,20 @@ static int meminit(struct xc_dom_image *dom)
     return 0;
 }
 
-int arch_setup_bootearly(struct xc_dom_image *dom)
+int xc_dom_feature_translated(struct xc_dom_image *dom)
+{
+    return 1;
+}
+
+/* ------------------------------------------------------------------------ */
+
+static int bootearly(struct xc_dom_image *dom)
 {
     DOMPRINTF("%s: doing nothing", __FUNCTION__);
     return 0;
 }
 
-int arch_setup_bootlate(struct xc_dom_image *dom)
+static int bootlate(struct xc_dom_image *dom)
 {
     /* XXX
      *   map shared info
@@ -505,11 +512,6 @@ int arch_setup_bootlate(struct xc_dom_image *dom)
     return 0;
 }
 
-int xc_dom_feature_translated(struct xc_dom_image *dom)
-{
-    return 1;
-}
-
 /* ------------------------------------------------------------------------ */
 
 static struct xc_dom_arch xc_dom_32 = {
@@ -524,6 +526,8 @@ static struct xc_dom_arch xc_dom_32 = {
     .shared_info = shared_info_arm,
     .vcpu = vcpu_arm32,
     .meminit = meminit,
+    .bootearly = bootearly,
+    .bootlate = bootlate,
 };
 
 static struct xc_dom_arch xc_dom_64 = {
@@ -538,6 +542,8 @@ static struct xc_dom_arch xc_dom_64 = {
     .shared_info = shared_info_arm,
     .vcpu = vcpu_arm64,
     .meminit = meminit,
+    .bootearly = bootearly,
+    .bootlate = bootlate,
 };
 
 static void __init register_arch_hooks(void)
index bf2cd7b800f0f7dc6d73bd20ee1c34ff9f38a5ed..e6f77948d23207baf2dc8bf127b9494cd5868f8e 100644 (file)
@@ -208,7 +208,7 @@ int xc_dom_boot_image(struct xc_dom_image *dom)
     DOMPRINTF_CALLED(dom->xch);
 
     /* misc stuff*/
-    if ( (rc = arch_setup_bootearly(dom)) != 0 )
+    if ( (rc = dom->arch_hooks->bootearly(dom)) != 0 )
         return rc;
 
     /* collect some info */
@@ -255,7 +255,7 @@ int xc_dom_boot_image(struct xc_dom_image *dom)
     xc_dom_log_memory_footprint(dom);
 
     /* misc x86 stuff */
-    if ( (rc = arch_setup_bootlate(dom)) != 0 )
+    if ( (rc = dom->arch_hooks->bootlate(dom)) != 0 )
         return rc;
 
     /* let the vm run */
index fbedf85afd0446e933f23d11054487d758f0d9e5..b48dc1bc6091b4212025ea4b59c712ca07d4fc5f 100644 (file)
@@ -922,7 +922,9 @@ static int meminit_pv(struct xc_dom_image *dom)
     return rc;
 }
 
-int arch_setup_bootearly(struct xc_dom_image *dom)
+/* ------------------------------------------------------------------------ */
+
+static int bootearly(struct xc_dom_image *dom)
 {
     DOMPRINTF("%s: doing nothing", __FUNCTION__);
     return 0;
@@ -961,7 +963,7 @@ static int map_grant_table_frames(struct xc_dom_image *dom)
     return 0;
 }
 
-int arch_setup_bootlate(struct xc_dom_image *dom)
+static int bootlate_pv(struct xc_dom_image *dom)
 {
     static const struct {
         char *guest;
@@ -1057,6 +1059,8 @@ static struct xc_dom_arch xc_dom_32_pae = {
     .shared_info = shared_info_x86_32,
     .vcpu = vcpu_x86_32,
     .meminit = meminit_pv,
+    .bootearly = bootearly,
+    .bootlate = bootlate_pv,
 };
 
 static struct xc_dom_arch xc_dom_64 = {
@@ -1071,6 +1075,8 @@ static struct xc_dom_arch xc_dom_64 = {
     .shared_info = shared_info_x86_64,
     .vcpu = vcpu_x86_64,
     .meminit = meminit_pv,
+    .bootearly = bootearly,
+    .bootlate = bootlate_pv,
 };
 
 static void __init register_arch_hooks(void)