]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Csm/Include/Protocol/LegacyInterrupt.h
OvmfPkg: Apply uncrustify changes
[mirror_edk2.git] / OvmfPkg / Csm / 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 #define EFI_LEGACY_INTERRUPT_PROTOCOL_GUID \
17 { \
18 0x31ce593d, 0x108a, 0x485d, {0xad, 0xb2, 0x78, 0xf2, 0x1f, 0x29, 0x66, 0xbe } \
19 }
20
21 typedef struct _EFI_LEGACY_INTERRUPT_PROTOCOL EFI_LEGACY_INTERRUPT_PROTOCOL;
22
23 /**
24 Get the number of PIRQs this hardware supports.
25
26 @param This The protocol instance pointer.
27 @param NumberPirsq The number of PIRQs that are supported.
28
29 @retval EFI_SUCCESS The number of PIRQs was returned successfully.
30
31 **/
32 typedef
33 EFI_STATUS
34 (EFIAPI *EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS)(
35 IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
36 OUT UINT8 *NumberPirqs
37 );
38
39 /**
40 Gets the PCI location associated with this protocol.
41
42 @param This The Protocol instance pointer.
43 @param Bus The PCI Bus.
44 @param Device The PCI Device.
45 @param Function The PCI Function.
46
47 @retval EFI_SUCCESS The Bus, Device, and Function were returned successfully.
48
49 **/
50 typedef
51 EFI_STATUS
52 (EFIAPI *EFI_LEGACY_INTERRUPT_GET_LOCATION)(
53 IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
54 OUT UINT8 *Bus,
55 OUT UINT8 *Device,
56 OUT UINT8 *Function
57 );
58
59 /**
60 Read the PIRQ register and return the data
61
62 @param This The protocol instance pointer.
63 @param PirqNumber The PIRQ register to read.
64 @param PirqData The data read.
65
66 @retval EFI_SUCCESS The data was read.
67 @retval EFI_INVALID_PARAMETER Invalid PIRQ number.
68
69 **/
70 typedef
71 EFI_STATUS
72 (EFIAPI *EFI_LEGACY_INTERRUPT_READ_PIRQ)(
73 IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
74 IN UINT8 PirqNumber,
75 OUT UINT8 *PirqData
76 );
77
78 /**
79 Write the specified PIRQ register with the given data.
80
81 @param This The protocol instance pointer.
82 @param PirqNumber A PIRQ register to read.
83 @param PirqData The data to write.
84
85 @retval EFI_SUCCESS The PIRQ was programmed.
86 @retval EFI_INVALID_PARAMETER Invalid PIRQ number.
87
88 **/
89 typedef
90 EFI_STATUS
91 (EFIAPI *EFI_LEGACY_INTERRUPT_WRITE_PIRQ)(
92 IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
93 IN UINT8 PirqNumber,
94 IN UINT8 PirqData
95 );
96
97 struct _EFI_LEGACY_INTERRUPT_PROTOCOL {
98 ///
99 /// Gets the number of PIRQs supported.
100 ///
101 EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS GetNumberPirqs;
102
103 ///
104 /// Gets the PCI bus, device, and function that is associated with this protocol.
105 ///
106 EFI_LEGACY_INTERRUPT_GET_LOCATION GetLocation;
107
108 ///
109 /// Reads the indicated PIRQ register.
110 ///
111 EFI_LEGACY_INTERRUPT_READ_PIRQ ReadPirq;
112
113 ///
114 /// Writes to the indicated PIRQ register.
115 ///
116 EFI_LEGACY_INTERRUPT_WRITE_PIRQ WritePirq;
117 };
118
119 extern EFI_GUID gEfiLegacyInterruptProtocolGuid;
120
121 #endif