| Linux kernel & device driver programming |
| [ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] |
1 1
2 /*********************************************
3 *
4 * Module Name: amlresrc.h - AML resource desc
5 *
6 *********************************************
7
8 /*
9 * Copyright (C) 2000 - 2008, Intel Corp.
10 * All rights reserved.
11 *
12 * Redistribution and use in source and binary
13 * modification, are permitted provided that t
14 * are met:
15 * 1. Redistributions of source code must reta
16 * notice, this list of conditions, and the
17 * without modification.
18 * 2. Redistributions in binary form must repr
19 * substantially similar to the "NO WARRANT
20 * ("Disclaimer") and any redistribution mu
21 * including a substantially similar Discla
22 * binary redistribution.
23 * 3. Neither the names of the above-listed co
24 * of any contributors may be used to endor
25 * from this software without specific prio
26 *
27 * Alternatively, this software may be distrib
28 * GNU General Public License ("GPL") version
29 * Software Foundation.
30 *
31 * NO WARRANTY
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
33 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTI
34 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCH
35 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
36 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECI
37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PRO
38 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILI
40 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIG
41 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42 * POSSIBILITY OF SUCH DAMAGES.
43 */
44
45 /* acpisrc:struct_defs -- for acpisrc conversi
46
47 #ifndef __AMLRESRC_H
48 #define __AMLRESRC_H
49
50 /*
51 * Resource descriptor tags, as defined in the
52 * Used to symbolically reference fields withi
53 */
54 #define ACPI_RESTAG_ADDRESS
55 #define ACPI_RESTAG_ALIGNMENT
56 #define ACPI_RESTAG_ADDRESSSPACE
57 #define ACPI_RESTAG_ACCESSSIZE
58 #define ACPI_RESTAG_TYPESPECIFICATTRIBUTES
59 #define ACPI_RESTAG_BASEADDRESS
60 #define ACPI_RESTAG_BUSMASTER
61 #define ACPI_RESTAG_DECODE
62 #define ACPI_RESTAG_DMA
63 #define ACPI_RESTAG_DMATYPE
64 #define ACPI_RESTAG_GRANULARITY
65 #define ACPI_RESTAG_INTERRUPT
66 #define ACPI_RESTAG_INTERRUPTLEVEL
67 #define ACPI_RESTAG_INTERRUPTSHARE
68 #define ACPI_RESTAG_INTERRUPTTYPE
69 #define ACPI_RESTAG_LENGTH
70 #define ACPI_RESTAG_MEMATTRIBUTES
71 #define ACPI_RESTAG_MEMTYPE
72 #define ACPI_RESTAG_MAXADDR
73 #define ACPI_RESTAG_MINADDR
74 #define ACPI_RESTAG_MAXTYPE
75 #define ACPI_RESTAG_MINTYPE
76 #define ACPI_RESTAG_REGISTERBITOFFSET
77 #define ACPI_RESTAG_REGISTERBITWIDTH
78 #define ACPI_RESTAG_RANGETYPE
79 #define ACPI_RESTAG_READWRITETYPE
80 #define ACPI_RESTAG_TRANSLATION
81 #define ACPI_RESTAG_TRANSTYPE
82 #define ACPI_RESTAG_TYPE
83 #define ACPI_RESTAG_XFERTYPE
84
85 /* Default sizes for "small" resource descript
86
87 #define ASL_RDESC_IRQ_SIZE
88 #define ASL_RDESC_DMA_SIZE
89 #define ASL_RDESC_ST_DEPEND_SIZE
90 #define ASL_RDESC_END_DEPEND_SIZE
91 #define ASL_RDESC_IO_SIZE
92 #define ASL_RDESC_FIXED_IO_SIZE
93 #define ASL_RDESC_END_TAG_SIZE
94
95 struct asl_resource_node {
96 u32 buffer_length;
97 void *buffer;
98 struct asl_resource_node *next;
99 };
100
101 /* Macros used to generate AML resource length
102
103 #define ACPI_AML_SIZE_LARGE(r) (sizeof (r
104 #define ACPI_AML_SIZE_SMALL(r) (sizeof (r
105
106 /*
107 * Resource descriptors defined in the ACPI sp
108 *
109 * Packing/alignment must be BYTE because thes
110 * are used to overlay the raw AML byte stream
111 */
112 #pragma pack(1)
113
114 /*
115 * SMALL descriptors
116 */
117 #define AML_RESOURCE_SMALL_HEADER_COMMON \
118 u8 descri
119
120 struct aml_resource_small_header {
121 AML_RESOURCE_SMALL_HEADER_COMMON};
122
123 struct aml_resource_irq {
124 AML_RESOURCE_SMALL_HEADER_COMMON u16 i
125 u8 flags;
126 };
127
128 struct aml_resource_irq_noflags {
129 AML_RESOURCE_SMALL_HEADER_COMMON u16 i
130 };
131
132 struct aml_resource_dma {
133 AML_RESOURCE_SMALL_HEADER_COMMON u8 dm
134 u8 flags;
135 };
136
137 struct aml_resource_start_dependent {
138 AML_RESOURCE_SMALL_HEADER_COMMON u8 fl
139 };
140
141 struct aml_resource_start_dependent_noprio {
142 AML_RESOURCE_SMALL_HEADER_COMMON};
143
144 struct aml_resource_end_dependent {
145 AML_RESOURCE_SMALL_HEADER_COMMON};
146
147 struct aml_resource_io {
148 AML_RESOURCE_SMALL_HEADER_COMMON u8 fl
149 u16 minimum;
150 u16 maximum;
151 u8 alignment;
152 u8 address_length;
153 };
154
155 struct aml_resource_fixed_io {
156 AML_RESOURCE_SMALL_HEADER_COMMON u16 a
157 u8 address_length;
158 };
159
160 struct aml_resource_vendor_small {
161 AML_RESOURCE_SMALL_HEADER_COMMON};
162
163 struct aml_resource_end_tag {
164 AML_RESOURCE_SMALL_HEADER_COMMON u8 ch
165 };
166
167 /*
168 * LARGE descriptors
169 */
170 #define AML_RESOURCE_LARGE_HEADER_COMMON \
171 u8 descri
172 u16 resour
173
174 struct aml_resource_large_header {
175 AML_RESOURCE_LARGE_HEADER_COMMON};
176
177 struct aml_resource_memory24 {
178 AML_RESOURCE_LARGE_HEADER_COMMON u8 fl
179 u16 minimum;
180 u16 maximum;
181 u16 alignment;
182 u16 address_length;
183 };
184
185 struct aml_resource_vendor_large {
186 AML_RESOURCE_LARGE_HEADER_COMMON};
187
188 struct aml_resource_memory32 {
189 AML_RESOURCE_LARGE_HEADER_COMMON u8 fl
190 u32 minimum;
191 u32 maximum;
192 u32 alignment;
193 u32 address_length;
194 };
195
196 struct aml_resource_fixed_memory32 {
197 AML_RESOURCE_LARGE_HEADER_COMMON u8 fl
198 u32 address;
199 u32 address_length;
200 };
201
202 #define AML_RESOURCE_ADDRESS_COMMON \
203 u8 resour
204 u8 flags;
205 u8 specif
206
207 struct aml_resource_address {
208 AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_
209
210 struct aml_resource_extended_address64 {
211 AML_RESOURCE_LARGE_HEADER_COMMON
212 AML_RESOURCE_ADDRESS_COMMON u8 rev
213 u8 reserved;
214 u64 granularity;
215 u64 minimum;
216 u64 maximum;
217 u64 translation_offset;
218 u64 address_length;
219 u64 type_specific;
220 };
221
222 #define AML_RESOURCE_EXTENDED_ADDRESS_REVISION
223
224 struct aml_resource_address64 {
225 AML_RESOURCE_LARGE_HEADER_COMMON
226 AML_RESOURCE_ADDRESS_COMMON u64 gr
227 u64 minimum;
228 u64 maximum;
229 u64 translation_offset;
230 u64 address_length;
231 };
232
233 struct aml_resource_address32 {
234 AML_RESOURCE_LARGE_HEADER_COMMON
235 AML_RESOURCE_ADDRESS_COMMON u32 gr
236 u32 minimum;
237 u32 maximum;
238 u32 translation_offset;
239 u32 address_length;
240 };
241
242 struct aml_resource_address16 {
243 AML_RESOURCE_LARGE_HEADER_COMMON
244 AML_RESOURCE_ADDRESS_COMMON u16 gr
245 u16 minimum;
246 u16 maximum;
247 u16 translation_offset;
248 u16 address_length;
249 };
250
251 struct aml_resource_extended_irq {
252 AML_RESOURCE_LARGE_HEADER_COMMON u8 fl
253 u8 interrupt_count;
254 u32 interrupts[1];
255 /* res_source_index, res_source option
256 };
257
258 struct aml_resource_generic_register {
259 AML_RESOURCE_LARGE_HEADER_COMMON u8 ad
260 u8 bit_width;
261 u8 bit_offset;
262 u8 access_size; /* ACPI 3.0, w
263 u64 address;
264 };
265
266 /* restore default alignment */
267
268 #pragma pack()
269
270 /* Union of all resource descriptors, so we ca
271
272 union aml_resource {
273 /* Descriptor headers */
274
275 u8 descriptor_type;
276 struct aml_resource_small_header small
277 struct aml_resource_large_header large
278
279 /* Small resource descriptors */
280
281 struct aml_resource_irq irq;
282 struct aml_resource_dma dma;
283 struct aml_resource_start_dependent st
284 struct aml_resource_end_dependent end_
285 struct aml_resource_io io;
286 struct aml_resource_fixed_io fixed_io;
287 struct aml_resource_vendor_small vendo
288 struct aml_resource_end_tag end_tag;
289
290 /* Large resource descriptors */
291
292 struct aml_resource_memory24 memory24;
293 struct aml_resource_generic_register g
294 struct aml_resource_vendor_large vendo
295 struct aml_resource_memory32 memory32;
296 struct aml_resource_fixed_memory32 fix
297 struct aml_resource_address16 address1
298 struct aml_resource_address32 address3
299 struct aml_resource_address64 address6
300 struct aml_resource_extended_address64
301 struct aml_resource_extended_irq exten
302
303 /* Utility overlays */
304
305 struct aml_resource_address address;
306 u32 dword_item;
307 u16 word_item;
308 u8 byte_item;
309 };
310
311 #endif
312
| This page was automatically generated by the LXR engine. |