LegacyInterrupt.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /** @file
  2. This protocol abstracts the PIRQ programming from the generic EFI Compatibility Support Modules (CSMs).
  3. Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. @par Revision Reference:
  6. This protocol is defined in Framework for the EFI Compatibility Support Module specification.
  7. Version 0.97.
  8. **/
  9. #ifndef _EFI_LEGACY_INTERRUPT_H_
  10. #define _EFI_LEGACY_INTERRUPT_H_
  11. #define EFI_LEGACY_INTERRUPT_PROTOCOL_GUID \
  12. { \
  13. 0x31ce593d, 0x108a, 0x485d, {0xad, 0xb2, 0x78, 0xf2, 0x1f, 0x29, 0x66, 0xbe } \
  14. }
  15. typedef struct _EFI_LEGACY_INTERRUPT_PROTOCOL EFI_LEGACY_INTERRUPT_PROTOCOL;
  16. /**
  17. Get the number of PIRQs this hardware supports.
  18. @param This The protocol instance pointer.
  19. @param NumberPirsq The number of PIRQs that are supported.
  20. @retval EFI_SUCCESS The number of PIRQs was returned successfully.
  21. **/
  22. typedef
  23. EFI_STATUS
  24. (EFIAPI *EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS)(
  25. IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
  26. OUT UINT8 *NumberPirqs
  27. );
  28. /**
  29. Gets the PCI location associated with this protocol.
  30. @param This The Protocol instance pointer.
  31. @param Bus The PCI Bus.
  32. @param Device The PCI Device.
  33. @param Function The PCI Function.
  34. @retval EFI_SUCCESS The Bus, Device, and Function were returned successfully.
  35. **/
  36. typedef
  37. EFI_STATUS
  38. (EFIAPI *EFI_LEGACY_INTERRUPT_GET_LOCATION)(
  39. IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
  40. OUT UINT8 *Bus,
  41. OUT UINT8 *Device,
  42. OUT UINT8 *Function
  43. );
  44. /**
  45. Read the PIRQ register and return the data
  46. @param This The protocol instance pointer.
  47. @param PirqNumber The PIRQ register to read.
  48. @param PirqData The data read.
  49. @retval EFI_SUCCESS The data was read.
  50. @retval EFI_INVALID_PARAMETER Invalid PIRQ number.
  51. **/
  52. typedef
  53. EFI_STATUS
  54. (EFIAPI *EFI_LEGACY_INTERRUPT_READ_PIRQ)(
  55. IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
  56. IN UINT8 PirqNumber,
  57. OUT UINT8 *PirqData
  58. );
  59. /**
  60. Write the specified PIRQ register with the given data.
  61. @param This The protocol instance pointer.
  62. @param PirqNumber A PIRQ register to read.
  63. @param PirqData The data to write.
  64. @retval EFI_SUCCESS The PIRQ was programmed.
  65. @retval EFI_INVALID_PARAMETER Invalid PIRQ number.
  66. **/
  67. typedef
  68. EFI_STATUS
  69. (EFIAPI *EFI_LEGACY_INTERRUPT_WRITE_PIRQ)(
  70. IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
  71. IN UINT8 PirqNumber,
  72. IN UINT8 PirqData
  73. );
  74. struct _EFI_LEGACY_INTERRUPT_PROTOCOL {
  75. ///
  76. /// Gets the number of PIRQs supported.
  77. ///
  78. EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS GetNumberPirqs;
  79. ///
  80. /// Gets the PCI bus, device, and function that is associated with this protocol.
  81. ///
  82. EFI_LEGACY_INTERRUPT_GET_LOCATION GetLocation;
  83. ///
  84. /// Reads the indicated PIRQ register.
  85. ///
  86. EFI_LEGACY_INTERRUPT_READ_PIRQ ReadPirq;
  87. ///
  88. /// Writes to the indicated PIRQ register.
  89. ///
  90. EFI_LEGACY_INTERRUPT_WRITE_PIRQ WritePirq;
  91. };
  92. extern EFI_GUID gEfiLegacyInterruptProtocolGuid;
  93. #endif