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