paravirt: add a hook for once the allocator is ready
authorJeremy Fitzhardinge <jeremy@xensource.com>
Wed, 18 Jul 2007 01:37:03 +0000 (18:37 -0700)
committerJeremy Fitzhardinge <jeremy@goop.org>
Wed, 18 Jul 2007 15:47:41 +0000 (08:47 -0700)
Add a hook so that the paravirt backend knows when the allocator is
ready.  This is useful for the obvious reason that the allocator is
available, but the other side-effect of having the bootmem allocator
available is that each page now has an associated "struct page".

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
arch/i386/kernel/setup.c
include/asm-i386/paravirt.h
include/asm-i386/setup.h

index 2d61e65eeb504164318c0c9e0b839b2a52808e2b..74871d066c2b0ce85351d36748865f293f620759 100644 (file)
@@ -601,6 +601,8 @@ void __init setup_arch(char **cmdline_p)
         * NOTE: at this point the bootmem allocator is fully available.
         */
 
+       paravirt_post_allocator_init();
+
        dmi_scan_machine();
 
 #ifdef CONFIG_X86_GENERICARCH
index 99bf661a65f2202ddff6a8d7d6b98ee2575d55e2..786856950b1a899f58838cdf8addab164d9e68f9 100644 (file)
@@ -52,6 +52,8 @@ struct paravirt_ops
        /* Basic arch-specific setup */
        void (*arch_setup)(void);
        char *(*memory_setup)(void);
+       void (*post_allocator_init)(void);
+
        void (*init_IRQ)(void);
        void (*time_init)(void);
 
@@ -669,6 +671,12 @@ static inline void setup_secondary_clock(void)
 }
 #endif
 
+static inline void paravirt_post_allocator_init(void)
+{
+       if (paravirt_ops.post_allocator_init)
+               (*paravirt_ops.post_allocator_init)();
+}
+
 static inline void paravirt_pagetable_setup_start(pgd_t *base)
 {
        if (paravirt_ops.pagetable_setup_start)
index 0d5bff9dc4a5e2133ef7d29bf7287e9381368ae3..7862fe858a9ef8e5e92e15e36cc2fcdf31c200d6 100644 (file)
@@ -81,6 +81,10 @@ void __init add_memory_region(unsigned long long start,
 
 extern unsigned long init_pg_tables_end;
 
+#ifndef CONFIG_PARAVIRT
+#define paravirt_post_allocator_init() do {} while (0)
+#endif
+
 #endif /* __ASSEMBLY__ */
 
 #endif  /*  __KERNEL__  */