]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
x86/boot: Export bootstrap_map() for use in other translation units
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 28 Nov 2017 19:01:15 +0000 (19:01 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 11 Jan 2018 12:25:37 +0000 (12:25 +0000)
There is one static bootstrap_map() function which is passed via function
pointer to all of its users.  This is wasteful.

Export bootstrap_map() for all x86 users, and drop the function pointer
parameter from the construct_dom0*() infrastructure.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/dom0_build.c
xen/arch/x86/hvm/dom0_build.c
xen/arch/x86/pv/dom0_build.c
xen/arch/x86/setup.c
xen/include/asm-x86/dom0_build.h
xen/include/asm-x86/setup.h

index bf992fef6d4baa37625052a3eb5fe3ee8d914a98..75b2bb3bee0564fe139d2cd1dce7bbffe791a6eb 100644 (file)
@@ -463,7 +463,6 @@ int __init dom0_setup_permissions(struct domain *d)
 
 int __init construct_dom0(struct domain *d, const module_t *image,
                           unsigned long image_headroom, module_t *initrd,
-                          void *(*bootstrap_map)(const module_t *),
                           char *cmdline)
 {
     int rc;
@@ -484,7 +483,7 @@ int __init construct_dom0(struct domain *d, const module_t *image,
 #endif
 
     rc = (is_hvm_domain(d) ? dom0_construct_pvh : dom0_construct_pv)
-         (d, image, image_headroom, initrd, bootstrap_map, cmdline);
+         (d, image, image_headroom, initrd, cmdline);
     if ( rc )
         return rc;
 
index 4338965bf6e85afaed8c19afa857f90af8fa6538..d696d4cd9772cc754e4e65158d26aa68eaab8bec 100644 (file)
@@ -1063,7 +1063,6 @@ static int __init pvh_setup_acpi(struct domain *d, paddr_t start_info)
 int __init dom0_construct_pvh(struct domain *d, const module_t *image,
                               unsigned long image_headroom,
                               module_t *initrd,
-                              void *(*bootstrap_map)(const module_t *),
                               char *cmdline)
 {
     paddr_t entry, start_info;
index 09c765a06fe5f67ce06c53a6fec245e55a4fb805..8fd40b52543c3a166df966cb9dc6cf60758d266c 100644 (file)
@@ -275,7 +275,6 @@ int __init dom0_construct_pv(struct domain *d,
                              const module_t *image,
                              unsigned long image_headroom,
                              module_t *initrd,
-                             void *(*bootstrap_map)(const module_t *),
                              char *cmdline)
 {
     int i, cpu, rc, compatible, compat32, order, machine;
index 2e10c6bdf4150d46746d5ff0951c11163e31caa0..141f80f43160c1ee676a3eeef0fce90cd27bb47d 100644 (file)
@@ -319,7 +319,7 @@ static void __init normalise_cpu_order(void)
  * Ensure a given physical memory range is present in the bootstrap mappings.
  * Use superpage mappings to ensure that pagetable memory needn't be allocated.
  */
-static void *__init bootstrap_map(const module_t *mod)
+void *__init bootstrap_map(const module_t *mod)
 {
     static unsigned long __initdata map_cur = BOOTSTRAP_MAP_BASE;
     uint64_t start, end, mask = (1L << L2_PAGETABLE_SHIFT) - 1;
@@ -1654,8 +1654,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
      */
     if ( construct_dom0(dom0, mod, modules_headroom,
                         (initrdidx > 0) && (initrdidx < mbi->mods_count)
-                        ? mod + initrdidx : NULL,
-                        bootstrap_map, cmdline) != 0)
+                        ? mod + initrdidx : NULL, cmdline) != 0)
         panic("Could not set up DOM0 guest OS");
 
     if ( cpu_has_smap )
index d83d2b4387038a3af208616e09288bcbde40ed9d..25d124f8d411ef50df9afd880077e9072e233ee0 100644 (file)
@@ -17,13 +17,11 @@ int dom0_setup_permissions(struct domain *d);
 int dom0_construct_pv(struct domain *d, const module_t *image,
                       unsigned long image_headroom,
                       module_t *initrd,
-                      void *(*bootstrap_map)(const module_t *),
                       char *cmdline);
 
 int dom0_construct_pvh(struct domain *d, const module_t *image,
                        unsigned long image_headroom,
                        module_t *initrd,
-                       void *(*bootstrap_map)(const module_t *),
                        char *cmdline);
 
 unsigned long dom0_paging_pages(const struct domain *d,
index c5b3d4ef18864c617d0332a0b01735f92baaf233..46e9ca69204594ec770a31e98c34df9330ffd652 100644 (file)
@@ -38,12 +38,12 @@ int construct_dom0(
     struct domain *d,
     const module_t *kernel, unsigned long kernel_headroom,
     module_t *initrd,
-    void *(*bootstrap_map)(const module_t *),
     char *cmdline);
 void setup_io_bitmap(struct domain *d);
 
 unsigned long initial_images_nrpages(nodeid_t node);
 void discard_initial_images(void);
+void *bootstrap_map(const module_t *mod);
 
 unsigned int dom0_max_vcpus(void);