msi.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_X86_MSI_H
  3. #define _ASM_X86_MSI_H
  4. #include <asm/hw_irq.h>
  5. #include <asm/irqdomain.h>
  6. typedef struct irq_alloc_info msi_alloc_info_t;
  7. int pci_msi_prepare(struct irq_domain *domain, struct device *dev, int nvec,
  8. msi_alloc_info_t *arg);
  9. /* Structs and defines for the X86 specific MSI message format */
  10. typedef struct x86_msi_data {
  11. union {
  12. struct {
  13. u32 vector : 8,
  14. delivery_mode : 3,
  15. dest_mode_logical : 1,
  16. reserved : 2,
  17. active_low : 1,
  18. is_level : 1;
  19. };
  20. u32 dmar_subhandle;
  21. };
  22. } __attribute__ ((packed)) arch_msi_msg_data_t;
  23. #define arch_msi_msg_data x86_msi_data
  24. typedef struct x86_msi_addr_lo {
  25. union {
  26. struct {
  27. u32 reserved_0 : 2,
  28. dest_mode_logical : 1,
  29. redirect_hint : 1,
  30. reserved_1 : 1,
  31. virt_destid_8_14 : 7,
  32. destid_0_7 : 8,
  33. base_address : 12;
  34. };
  35. struct {
  36. u32 dmar_reserved_0 : 2,
  37. dmar_index_15 : 1,
  38. dmar_subhandle_valid : 1,
  39. dmar_format : 1,
  40. dmar_index_0_14 : 15,
  41. dmar_base_address : 12;
  42. };
  43. };
  44. } __attribute__ ((packed)) arch_msi_msg_addr_lo_t;
  45. #define arch_msi_msg_addr_lo x86_msi_addr_lo
  46. #define X86_MSI_BASE_ADDRESS_LOW (0xfee00000 >> 20)
  47. typedef struct x86_msi_addr_hi {
  48. u32 reserved : 8,
  49. destid_8_31 : 24;
  50. } __attribute__ ((packed)) arch_msi_msg_addr_hi_t;
  51. #define arch_msi_msg_addr_hi x86_msi_addr_hi
  52. #define X86_MSI_BASE_ADDRESS_HIGH (0)
  53. struct msi_msg;
  54. u32 x86_msi_msg_get_destid(struct msi_msg *msg, bool extid);
  55. #endif /* _ASM_X86_MSI_H */