Rev 1498 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1498 | serge | 1 | |
2 | * |
||
3 | * Module Name: aslrestype2q - Large QWord address resource descriptors |
||
4 | * |
||
5 | *****************************************************************************/ |
||
6 | |||
7 | |||
8 | * |
||
9 | * 1. Copyright Notice |
||
10 | * |
||
11 | * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
||
2216 | Serge | 12 | * All rights reserved. |
1498 | serge | 13 | * |
14 | * 2. License |
||
15 | * |
||
16 | * 2.1. This is your license from Intel Corp. under its intellectual property |
||
17 | * rights. You may have additional license terms from the party that provided |
||
18 | * you this software, covering your right to use that party's intellectual |
||
19 | * property rights. |
||
20 | * |
||
21 | * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a |
||
22 | * copy of the source code appearing in this file ("Covered Code") an |
||
23 | * irrevocable, perpetual, worldwide license under Intel's copyrights in the |
||
24 | * base code distributed originally by Intel ("Original Intel Code") to copy, |
||
25 | * make derivatives, distribute, use and display any portion of the Covered |
||
26 | * Code in any form, with the right to sublicense such rights; and |
||
27 | * |
||
28 | * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent |
||
29 | * license (with the right to sublicense), under only those claims of Intel |
||
30 | * patents that are infringed by the Original Intel Code, to make, use, sell, |
||
31 | * offer to sell, and import the Covered Code and derivative works thereof |
||
32 | * solely to the minimum extent necessary to exercise the above copyright |
||
33 | * license, and in no event shall the patent license extend to any additions |
||
34 | * to or modifications of the Original Intel Code. No other license or right |
||
35 | * is granted directly or by implication, estoppel or otherwise; |
||
36 | * |
||
37 | * The above copyright and patent license is granted only if the following |
||
38 | * conditions are met: |
||
39 | * |
||
40 | * 3. Conditions |
||
41 | * |
||
42 | * 3.1. Redistribution of Source with Rights to Further Distribute Source. |
||
43 | * Redistribution of source code of any substantial portion of the Covered |
||
44 | * Code or modification with rights to further distribute source must include |
||
45 | * the above Copyright Notice, the above License, this list of Conditions, |
||
46 | * and the following Disclaimer and Export Compliance provision. In addition, |
||
47 | * Licensee must cause all Covered Code to which Licensee contributes to |
||
48 | * contain a file documenting the changes Licensee made to create that Covered |
||
49 | * Code and the date of any change. Licensee must include in that file the |
||
50 | * documentation of any changes made by any predecessor Licensee. Licensee |
||
51 | * must include a prominent statement that the modification is derived, |
||
52 | * directly or indirectly, from Original Intel Code. |
||
53 | * |
||
54 | * 3.2. Redistribution of Source with no Rights to Further Distribute Source. |
||
55 | * Redistribution of source code of any substantial portion of the Covered |
||
56 | * Code or modification without rights to further distribute source must |
||
57 | * include the following Disclaimer and Export Compliance provision in the |
||
58 | * documentation and/or other materials provided with distribution. In |
||
59 | * addition, Licensee may not authorize further sublicense of source of any |
||
60 | * portion of the Covered Code, and must include terms to the effect that the |
||
61 | * license from Licensee to its licensee is limited to the intellectual |
||
62 | * property embodied in the software Licensee provides to its licensee, and |
||
63 | * not to intellectual property embodied in modifications its licensee may |
||
64 | * make. |
||
65 | * |
||
66 | * 3.3. Redistribution of Executable. Redistribution in executable form of any |
||
67 | * substantial portion of the Covered Code or modification must reproduce the |
||
68 | * above Copyright Notice, and the following Disclaimer and Export Compliance |
||
69 | * provision in the documentation and/or other materials provided with the |
||
70 | * distribution. |
||
71 | * |
||
72 | * 3.4. Intel retains all right, title, and interest in and to the Original |
||
73 | * Intel Code. |
||
74 | * |
||
75 | * 3.5. Neither the name Intel nor any other trademark owned or controlled by |
||
76 | * Intel shall be used in advertising or otherwise to promote the sale, use or |
||
77 | * other dealings in products derived from or relating to the Covered Code |
||
78 | * without prior written authorization from Intel. |
||
79 | * |
||
80 | * 4. Disclaimer and Export Compliance |
||
81 | * |
||
82 | * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED |
||
83 | * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE |
||
84 | * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, |
||
85 | * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY |
||
86 | * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY |
||
87 | * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A |
||
88 | * PARTICULAR PURPOSE. |
||
89 | * |
||
90 | * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES |
||
91 | * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR |
||
92 | * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, |
||
93 | * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY |
||
94 | * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL |
||
95 | * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS |
||
96 | * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY |
||
97 | * LIMITED REMEDY. |
||
98 | * |
||
99 | * 4.3. Licensee shall not export, either directly or indirectly, any of this |
||
100 | * software or system incorporating such software without first obtaining any |
||
101 | * required license or other approval from the U. S. Department of Commerce or |
||
102 | * any other agency or department of the United States Government. In the |
||
103 | * event Licensee exports any such software from the United States or |
||
104 | * re-exports any such software from a foreign destination, Licensee shall |
||
105 | * ensure that the distribution and export/re-export of the software is in |
||
106 | * compliance with all laws, regulations, orders, or other restrictions of the |
||
107 | * U.S. Export Administration Regulations. Licensee agrees that neither it nor |
||
108 | * any of its subsidiaries will export/re-export any technical data, process, |
||
109 | * software, or service, directly or indirectly, to any country for which the |
||
110 | * United States government or any agency thereof requires an export license, |
||
111 | * other governmental approval, or letter of assurance, without first obtaining |
||
112 | * such license, approval or letter. |
||
113 | * |
||
114 | *****************************************************************************/ |
||
115 | |||
116 | |||
117 | |||
118 | #include "aslcompiler.y.h" |
||
119 | |||
120 | |||
121 | ACPI_MODULE_NAME ("aslrestype2q") |
||
122 | |||
123 | |||
124 | * This module contains the QWord (64-bit) address space descriptors: |
||
125 | * |
||
126 | * QWordIO |
||
127 | * QWordMemory |
||
128 | * QWordSpace |
||
129 | */ |
||
130 | |||
131 | |||
132 | * |
||
133 | * FUNCTION: RsDoQwordIoDescriptor |
||
134 | * |
||
135 | * PARAMETERS: Op - Parent resource descriptor parse node |
||
136 | * CurrentByteOffset - Offset into the resource template AML |
||
137 | * buffer (to track references to the desc) |
||
138 | * |
||
139 | * RETURN: Completed resource node |
||
140 | * |
||
141 | * DESCRIPTION: Construct a long "QwordIO" descriptor |
||
142 | * |
||
143 | ******************************************************************************/ |
||
144 | |||
145 | |||
146 | RsDoQwordIoDescriptor ( |
||
147 | ACPI_PARSE_OBJECT *Op, |
||
148 | UINT32 CurrentByteOffset) |
||
149 | { |
||
150 | AML_RESOURCE *Descriptor; |
||
151 | ACPI_PARSE_OBJECT *InitializerOp; |
||
152 | ACPI_PARSE_OBJECT *MinOp = NULL; |
||
153 | ACPI_PARSE_OBJECT *MaxOp = NULL; |
||
154 | ACPI_PARSE_OBJECT *LengthOp = NULL; |
||
155 | ACPI_PARSE_OBJECT *GranOp = NULL; |
||
156 | ASL_RESOURCE_NODE *Rnode; |
||
157 | UINT8 *OptionalFields; |
||
158 | UINT16 StringLength = 0; |
||
159 | UINT32 OptionIndex = 0; |
||
160 | UINT32 i; |
||
161 | BOOLEAN ResSourceIndex = FALSE; |
||
162 | |||
163 | |||
164 | |||
165 | StringLength = RsGetStringDataLength (InitializerOp); |
||
166 | |||
167 | |||
168 | sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength); |
||
169 | |||
170 | |||
171 | Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64; |
||
172 | Descriptor->Address64.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE; |
||
173 | |||
174 | |||
175 | * Initial descriptor length -- may be enlarged if there are |
||
176 | * optional fields present |
||
177 | */ |
||
178 | OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64); |
||
179 | Descriptor->Address64.ResourceLength = (UINT16) |
||
180 | (sizeof (AML_RESOURCE_ADDRESS64) - |
||
181 | sizeof (AML_RESOURCE_LARGE_HEADER)); |
||
182 | |||
183 | |||
184 | |||
185 | |||
186 | { |
||
187 | switch (i) |
||
188 | { |
||
189 | case 0: /* Resource Usage */ |
||
190 | |||
191 | |||
192 | break; |
||
193 | |||
194 | |||
195 | |||
196 | |||
197 | RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE, |
||
198 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 2); |
||
199 | break; |
||
200 | |||
201 | |||
202 | |||
203 | |||
204 | RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE, |
||
205 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 3); |
||
206 | break; |
||
207 | |||
208 | |||
209 | |||
210 | |||
211 | RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE, |
||
212 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 1); |
||
213 | break; |
||
214 | |||
215 | |||
216 | |||
217 | |||
218 | RsCreateBitField (InitializerOp, ACPI_RESTAG_RANGETYPE, |
||
219 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 0); |
||
220 | break; |
||
221 | |||
222 | |||
223 | |||
224 | |||
225 | RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY, |
||
226 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity)); |
||
227 | GranOp = InitializerOp; |
||
228 | break; |
||
229 | |||
230 | |||
231 | |||
232 | |||
233 | RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, |
||
234 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum)); |
||
235 | MinOp = InitializerOp; |
||
236 | break; |
||
237 | |||
238 | |||
239 | |||
240 | |||
241 | RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, |
||
242 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum)); |
||
243 | MaxOp = InitializerOp; |
||
244 | break; |
||
245 | |||
246 | |||
247 | |||
248 | |||
249 | RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION, |
||
250 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset)); |
||
251 | break; |
||
252 | |||
253 | |||
254 | |||
255 | |||
256 | RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, |
||
257 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength)); |
||
258 | LengthOp = InitializerOp; |
||
259 | break; |
||
260 | |||
261 | |||
262 | |||
263 | |||
264 | { |
||
265 | OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer; |
||
266 | OptionIndex++; |
||
267 | Descriptor->Address64.ResourceLength++; |
||
268 | ResSourceIndex = TRUE; |
||
269 | } |
||
270 | break; |
||
271 | |||
272 | |||
273 | |||
274 | |||
275 | (InitializerOp->Asl.Value.String)) |
||
276 | { |
||
277 | if (StringLength) |
||
278 | { |
||
279 | Descriptor->Address64.ResourceLength = (UINT16) |
||
280 | (Descriptor->Address64.ResourceLength + StringLength); |
||
281 | |||
282 | |||
283 | &OptionalFields[OptionIndex], |
||
284 | InitializerOp->Asl.Value.String); |
||
285 | |||
286 | |||
287 | |||
288 | |||
289 | { |
||
290 | AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX, |
||
291 | InitializerOp, NULL); |
||
292 | } |
||
293 | } |
||
294 | } |
||
295 | |||
296 | |||
297 | /* |
||
298 | * Not a valid ResourceSource, ResourceSourceIndex must also |
||
299 | * be invalid |
||
300 | */ |
||
301 | else if (ResSourceIndex) |
||
302 | { |
||
303 | AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE, |
||
304 | InitializerOp, NULL); |
||
305 | } |
||
306 | #endif |
||
307 | break; |
||
308 | |||
309 | |||
310 | |||
311 | |||
312 | break; |
||
313 | |||
314 | |||
315 | |||
316 | |||
317 | RsCreateBitField (InitializerOp, ACPI_RESTAG_TYPE, |
||
318 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 4); |
||
319 | break; |
||
320 | |||
321 | |||
322 | |||
323 | |||
324 | RsCreateBitField (InitializerOp, ACPI_RESTAG_TRANSTYPE, |
||
325 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 5); |
||
326 | break; |
||
327 | |||
328 | |||
329 | |||
330 | |||
331 | break; |
||
332 | } |
||
333 | |||
334 | |||
335 | } |
||
336 | |||
337 | |||
338 | |||
339 | |||
340 | Descriptor->Address64.Minimum, |
||
341 | Descriptor->Address64.Maximum, |
||
342 | Descriptor->Address64.AddressLength, |
||
343 | Descriptor->Address64.Granularity, |
||
344 | Descriptor->Address64.Flags, |
||
345 | MinOp, MaxOp, LengthOp, GranOp, Op); |
||
2216 | Serge | 346 | |
1498 | serge | 347 | |
348 | OptionIndex + StringLength; |
||
349 | return (Rnode); |
||
350 | } |
||
351 | |||
352 | |||
353 | |||
354 | * |
||
355 | * FUNCTION: RsDoQwordMemoryDescriptor |
||
356 | * |
||
357 | * PARAMETERS: Op - Parent resource descriptor parse node |
||
358 | * CurrentByteOffset - Offset into the resource template AML |
||
359 | * buffer (to track references to the desc) |
||
360 | * |
||
361 | * RETURN: Completed resource node |
||
362 | * |
||
363 | * DESCRIPTION: Construct a long "QwordMemory" descriptor |
||
364 | * |
||
365 | ******************************************************************************/ |
||
366 | |||
367 | |||
368 | RsDoQwordMemoryDescriptor ( |
||
369 | ACPI_PARSE_OBJECT *Op, |
||
370 | UINT32 CurrentByteOffset) |
||
371 | { |
||
372 | AML_RESOURCE *Descriptor; |
||
373 | ACPI_PARSE_OBJECT *InitializerOp; |
||
374 | ACPI_PARSE_OBJECT *MinOp = NULL; |
||
375 | ACPI_PARSE_OBJECT *MaxOp = NULL; |
||
376 | ACPI_PARSE_OBJECT *LengthOp = NULL; |
||
377 | ACPI_PARSE_OBJECT *GranOp = NULL; |
||
378 | ASL_RESOURCE_NODE *Rnode; |
||
379 | UINT8 *OptionalFields; |
||
380 | UINT16 StringLength = 0; |
||
381 | UINT32 OptionIndex = 0; |
||
382 | UINT32 i; |
||
383 | BOOLEAN ResSourceIndex = FALSE; |
||
384 | |||
385 | |||
386 | |||
387 | StringLength = RsGetStringDataLength (InitializerOp); |
||
388 | |||
389 | |||
390 | sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength); |
||
391 | |||
392 | |||
393 | Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64; |
||
394 | Descriptor->Address64.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE; |
||
395 | |||
396 | |||
397 | * Initial descriptor length -- may be enlarged if there are |
||
398 | * optional fields present |
||
399 | */ |
||
400 | OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64); |
||
401 | Descriptor->Address64.ResourceLength = (UINT16) |
||
402 | (sizeof (AML_RESOURCE_ADDRESS64) - |
||
403 | sizeof (AML_RESOURCE_LARGE_HEADER)); |
||
404 | |||
405 | |||
406 | |||
407 | |||
408 | { |
||
409 | switch (i) |
||
410 | { |
||
411 | case 0: /* Resource Usage */ |
||
412 | |||
413 | |||
414 | break; |
||
415 | |||
416 | |||
417 | |||
418 | |||
419 | RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE, |
||
420 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 1); |
||
421 | break; |
||
422 | |||
423 | |||
424 | |||
425 | |||
426 | RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE, |
||
427 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 2); |
||
428 | break; |
||
429 | |||
430 | |||
431 | |||
432 | |||
433 | RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE, |
||
434 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 3); |
||
435 | break; |
||
436 | |||
437 | |||
438 | |||
439 | |||
440 | RsCreateBitField (InitializerOp, ACPI_RESTAG_MEMTYPE, |
||
441 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 1); |
||
442 | break; |
||
443 | |||
444 | |||
445 | |||
446 | |||
447 | RsCreateBitField (InitializerOp, ACPI_RESTAG_READWRITETYPE, |
||
448 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 0); |
||
449 | break; |
||
450 | |||
451 | |||
452 | |||
453 | |||
454 | RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY, |
||
455 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity)); |
||
456 | GranOp = InitializerOp; |
||
457 | break; |
||
458 | |||
459 | |||
460 | |||
461 | |||
462 | RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, |
||
463 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum)); |
||
464 | MinOp = InitializerOp; |
||
465 | break; |
||
466 | |||
467 | |||
468 | |||
469 | |||
470 | RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, |
||
471 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum)); |
||
472 | MaxOp = InitializerOp; |
||
473 | break; |
||
474 | |||
475 | |||
476 | |||
477 | |||
478 | RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION, |
||
479 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset)); |
||
480 | break; |
||
481 | |||
482 | |||
483 | |||
484 | |||
485 | RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, |
||
486 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength)); |
||
487 | LengthOp = InitializerOp; |
||
488 | break; |
||
489 | |||
490 | |||
491 | |||
492 | |||
493 | { |
||
494 | OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer; |
||
495 | OptionIndex++; |
||
496 | Descriptor->Address64.ResourceLength++; |
||
497 | ResSourceIndex = TRUE; |
||
498 | } |
||
499 | break; |
||
500 | |||
501 | |||
502 | |||
503 | |||
504 | (InitializerOp->Asl.Value.String)) |
||
505 | { |
||
506 | if (StringLength) |
||
507 | { |
||
508 | Descriptor->Address64.ResourceLength = (UINT16) |
||
509 | (Descriptor->Address64.ResourceLength + StringLength); |
||
510 | |||
511 | |||
512 | &OptionalFields[OptionIndex], |
||
513 | InitializerOp->Asl.Value.String); |
||
514 | |||
515 | |||
516 | |||
517 | |||
518 | { |
||
519 | AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX, |
||
520 | InitializerOp, NULL); |
||
521 | } |
||
522 | } |
||
523 | } |
||
524 | |||
525 | |||
526 | /* |
||
527 | * Not a valid ResourceSource, ResourceSourceIndex must also |
||
528 | * be invalid |
||
529 | */ |
||
530 | else if (ResSourceIndex) |
||
531 | { |
||
532 | AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE, |
||
533 | InitializerOp, NULL); |
||
534 | } |
||
535 | #endif |
||
536 | break; |
||
537 | |||
538 | |||
539 | |||
540 | |||
541 | break; |
||
542 | |||
543 | |||
544 | |||
545 | |||
546 | |||
547 | RsCreateBitField (InitializerOp, ACPI_RESTAG_MEMATTRIBUTES, |
||
548 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 3); |
||
549 | break; |
||
550 | |||
551 | |||
552 | |||
553 | |||
554 | RsCreateBitField (InitializerOp, ACPI_RESTAG_TYPE, |
||
555 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 5); |
||
556 | break; |
||
557 | |||
558 | |||
559 | |||
560 | |||
561 | break; |
||
562 | } |
||
563 | |||
564 | |||
565 | } |
||
566 | |||
567 | |||
568 | |||
569 | |||
570 | Descriptor->Address64.Minimum, |
||
571 | Descriptor->Address64.Maximum, |
||
572 | Descriptor->Address64.AddressLength, |
||
573 | Descriptor->Address64.Granularity, |
||
574 | Descriptor->Address64.Flags, |
||
575 | MinOp, MaxOp, LengthOp, GranOp, Op); |
||
2216 | Serge | 576 | |
1498 | serge | 577 | |
578 | OptionIndex + StringLength; |
||
579 | return (Rnode); |
||
580 | } |
||
581 | |||
582 | |||
583 | |||
584 | * |
||
585 | * FUNCTION: RsDoQwordSpaceDescriptor |
||
586 | * |
||
587 | * PARAMETERS: Op - Parent resource descriptor parse node |
||
588 | * CurrentByteOffset - Offset into the resource template AML |
||
589 | * buffer (to track references to the desc) |
||
590 | * |
||
591 | * RETURN: Completed resource node |
||
592 | * |
||
593 | * DESCRIPTION: Construct a long "QwordSpace" descriptor |
||
594 | * |
||
595 | ******************************************************************************/ |
||
596 | |||
597 | |||
598 | RsDoQwordSpaceDescriptor ( |
||
599 | ACPI_PARSE_OBJECT *Op, |
||
600 | UINT32 CurrentByteOffset) |
||
601 | { |
||
602 | AML_RESOURCE *Descriptor; |
||
603 | ACPI_PARSE_OBJECT *InitializerOp; |
||
604 | ACPI_PARSE_OBJECT *MinOp = NULL; |
||
605 | ACPI_PARSE_OBJECT *MaxOp = NULL; |
||
606 | ACPI_PARSE_OBJECT *LengthOp = NULL; |
||
607 | ACPI_PARSE_OBJECT *GranOp = NULL; |
||
608 | ASL_RESOURCE_NODE *Rnode; |
||
609 | UINT8 *OptionalFields; |
||
610 | UINT16 StringLength = 0; |
||
611 | UINT32 OptionIndex = 0; |
||
612 | UINT32 i; |
||
613 | BOOLEAN ResSourceIndex = FALSE; |
||
614 | |||
615 | |||
616 | |||
617 | StringLength = RsGetStringDataLength (InitializerOp); |
||
618 | |||
619 | |||
620 | sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength); |
||
621 | |||
622 | |||
623 | Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64; |
||
624 | |||
625 | |||
626 | * Initial descriptor length -- may be enlarged if there are |
||
627 | * optional fields present |
||
628 | */ |
||
629 | OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64); |
||
630 | Descriptor->Address64.ResourceLength = (UINT16) |
||
631 | (sizeof (AML_RESOURCE_ADDRESS64) - |
||
632 | sizeof (AML_RESOURCE_LARGE_HEADER)); |
||
633 | |||
634 | |||
635 | |||
636 | |||
637 | { |
||
638 | switch (i) |
||
639 | { |
||
640 | case 0: /* Resource Type */ |
||
641 | |||
642 | |||
643 | (UINT8) InitializerOp->Asl.Value.Integer; |
||
644 | break; |
||
645 | |||
646 | |||
647 | |||
648 | |||
649 | break; |
||
650 | |||
651 | |||
652 | |||
653 | |||
654 | RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE, |
||
655 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 1); |
||
656 | break; |
||
657 | |||
658 | |||
659 | |||
660 | |||
661 | RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE, |
||
662 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 2); |
||
663 | break; |
||
664 | |||
665 | |||
666 | |||
667 | |||
668 | RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE, |
||
669 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 3); |
||
670 | break; |
||
671 | |||
672 | |||
673 | |||
674 | |||
675 | (UINT8) InitializerOp->Asl.Value.Integer; |
||
676 | break; |
||
677 | |||
678 | |||
679 | |||
680 | |||
681 | RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY, |
||
682 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity)); |
||
683 | GranOp = InitializerOp; |
||
684 | break; |
||
685 | |||
686 | |||
687 | |||
688 | |||
689 | RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, |
||
690 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum)); |
||
691 | MinOp = InitializerOp; |
||
692 | break; |
||
693 | |||
694 | |||
695 | |||
696 | |||
697 | RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, |
||
698 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum)); |
||
699 | MaxOp = InitializerOp; |
||
700 | break; |
||
701 | |||
702 | |||
703 | |||
704 | |||
705 | RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION, |
||
706 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset)); |
||
707 | break; |
||
708 | |||
709 | |||
710 | |||
711 | |||
712 | RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, |
||
713 | CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength)); |
||
714 | LengthOp = InitializerOp; |
||
715 | break; |
||
716 | |||
717 | |||
718 | |||
719 | |||
720 | { |
||
721 | OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer; |
||
722 | OptionIndex++; |
||
723 | Descriptor->Address64.ResourceLength++; |
||
724 | ResSourceIndex = TRUE; |
||
725 | } |
||
726 | break; |
||
727 | |||
728 | |||
729 | |||
730 | |||
731 | (InitializerOp->Asl.Value.String)) |
||
732 | { |
||
733 | if (StringLength) |
||
734 | { |
||
735 | Descriptor->Address64.ResourceLength = (UINT16) |
||
736 | (Descriptor->Address64.ResourceLength + StringLength); |
||
737 | |||
738 | |||
739 | &OptionalFields[OptionIndex], |
||
740 | InitializerOp->Asl.Value.String); |
||
741 | |||
742 | |||
743 | |||
744 | |||
745 | { |
||
746 | AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX, |
||
747 | InitializerOp, NULL); |
||
748 | } |
||
749 | } |
||
750 | } |
||
751 | |||
752 | |||
753 | /* |
||
754 | * Not a valid ResourceSource, ResourceSourceIndex must also |
||
755 | * be invalid |
||
756 | */ |
||
757 | else if (ResSourceIndex) |
||
758 | { |
||
759 | AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE, |
||
760 | InitializerOp, NULL); |
||
761 | } |
||
762 | #endif |
||
763 | break; |
||
764 | |||
765 | |||
766 | |||
767 | |||
768 | break; |
||
769 | |||
770 | |||
771 | |||
772 | |||
773 | break; |
||
774 | } |
||
775 | |||
776 | |||
777 | } |
||
778 | |||
779 | |||
780 | |||
781 | |||
782 | Descriptor->Address64.Minimum, |
||
783 | Descriptor->Address64.Maximum, |
||
784 | Descriptor->Address64.AddressLength, |
||
785 | Descriptor->Address64.Granularity, |
||
786 | Descriptor->Address64.Flags, |
||
787 | MinOp, MaxOp, LengthOp, GranOp, Op); |
||
2216 | Serge | 788 | |
1498 | serge | 789 | |
790 | OptionIndex + StringLength; |
||
791 | return (Rnode); |
||
792 | } |
||
793 |