]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/LegacyInterrupt.h
Update comment in SMM Library class include file.
[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, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 @par Revision Reference:
14 This protocol is defined in Framework for EFI Compatibility Support Module spec
15 Version 0.97.
16
17 **/
18
19 #ifndef _EFI_LEGACY_INTERRUPT_H_
20 #define _EFI_LEGACY_INTERRUPT_H_
21
22 #include <PiDxe.h>
23
24 #define EFI_LEGACY_INTERRUPT_PROTOCOL_GUID \
25 { \
26 0x31ce593d, 0x108a, 0x485d, {0xad, 0xb2, 0x78, 0xf2, 0x1f, 0x29, 0x66, 0xbe } \
27 }
28
29 typedef struct _EFI_LEGACY_INTERRUPT_PROTOCOL EFI_LEGACY_INTERRUPT_PROTOCOL;
30
31 /**
32 Get the number of PIRQs this hardware supports.
33
34 @param This Protocol instance pointer.
35 @param NumberPirsq Number of PIRQs that are supported.
36
37 @retval EFI_SUCCESS The number of PIRQs was returned successfully.
38
39 **/
40 typedef
41 EFI_STATUS
42 (EFIAPI *EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS)(
43 IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
44 OUT UINT8 *NumberPirqs
45 );
46
47 /**
48 Gets the PCI location associated with this protocol.
49
50 @param This Protocol instance pointer.
51 @param Bus PCI Bus
52 @param Device PCI Device
53 @param Function PCI Function
54
55 @retval EFI_SUCCESS The Bus, Device, and Function were returned successfully
56
57 **/
58 typedef
59 EFI_STATUS
60 (EFIAPI *EFI_LEGACY_INTERRUPT_GET_LOCATION)(
61 IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
62 OUT UINT8 *Bus,
63 OUT UINT8 *Device,
64 OUT UINT8 *Function
65 );
66
67 /**
68 Read the PIRQ register and return the data
69
70 @param This Protocol instance pointer.
71 @param PirqNumber PIRQ register to read
72 @param PirqData Data read
73
74 @retval EFI_SUCCESS Data was read
75 @retval EFI_INVALID_PARAMETER Invalid PIRQ number
76
77 **/
78 typedef
79 EFI_STATUS
80 (EFIAPI *EFI_LEGACY_INTERRUPT_READ_PIRQ)(
81 IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
82 IN UINT8 PirqNumber,
83 OUT UINT8 *PirqData
84 );
85
86 /**
87 Write the specified PIRQ register with the given data.
88
89 @param This Protocol instance pointer.
90 @param PirqNumber PIRQ register to read.
91 @param PirqData Data to write.
92
93 @retval EFI_SUCCESS The PIRQ was programmed
94 @retval EFI_INVALID_PARAMETER Invalid PIRQ number
95
96 **/
97 typedef
98 EFI_STATUS
99 (EFIAPI *EFI_LEGACY_INTERRUPT_WRITE_PIRQ)(
100 IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
101 IN UINT8 PirqNumber,
102 IN UINT8 PirqData
103 );
104
105 struct _EFI_LEGACY_INTERRUPT_PROTOCOL {
106 ///
107 /// Gets the number of PIRQs supported.
108 ///
109 EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS GetNumberPirqs;
110 ///
111 /// Gets the PCI bus, device, and function that associated with this protocol.
112 ///
113 EFI_LEGACY_INTERRUPT_GET_LOCATION GetLocation;
114 ///
115 /// Reads the indicated PIRQ register.
116 ///
117 EFI_LEGACY_INTERRUPT_READ_PIRQ ReadPirq;
118 ///
119 /// Writes to the indicated PIRQ register.
120 ///
121 EFI_LEGACY_INTERRUPT_WRITE_PIRQ WritePirq;
122 };
123
124 extern EFI_GUID gEfiLegacyInterruptProtocolGuid;
125
126 #endif