--- /dev/null
+/** @file\r
+ This protocol abstracts the PIRQ programming from the generic EFI Compatibility Support Modules (CSMs).\r
+\r
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+ @par Revision Reference:\r
+ This protocol is defined in Framework for the EFI Compatibility Support Module specification.\r
+ Version 0.97.\r
+\r
+**/\r
+\r
+#ifndef _EFI_LEGACY_INTERRUPT_H_\r
+#define _EFI_LEGACY_INTERRUPT_H_\r
+\r
+\r
+#define EFI_LEGACY_INTERRUPT_PROTOCOL_GUID \\r
+ { \\r
+ 0x31ce593d, 0x108a, 0x485d, {0xad, 0xb2, 0x78, 0xf2, 0x1f, 0x29, 0x66, 0xbe } \\r
+ }\r
+\r
+typedef struct _EFI_LEGACY_INTERRUPT_PROTOCOL EFI_LEGACY_INTERRUPT_PROTOCOL;\r
+\r
+/**\r
+ Get the number of PIRQs this hardware supports.\r
+\r
+ @param This The protocol instance pointer.\r
+ @param NumberPirsq The number of PIRQs that are supported.\r
+\r
+ @retval EFI_SUCCESS The number of PIRQs was returned successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS)(\r
+ IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,\r
+ OUT UINT8 *NumberPirqs\r
+ );\r
+\r
+/**\r
+ Gets the PCI location associated with this protocol.\r
+\r
+ @param This The Protocol instance pointer.\r
+ @param Bus The PCI Bus.\r
+ @param Device The PCI Device.\r
+ @param Function The PCI Function.\r
+\r
+ @retval EFI_SUCCESS The Bus, Device, and Function were returned successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_INTERRUPT_GET_LOCATION)(\r
+ IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,\r
+ OUT UINT8 *Bus,\r
+ OUT UINT8 *Device,\r
+ OUT UINT8 *Function\r
+ );\r
+\r
+/**\r
+ Read the PIRQ register and return the data\r
+\r
+ @param This The protocol instance pointer.\r
+ @param PirqNumber The PIRQ register to read.\r
+ @param PirqData The data read.\r
+\r
+ @retval EFI_SUCCESS The data was read.\r
+ @retval EFI_INVALID_PARAMETER Invalid PIRQ number.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_INTERRUPT_READ_PIRQ)(\r
+ IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,\r
+ IN UINT8 PirqNumber,\r
+ OUT UINT8 *PirqData\r
+ );\r
+\r
+/**\r
+ Write the specified PIRQ register with the given data.\r
+\r
+ @param This The protocol instance pointer.\r
+ @param PirqNumber A PIRQ register to read.\r
+ @param PirqData The data to write.\r
+\r
+ @retval EFI_SUCCESS The PIRQ was programmed.\r
+ @retval EFI_INVALID_PARAMETER Invalid PIRQ number.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_INTERRUPT_WRITE_PIRQ)(\r
+ IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,\r
+ IN UINT8 PirqNumber,\r
+ IN UINT8 PirqData\r
+ );\r
+\r
+struct _EFI_LEGACY_INTERRUPT_PROTOCOL {\r
+ ///\r
+ /// Gets the number of PIRQs supported.\r
+ ///\r
+ EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS GetNumberPirqs;\r
+\r
+ ///\r
+ /// Gets the PCI bus, device, and function that is associated with this protocol.\r
+ ///\r
+ EFI_LEGACY_INTERRUPT_GET_LOCATION GetLocation;\r
+\r
+ ///\r
+ /// Reads the indicated PIRQ register.\r
+ ///\r
+ EFI_LEGACY_INTERRUPT_READ_PIRQ ReadPirq;\r
+\r
+ ///\r
+ /// Writes to the indicated PIRQ register.\r
+ ///\r
+ EFI_LEGACY_INTERRUPT_WRITE_PIRQ WritePirq;\r
+};\r
+\r
+extern EFI_GUID gEfiLegacyInterruptProtocolGuid;\r
+\r
+#endif\r