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