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