install:
vpci.c: $(XEN_ROOT)/xen/drivers/vpci/vpci.c
- # Trick the compiler so it doesn't complain about missing symbols
- sed -e '/#include/d' \
- -e '1s;^;#include "emul.h"\
- vpci_register_init_t *const __start_vpci_array[1]\;\
- vpci_register_init_t *const __end_vpci_array[1]\;\
- ;' <$< >$@
+ # Remove includes and add the test harness header
+ sed -e '/#include/d' -e '1s/^/#include "emul.h"/' <$< >$@
list.h: $(XEN_ROOT)/xen/include/xen/list.h
vpci.h: $(XEN_ROOT)/xen/include/xen/vpci.h
#include <xen/sched.h>
#include <xen/vpci.h>
-extern vpci_register_init_t *const __start_vpci_array[];
-extern vpci_register_init_t *const __end_vpci_array[];
-#define NUM_VPCI_INIT (__end_vpci_array - __start_vpci_array)
-
/* Internal struct to store the emulated PCI registers. */
struct vpci_register {
vpci_read_t *read;
struct list_head node;
};
+#ifdef __XEN__
+extern vpci_register_init_t *const __start_vpci_array[];
+extern vpci_register_init_t *const __end_vpci_array[];
+#define NUM_VPCI_INIT (__end_vpci_array - __start_vpci_array)
+
void vpci_remove_device(struct pci_dev *pdev)
{
spin_lock(&pdev->vpci->lock);
return rc;
}
+#endif /* __XEN__ */
static int vpci_register_cmp(const struct vpci_register *r1,
const struct vpci_register *r2)
bool rom_enabled : 1;
/* FIXME: currently there's no support for SR-IOV. */
} header;
-#endif
/* MSI data. */
struct vpci_msi {
-#ifdef __XEN__
/* Address. */
uint64_t address;
/* Mask bitfield. */
uint8_t vectors : 5;
/* Arch-specific data. */
struct vpci_arch_msi arch;
-#endif
} *msi;
/* MSI-X data. */
struct vpci_msix {
-#ifdef __XEN__
struct pci_dev *pdev;
/* List link. */
struct list_head next;
bool updated : 1;
struct vpci_arch_msix_entry arch;
} entries[];
-#endif
} *msix;
+#endif
};
struct vpci_vcpu {