platform_pci.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef _XEN_PLATFORM_PCI_H
  2. #define _XEN_PLATFORM_PCI_H
  3. #define XEN_IOPORT_MAGIC_VAL 0x49d2
  4. #define XEN_IOPORT_LINUX_PRODNUM 0x0003
  5. #define XEN_IOPORT_LINUX_DRVVER 0x0001
  6. #define XEN_IOPORT_BASE 0x10
  7. #define XEN_IOPORT_PLATFLAGS (XEN_IOPORT_BASE + 0) /* 1 byte access (R/W) */
  8. #define XEN_IOPORT_MAGIC (XEN_IOPORT_BASE + 0) /* 2 byte access (R) */
  9. #define XEN_IOPORT_UNPLUG (XEN_IOPORT_BASE + 0) /* 2 byte access (W) */
  10. #define XEN_IOPORT_DRVVER (XEN_IOPORT_BASE + 0) /* 4 byte access (W) */
  11. #define XEN_IOPORT_SYSLOG (XEN_IOPORT_BASE + 2) /* 1 byte access (W) */
  12. #define XEN_IOPORT_PROTOVER (XEN_IOPORT_BASE + 2) /* 1 byte access (R) */
  13. #define XEN_IOPORT_PRODNUM (XEN_IOPORT_BASE + 2) /* 2 byte access (W) */
  14. #define XEN_UNPLUG_ALL_IDE_DISKS 1
  15. #define XEN_UNPLUG_ALL_NICS 2
  16. #define XEN_UNPLUG_AUX_IDE_DISKS 4
  17. #define XEN_UNPLUG_ALL 7
  18. #define XEN_UNPLUG_UNNECESSARY 8
  19. #define XEN_UNPLUG_NEVER 16
  20. static inline int xen_must_unplug_nics(void) {
  21. #if (defined(CONFIG_XEN_NETDEV_FRONTEND) || \
  22. defined(CONFIG_XEN_NETDEV_FRONTEND_MODULE)) && \
  23. (defined(CONFIG_XEN_PLATFORM_PCI) || \
  24. defined(CONFIG_XEN_PLATFORM_PCI_MODULE))
  25. return 1;
  26. #else
  27. return 0;
  28. #endif
  29. }
  30. static inline int xen_must_unplug_disks(void) {
  31. #if (defined(CONFIG_XEN_BLKDEV_FRONTEND) || \
  32. defined(CONFIG_XEN_BLKDEV_FRONTEND_MODULE)) && \
  33. (defined(CONFIG_XEN_PLATFORM_PCI) || \
  34. defined(CONFIG_XEN_PLATFORM_PCI_MODULE))
  35. return 1;
  36. #else
  37. return 0;
  38. #endif
  39. }
  40. extern int xen_platform_pci_unplug;
  41. #endif /* _XEN_PLATFORM_PCI_H */