Remove the EDK prefix from library instance folder's name
[mirror_edk2.git] / IntelFrameworkModulePkg / Include / Protocol / IsaIo.h
CommitLineData
c3902377 1/*++\r
2\r
3Copyright (c) 2006 - 2007, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 IsaIo.h\r
15 \r
16Abstract:\r
17\r
18 EFI ISA I/O Protocol\r
19\r
20Revision History\r
21\r
22--*/\r
23\r
24#ifndef _EFI_ISA_IO_H\r
25#define _EFI_ISA_IO_H\r
26\r
27\r
28#include <Protocol/IsaAcpi.h>\r
29\r
30//\r
31// Global ID for the ISA I/O Protocol\r
32//\r
33\r
34#define EFI_ISA_IO_PROTOCOL_GUID \\r
35 { 0x7ee2bd44, 0x3da0, 0x11d4, { 0x9a, 0x38, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }\r
36\r
37typedef struct _EFI_ISA_IO_PROTOCOL EFI_ISA_IO_PROTOCOL;\r
38\r
39//\r
40// Prototypes for the ISA I/O Protocol\r
41//\r
42\r
43typedef enum {\r
44 EfiIsaIoWidthUint8,\r
45 EfiIsaIoWidthUint16,\r
46 EfiIsaIoWidthUint32,\r
47 EfiIsaIoWidthReserved,\r
48 EfiIsaIoWidthFifoUint8,\r
49 EfiIsaIoWidthFifoUint16,\r
50 EfiIsaIoWidthFifoUint32,\r
51 EfiIsaIoWidthFifoReserved,\r
52 EfiIsaIoWidthFillUint8,\r
53 EfiIsaIoWidthFillUint16,\r
54 EfiIsaIoWidthFillUint32,\r
55 EfiIsaIoWidthFillReserved,\r
56 EfiIsaIoWidthMaximum\r
57} EFI_ISA_IO_PROTOCOL_WIDTH;\r
58\r
59//\r
60// Attributes for common buffer allocations\r
61//\r
62#define EFI_ISA_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x080 // Map a memory range so write are combined\r
63#define EFI_ISA_IO_ATTRIBUTE_MEMORY_CACHED 0x800 // Map a memory range so all r/w accesses are cached\r
64#define EFI_ISA_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 // Disable a memory range \r
65\r
66//\r
67// Channel attribute for DMA operations\r
68//\r
69#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_COMPATIBLE 0x001\r
70#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_A 0x002\r
71#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_B 0x004\r
72#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_C 0x008\r
73#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_8 0x010\r
74#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_16 0x020\r
75#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SINGLE_MODE 0x040\r
76#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_DEMAND_MODE 0x080\r
77#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_AUTO_INITIALIZE 0x100\r
78\r
79typedef enum {\r
80 EfiIsaIoOperationBusMasterRead,\r
81 EfiIsaIoOperationBusMasterWrite,\r
82 EfiIsaIoOperationBusMasterCommonBuffer,\r
83 EfiIsaIoOperationSlaveRead,\r
84 EfiIsaIoOperationSlaveWrite,\r
85 EfiIsaIoOperationMaximum\r
86} EFI_ISA_IO_PROTOCOL_OPERATION;\r
87\r
88typedef\r
89EFI_STATUS\r
90(EFIAPI *EFI_ISA_IO_PROTOCOL_IO_MEM) (\r
91 IN EFI_ISA_IO_PROTOCOL *This,\r
92 IN EFI_ISA_IO_PROTOCOL_WIDTH Width,\r
93 IN UINT32 Offset,\r
94 IN UINTN Count,\r
95 IN OUT VOID *Buffer\r
96 );\r
97\r
98typedef struct {\r
99 EFI_ISA_IO_PROTOCOL_IO_MEM Read;\r
100 EFI_ISA_IO_PROTOCOL_IO_MEM Write;\r
101} EFI_ISA_IO_PROTOCOL_ACCESS;\r
102\r
103typedef\r
104EFI_STATUS\r
105(EFIAPI *EFI_ISA_IO_PROTOCOL_COPY_MEM) (\r
106 IN EFI_ISA_IO_PROTOCOL *This,\r
107 IN EFI_ISA_IO_PROTOCOL_WIDTH Width,\r
108 IN UINT32 DestOffset,\r
109 IN UINT32 SrcOffset,\r
110 IN UINTN Count\r
111 );\r
112\r
113typedef\r
114EFI_STATUS\r
115(EFIAPI *EFI_ISA_IO_PROTOCOL_MAP) (\r
116 IN EFI_ISA_IO_PROTOCOL *This,\r
117 IN EFI_ISA_IO_PROTOCOL_OPERATION Operation,\r
118 IN UINT8 ChannelNumber OPTIONAL,\r
119 IN UINT32 ChannelAttributes,\r
120 IN VOID *HostAddress,\r
121 IN OUT UINTN *NumberOfBytes,\r
122 OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,\r
123 OUT VOID **Mapping\r
124 );\r
125\r
126typedef\r
127EFI_STATUS\r
128(EFIAPI *EFI_ISA_IO_PROTOCOL_UNMAP) (\r
129 IN EFI_ISA_IO_PROTOCOL *This,\r
130 IN VOID *Mapping\r
131 );\r
132\r
133typedef\r
134EFI_STATUS\r
135(EFIAPI *EFI_ISA_IO_PROTOCOL_ALLOCATE_BUFFER) (\r
136 IN EFI_ISA_IO_PROTOCOL *This,\r
137 IN EFI_ALLOCATE_TYPE Type,\r
138 IN EFI_MEMORY_TYPE MemoryType,\r
139 IN UINTN Pages,\r
140 OUT VOID **HostAddress,\r
141 IN UINT64 Attributes\r
142 );\r
143\r
144typedef\r
145EFI_STATUS\r
146(EFIAPI *EFI_ISA_IO_PROTOCOL_FREE_BUFFER) (\r
147 IN EFI_ISA_IO_PROTOCOL *This,\r
148 IN UINTN Pages,\r
149 IN VOID *HostAddress\r
150 );\r
151\r
152typedef\r
153EFI_STATUS\r
154(EFIAPI *EFI_ISA_IO_PROTOCOL_FLUSH) (\r
155 IN EFI_ISA_IO_PROTOCOL *This\r
156 );\r
157\r
158//\r
159// Interface structure for the ISA I/O Protocol\r
160//\r
161struct _EFI_ISA_IO_PROTOCOL {\r
162 EFI_ISA_IO_PROTOCOL_ACCESS Mem;\r
163 EFI_ISA_IO_PROTOCOL_ACCESS Io;\r
164 EFI_ISA_IO_PROTOCOL_COPY_MEM CopyMem;\r
165 EFI_ISA_IO_PROTOCOL_MAP Map;\r
166 EFI_ISA_IO_PROTOCOL_UNMAP Unmap;\r
167 EFI_ISA_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer;\r
168 EFI_ISA_IO_PROTOCOL_FREE_BUFFER FreeBuffer;\r
169 EFI_ISA_IO_PROTOCOL_FLUSH Flush;\r
170 EFI_ISA_ACPI_RESOURCE_LIST *ResourceList;\r
171 UINT32 RomSize;\r
172 VOID *RomImage;\r
173};\r
174\r
175extern EFI_GUID gEfiIsaIoProtocolGuid;\r
176\r
177#endif\r