summaryrefslogtreecommitdiff
path: root/Include/Protocol/Legacy8259.h
blob: 6cf3d85e2a49bf3e13b66c56abcffe857684a315 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2005, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**             6145-F Northbelt Pkwy, Norcross, GA 30071            **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************

//**********************************************************************
// $Header: /Alaska/BIN/Core/Include/Protocol/Legacy8259.h 2     3/13/06 1:40a Felixp $
//
// $Revision: 2 $
//
// $Date: 3/13/06 1:40a $
//**********************************************************************
// Revision History
// ----------------
// $Log: /Alaska/BIN/Core/Include/Protocol/Legacy8259.h $
// 
// 2     3/13/06 1:40a Felixp
// 
// 1     1/28/05 12:44p Felixp
// 
// 2     1/18/05 3:22p Felixp
// PrintDebugMessage renamed to Trace
// 
// 1     12/23/04 9:41a Felixp
// 
// 1     7/13/04 2:33p Markw
// 
//**********************************************************************
//<AMI_FHDR_START>
//
// Name:	
//
// Description:	
//
//<AMI_FHDR_END>
//**********************************************************************
#ifndef __LEGACY8259_PROTOCOL_H__
#define __LEGACY8259_PROTOCOL_H__
#ifdef __cplusplus
extern "C" {
#endif
#include<EFI.h>

// {38321DBA-4FE0-4E17-8AEC-413055EAEDC1}
#define EFI_LEGACY_8259_PROTOCOL_GUID \
	{0x38321dba,0x4fe0,0x4e17,0x8a,0xec,0x41,0x30,0x55,0xea,0xed,0xc1}

GUID_VARIABLE_DECLARATION(gEfiLegacy8259ProtocolGuid,EFI_LEGACY_8259_PROTOCOL_GUID);

typedef struct _EFI_LEGACY_8259_PROTOCOL EFI_LEGACY_8259_PROTOCOL;


//************************************************
// EFI_8259_MODE
//************************************************
typedef enum {
	Efi8259LegacyMode,
	Efi8259ProtectedMode,
	Efi8259MaxMode
} EFI_8259_MODE;

//******************************************
// EFI_8259_IRQ
//******************************************
typedef enum {
	Efi8259Irq0,  Efi8259Irq1,
	Efi8259Irq2,  Efi8259Irq3,
	Efi8259Irq4,  Efi8259Irq5,
	Efi8259Irq6,  Efi8259Irq7,
	Efi8259Irq8,  Efi8259Irq9,
	Efi8259Irq10, Efi8259Irq11,
	Efi8259Irq12, Efi8259Irq13,
	Efi8259Irq14, Efi8259Irq15,
	Efi8259IrqMax
} EFI_8259_IRQ;


typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_SET_VECTOR_BASE) (
	IN EFI_LEGACY_8259_PROTOCOL	*This,
	IN UINT8 					MasterBase,
	IN UINT8 					SlaveBase
);

typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_GET_MASK) (
	IN EFI_LEGACY_8259_PROTOCOL	*This,
	OUT UINT16 					*LegacyMask			OPTIONAL,
	OUT UINT16 					*LegacyEdgeLevel	OPTIONAL,
	OUT UINT16 					*ProtectedMask		OPTIONAL,
	OUT UINT16 					*ProtectedEdgeLevel	OPTIONAL
);

typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_SET_MASK) (
	IN EFI_LEGACY_8259_PROTOCOL	*This,
	IN UINT16 					*LegacyMask			OPTIONAL,
	IN UINT16 					*LegacyEdgeLevel	OPTIONAL,
	IN UINT16 					*ProtectedMask		OPTIONAL,
	IN UINT16 					*ProtectedEdgeLevel	OPTIONAL
);

typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_SET_MODE) (
	IN EFI_LEGACY_8259_PROTOCOL	*This,
	IN EFI_8259_MODE			Mode,
	IN UINT16 					*Mask 		OPTIONAL,
	IN UINT16					*EdgeLevel	OPTIONAL
);

typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_GET_VECTOR) (
	IN EFI_LEGACY_8259_PROTOCOL	*This,
	IN EFI_8259_IRQ 			Irq,
	OUT UINT8 					*Vector
);

typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_ENABLE_IRQ) (
	IN EFI_LEGACY_8259_PROTOCOL	*This,
	IN EFI_8259_IRQ 			Irq,
	IN BOOLEAN 					LevelTriggered
);

typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_DISABLE_IRQ) (
	IN EFI_LEGACY_8259_PROTOCOL	*This,
	IN EFI_8259_IRQ				Irq
);

typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_GET_INTERRUPT_LINE) (
	IN EFI_LEGACY_8259_PROTOCOL	*This,
	IN EFI_HANDLE				PciHandle,
	OUT UINT8 					*Vector
);

typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_END_OF_INTERRUPT) (
	IN EFI_LEGACY_8259_PROTOCOL	*This,
	IN EFI_8259_IRQ				Irq
);

typedef struct _EFI_LEGACY_8259_PROTOCOL {
	EFI_LEGACY_8259_SET_VECTOR_BASE	SetVectorBase;
	EFI_LEGACY_8259_GET_MASK			GetMask;
	EFI_LEGACY_8259_SET_MASK			SetMask;
	EFI_LEGACY_8259_SET_MODE			SetMode;
	EFI_LEGACY_8259_GET_VECTOR			GetVector;
	EFI_LEGACY_8259_ENABLE_IRQ			EnableIrq;
	EFI_LEGACY_8259_DISABLE_IRQ			DisableIrq;
	EFI_LEGACY_8259_GET_INTERRUPT_LINE	GetInterruptLine;
	EFI_LEGACY_8259_END_OF_INTERRUPT	EndOfInterrupt;
};

/****** DO NOT WRITE BELOW THIS LINE *******/
#ifdef __cplusplus
}
#endif
#endif

//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2005, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**             6145-F Northbelt Pkwy, Norcross, GA 30071            **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************