Allow xen platform pci device to be compiled as a module
Subsystems (3)
PATCH 8/11 Allow xen platform pci device to be compiled as a module
Signed-off-by Stefano Stabellini <[email protected]>
--- arch/x86/xen/enlighten.c | 2 ++ drivers/xen/events.c | 1 + drivers/xen/grant-table.c | 6 +++++- drivers/xen/manage.c | 14 +++++++++++--- drivers/xen/platform-pci.c | 1 + drivers/xen/xenbus/xenbus_probe.c | 1 + include/xen/platform_pci.h | 18 ++++-------------- 7 files changed, 25 insertions(+), 18 deletions(-)
arch/x86/xen/enlighten.c +2 -0
@@ -79,6 +79,7 @@ struct shared_info xen_dummy_shared_info;void *xen_initial_gdt;int xen_have_vector_callback; +EXPORT_SYMBOL_GPL (xen_have_vector_callback);int unplug;/*
@@ -1278,6 +1279,7 @@ int xen_set_callback_via(uint64_t via) a.value = via;return HYPERVISOR_hvm_op (HVMOP_set_param, &a); } +EXPORT_SYMBOL_GPL (xen_set_callback_via);void do_hvm_pv_evtchn_intr (void ) {
drivers/xen/events.c +1 -0
@@ -686,6 +686,7 @@ void xen_hvm_evtchn_do_upcall(struct pt_regs *regs) {__xen_evtchn_do_upcall (regs); } +EXPORT_SYMBOL_GPL (xen_hvm_evtchn_do_upcall);/* Rebind a new event channel to an existing irq. */ void rebind_evtchn_irq (int evtchn,int irq)
drivers/xen/grant-table.c +5 -1
@@ -54,6 +54,9 @@#define GNTTAB_LIST_END 0xffffffff#define GREFS_PER_GRANT_FRAME (PAGE_SIZE / sizeof(struct grant_entry)) +unsigned long (*alloc_xen_mmio_hook)(unsigned long len); +EXPORT_SYMBOL_GPL (alloc_xen_mmio_hook); +static grant_ref_t **gnttab_list;static unsigned int nr_grant_frames;static unsigned int boot_max_nr_grant_frames;
@@ -512,7 +515,7 @@ int gnttab_resume(void)return gnttab_map (0 , nr_grant_frames -1 );if (!hvm_pv_resume_frames) { - hvm_pv_resume_frames =alloc_xen_mmio (PAGE_SIZE * max_nr_gframes); + hvm_pv_resume_frames =alloc_xen_mmio_hook (PAGE_SIZE * max_nr_gframes); shared =ioremap (hvm_pv_resume_frames,PAGE_SIZE * max_nr_gframes);if (shared ==NULL ) { printk(KERN_WARNING
@@ -598,6 +601,7 @@ int gnttab_init(void)kfree (gnttab_list);return -ENOMEM ; } +EXPORT_SYMBOL_GPL (gnttab_init);static int __devinit __gnttab_init (void ) {
drivers/xen/manage.c +11 -3
@@ -32,6 +32,13 @@ enum shutdown_state { SHUTDOWN_HALT = 4, }; +void (*platform_pci_resume_hook)(void ); +EXPORT_SYMBOL_GPL (platform_pci_resume_hook); +void (*platform_pci_disable_irq_hook)(void ); +EXPORT_SYMBOL_GPL (platform_pci_disable_irq_hook); +void (*platform_pci_enable_irq_hook)(void ); +EXPORT_SYMBOL_GPL (platform_pci_enable_irq_hook); +/* Ignore multiple shutdown requests. */ static enum shutdown_state shutting_down =SHUTDOWN_INVALID ;
@@ -50,7 +57,7 @@ static int xen_hvm_suspend(void *data)if (!*cancelled) {xen_irq_resume (); -platform_pci_resume (); +platform_pci_resume_hook (); }return 0 ;
@@ -125,7 +132,7 @@ static void do_hvm_suspend(void)printk (KERN_DEBUG "suspending xenstore... " );xenbus_suspend ();printk (KERN_DEBUG "xenstore suspended\n" ); -platform_pci_disable_irq (); +platform_pci_disable_irq_hook (); err =stop_machine (xen_hvm_suspend, &cancelled,cpumask_of (0 ));if (err) {
@@ -133,7 +140,7 @@ static void do_hvm_suspend(void) cancelled =1 ; } -platform_pci_enable_irq (); +platform_pci_enable_irq_hook ();if (!cancelled) {xen_arch_resume ();
@@ -353,5 +360,6 @@ int xen_setup_shutdown_event(void)return 0 ; } +EXPORT_SYMBOL_GPL (xen_setup_shutdown_event);subsys_initcall (__setup_shutdown_event);
drivers/xen/platform-pci.c +1 -0
@@ -29,6 +29,7 @@#include <xen/grant_table.h> #include <xen/platform_pci.h> +#include <xen/platform_pci.h> #include <xen/interface/platform_pci.h> #include <xen/xenbus.h> #include <xen/events.h>
drivers/xen/xenbus/xenbus_probe.c +1 -0
@@ -883,6 +883,7 @@ int xenbus_probe_init(void) out_error:return err; } +EXPORT_SYMBOL_GPL (xenbus_probe_init);postcore_initcall (__xenbus_probe_init);
include/xen/platform_pci.h +4 -14
@@ -29,19 +29,9 @@#define XEN_IOPORT_LINUX_PRODNUM 0xffff#define XEN_IOPORT_LINUX_DRVVER ((LINUX_VERSION_CODE << 8) + 0x0) -#ifdef CONFIG_XEN_PLATFORM_PCI -unsigned long alloc_xen_mmio (unsigned long len); -void platform_pci_resume (void ); -void platform_pci_disable_irq (void ); -void platform_pci_enable_irq (void ); -#else -static inline unsigned long alloc_xen_mmio (unsigned long len) -{ -return ~0UL ; -} -static inline void platform_pci_resume (void ) {} -static inline void platform_pci_disable_irq (void ) {} -static inline void platform_pci_enable_irq (void ) {} -#endif +extern unsigned long (*alloc_xen_mmio_hook)(unsigned long len); +extern void (*platform_pci_resume_hook)(void ); +extern void (*platform_pci_disable_irq_hook)(void ); +extern void (*platform_pci_enable_irq_hook)(void );#endif /* _XEN_PLATFORM_PCI_H */
Signature · 1 line
1.5.4.3