diff options
author | Jeremy Fitzhardinge <jeremy@xensource.com> | 2007-07-17 21:37:03 -0400 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy@goop.org> | 2007-07-18 11:47:41 -0400 |
commit | 6996d3b63fd9a64341bc80dad1b556fd3eb81272 (patch) | |
tree | 74ddc02eeb33c5ce6a9670cd3fcd1613444e0711 | |
parent | fdb4c338c8d1d494e17c3422a3ea2129f6791596 (diff) |
paravirt: add a hook for once the allocator is ready
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>
-rw-r--r-- | arch/i386/kernel/setup.c | 2 | ||||
-rw-r--r-- | include/asm-i386/paravirt.h | 8 | ||||
-rw-r--r-- | include/asm-i386/setup.h | 4 |
3 files changed, 14 insertions, 0 deletions
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 2d61e65eeb50..74871d066c2b 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c | |||
@@ -601,6 +601,8 @@ void __init setup_arch(char **cmdline_p) | |||
601 | * NOTE: at this point the bootmem allocator is fully available. | 601 | * NOTE: at this point the bootmem allocator is fully available. |
602 | */ | 602 | */ |
603 | 603 | ||
604 | paravirt_post_allocator_init(); | ||
605 | |||
604 | dmi_scan_machine(); | 606 | dmi_scan_machine(); |
605 | 607 | ||
606 | #ifdef CONFIG_X86_GENERICARCH | 608 | #ifdef CONFIG_X86_GENERICARCH |
diff --git a/include/asm-i386/paravirt.h b/include/asm-i386/paravirt.h index 99bf661a65f2..786856950b1a 100644 --- a/include/asm-i386/paravirt.h +++ b/include/asm-i386/paravirt.h | |||
@@ -52,6 +52,8 @@ struct paravirt_ops | |||
52 | /* Basic arch-specific setup */ | 52 | /* Basic arch-specific setup */ |
53 | void (*arch_setup)(void); | 53 | void (*arch_setup)(void); |
54 | char *(*memory_setup)(void); | 54 | char *(*memory_setup)(void); |
55 | void (*post_allocator_init)(void); | ||
56 | |||
55 | void (*init_IRQ)(void); | 57 | void (*init_IRQ)(void); |
56 | void (*time_init)(void); | 58 | void (*time_init)(void); |
57 | 59 | ||
@@ -669,6 +671,12 @@ static inline void setup_secondary_clock(void) | |||
669 | } | 671 | } |
670 | #endif | 672 | #endif |
671 | 673 | ||
674 | static inline void paravirt_post_allocator_init(void) | ||
675 | { | ||
676 | if (paravirt_ops.post_allocator_init) | ||
677 | (*paravirt_ops.post_allocator_init)(); | ||
678 | } | ||
679 | |||
672 | static inline void paravirt_pagetable_setup_start(pgd_t *base) | 680 | static inline void paravirt_pagetable_setup_start(pgd_t *base) |
673 | { | 681 | { |
674 | if (paravirt_ops.pagetable_setup_start) | 682 | if (paravirt_ops.pagetable_setup_start) |
diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h index 0d5bff9dc4a5..7862fe858a9e 100644 --- a/include/asm-i386/setup.h +++ b/include/asm-i386/setup.h | |||
@@ -81,6 +81,10 @@ void __init add_memory_region(unsigned long long start, | |||
81 | 81 | ||
82 | extern unsigned long init_pg_tables_end; | 82 | extern unsigned long init_pg_tables_end; |
83 | 83 | ||
84 | #ifndef CONFIG_PARAVIRT | ||
85 | #define paravirt_post_allocator_init() do {} while (0) | ||
86 | #endif | ||
87 | |||
84 | #endif /* __ASSEMBLY__ */ | 88 | #endif /* __ASSEMBLY__ */ |
85 | 89 | ||
86 | #endif /* __KERNEL__ */ | 90 | #endif /* __KERNEL__ */ |