aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/resources
diff options
context:
space:
mode:
authorRobert Moore <robert.moore@intel.com>2005-04-18 22:49:35 -0400
committerLen Brown <len.brown@intel.com>2005-07-12 00:08:52 -0400
commit44f6c01242da4e162f28d8e1216a8c7a91174605 (patch)
tree53f724764f1bd9036dfb049a643d198125cc9edc /drivers/acpi/resources
parentebb6e1a6122fd6b7c96470cfd4ce0f04150e5084 (diff)
ACPICA 20050408 from Bob Moore
Fixed three cases in the interpreter where an "index" argument to an ASL function was still (internally) 32 bits instead of the required 64 bits. This was the Index argument to the Index, Mid, and Match operators. The "strupr" function is now permanently local (acpi_ut_strupr), since this is not a POSIX-defined function and not present in most kernel-level C libraries. References to the C library strupr function have been removed from the headers. Completed the deployment of static functions/prototypes. All prototypes with the static attribute have been moved from the headers to the owning C file. ACPICA 20050329 from Bob Moore An error is now generated if an attempt is made to create a Buffer Field of length zero (A CreateField with a length operand of zero.) The interpreter now issues a warning whenever executable code at the module level is detected during ACPI table load. This will give some idea of the prevalence of this type of code. Implemented support for references to named objects (other than control methods) within package objects. Enhanced package object output for the debug object. Package objects are now completely dumped, showing all elements. Enhanced miscellaneous object output for the debug object. Any object can now be written to the debug object (for example, a device object can be written, and the type of the object will be displayed.) The "static" qualifier has been added to all local functions across the core subsystem. The number of "long" lines (> 80 chars) within the source has been significantly reduced, by about 1/3. Cleaned up all header files to ensure that all CA/iASL functions are prototyped (even static functions) and the formatting is consistent. Two new header files have been added, acopcode.h and acnames.h. Removed several obsolete functions that were no longer used. Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/resources')
-rw-r--r--drivers/acpi/resources/rsaddr.c480
-rw-r--r--drivers/acpi/resources/rscalc.c144
-rw-r--r--drivers/acpi/resources/rscreate.c45
-rw-r--r--drivers/acpi/resources/rsdump.c402
-rw-r--r--drivers/acpi/resources/rsio.c197
-rw-r--r--drivers/acpi/resources/rsirq.c167
-rw-r--r--drivers/acpi/resources/rslist.c68
-rw-r--r--drivers/acpi/resources/rsmemory.c236
-rw-r--r--drivers/acpi/resources/rsmisc.c160
-rw-r--r--drivers/acpi/resources/rsutils.c53
-rw-r--r--drivers/acpi/resources/rsxface.c43
11 files changed, 897 insertions, 1098 deletions
diff --git a/drivers/acpi/resources/rsaddr.c b/drivers/acpi/resources/rsaddr.c
index 4788c079735d..55d264771c48 100644
--- a/drivers/acpi/resources/rsaddr.c
+++ b/drivers/acpi/resources/rsaddr.c
@@ -77,21 +77,21 @@ acpi_rs_address16_resource (
77 u8 **output_buffer, 77 u8 **output_buffer,
78 acpi_size *structure_size) 78 acpi_size *structure_size)
79{ 79{
80 u8 *buffer = byte_stream_buffer;
81 struct acpi_resource *output_struct = (void *) *output_buffer;
82 u8 *temp_ptr;
83 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_address16);
84 u32 index; 80 u32 index;
85 u16 temp16; 81 u16 temp16;
86 u8 temp8; 82 u8 temp8;
83 u8 *temp_ptr;
84 u8 *buffer = byte_stream_buffer;
85 struct acpi_resource *output_struct = (void *) *output_buffer;
86 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (
87 struct acpi_resource_address16);
87 88
88 89
89 ACPI_FUNCTION_TRACE ("rs_address16_resource"); 90 ACPI_FUNCTION_TRACE ("rs_address16_resource");
90 91
91 92
92 /* 93 /* Point past the Descriptor to get the number of bytes consumed */
93 * Point past the Descriptor to get the number of bytes consumed 94
94 */
95 buffer += 1; 95 buffer += 1;
96 ACPI_MOVE_16_TO_16 (&temp16, buffer); 96 ACPI_MOVE_16_TO_16 (&temp16, buffer);
97 97
@@ -104,9 +104,8 @@ acpi_rs_address16_resource (
104 *bytes_consumed = temp16 + 3; 104 *bytes_consumed = temp16 + 3;
105 output_struct->id = ACPI_RSTYPE_ADDRESS16; 105 output_struct->id = ACPI_RSTYPE_ADDRESS16;
106 106
107 /* 107 /* Get the Resource Type (Byte3) */
108 * Get the Resource Type (Byte3) 108
109 */
110 buffer += 2; 109 buffer += 2;
111 temp8 = *buffer; 110 temp8 = *buffer;
112 111
@@ -118,9 +117,8 @@ acpi_rs_address16_resource (
118 117
119 output_struct->data.address16.resource_type = temp8; 118 output_struct->data.address16.resource_type = temp8;
120 119
121 /* 120 /* Get the General Flags (Byte4) */
122 * Get the General Flags (Byte4) 121
123 */
124 buffer += 1; 122 buffer += 1;
125 temp8 = *buffer; 123 temp8 = *buffer;
126 124
@@ -140,9 +138,8 @@ acpi_rs_address16_resource (
140 138
141 output_struct->data.address16.max_address_fixed = (temp8 >> 3) & 0x01; 139 output_struct->data.address16.max_address_fixed = (temp8 >> 3) & 0x01;
142 140
143 /* 141 /* Get the Type Specific Flags (Byte5) */
144 * Get the Type Specific Flags (Byte5) 142
145 */
146 buffer += 1; 143 buffer += 1;
147 temp8 = *buffer; 144 temp8 = *buffer;
148 145
@@ -165,39 +162,34 @@ acpi_rs_address16_resource (
165 } 162 }
166 } 163 }
167 164
168 /* 165 /* Get Granularity (Bytes 6-7) */
169 * Get Granularity (Bytes 6-7) 166
170 */
171 buffer += 1; 167 buffer += 1;
172 ACPI_MOVE_16_TO_32 (&output_struct->data.address16.granularity, buffer); 168 ACPI_MOVE_16_TO_32 (&output_struct->data.address16.granularity, buffer);
173 169
174 /* 170 /* Get min_address_range (Bytes 8-9) */
175 * Get min_address_range (Bytes 8-9) 171
176 */
177 buffer += 2; 172 buffer += 2;
178 ACPI_MOVE_16_TO_32 (&output_struct->data.address16.min_address_range, buffer); 173 ACPI_MOVE_16_TO_32 (&output_struct->data.address16.min_address_range, buffer);
179 174
180 /* 175 /* Get max_address_range (Bytes 10-11) */
181 * Get max_address_range (Bytes 10-11) 176
182 */
183 buffer += 2; 177 buffer += 2;
184 ACPI_MOVE_16_TO_32 (&output_struct->data.address16.max_address_range, buffer); 178 ACPI_MOVE_16_TO_32 (&output_struct->data.address16.max_address_range, buffer);
185 179
186 /* 180 /* Get address_translation_offset (Bytes 12-13) */
187 * Get address_translation_offset (Bytes 12-13) 181
188 */
189 buffer += 2; 182 buffer += 2;
190 ACPI_MOVE_16_TO_32 (&output_struct->data.address16.address_translation_offset, buffer); 183 ACPI_MOVE_16_TO_32 (&output_struct->data.address16.address_translation_offset,
184 buffer);
185
186 /* Get address_length (Bytes 14-15) */
191 187
192 /*
193 * Get address_length (Bytes 14-15)
194 */
195 buffer += 2; 188 buffer += 2;
196 ACPI_MOVE_16_TO_32 (&output_struct->data.address16.address_length, buffer); 189 ACPI_MOVE_16_TO_32 (&output_struct->data.address16.address_length, buffer);
197 190
198 /* 191 /* Resource Source Index (if present) */
199 * Resource Source Index (if present) 192
200 */
201 buffer += 2; 193 buffer += 2;
202 194
203 /* 195 /*
@@ -225,7 +217,8 @@ acpi_rs_address16_resource (
225 output_struct->data.address16.resource_source.string_ptr = 217 output_struct->data.address16.resource_source.string_ptr =
226 (char *)((u8 * )output_struct + struct_size); 218 (char *)((u8 * )output_struct + struct_size);
227 219
228 temp_ptr = (u8 *) output_struct->data.address16.resource_source.string_ptr; 220 temp_ptr = (u8 *)
221 output_struct->data.address16.resource_source.string_ptr;
229 222
230 /* Copy the string into the buffer */ 223 /* Copy the string into the buffer */
231 224
@@ -239,9 +232,8 @@ acpi_rs_address16_resource (
239 index += 1; 232 index += 1;
240 } 233 }
241 234
242 /* 235 /* Add the terminating null */
243 * Add the terminating null 236
244 */
245 *temp_ptr = 0x00; 237 *temp_ptr = 0x00;
246 238
247 output_struct->data.address16.resource_source.string_length = index + 1; 239 output_struct->data.address16.resource_source.string_length = index + 1;
@@ -260,14 +252,12 @@ acpi_rs_address16_resource (
260 output_struct->data.address16.resource_source.string_ptr = NULL; 252 output_struct->data.address16.resource_source.string_ptr = NULL;
261 } 253 }
262 254
263 /* 255 /* Set the Length parameter */
264 * Set the Length parameter 256
265 */
266 output_struct->length = (u32) struct_size; 257 output_struct->length = (u32) struct_size;
267 258
268 /* 259 /* Return the final size of the structure */
269 * Return the final size of the structure 260
270 */
271 *structure_size = struct_size; 261 *structure_size = struct_size;
272 return_ACPI_STATUS (AE_OK); 262 return_ACPI_STATUS (AE_OK);
273} 263}
@@ -305,28 +295,24 @@ acpi_rs_address16_stream (
305 ACPI_FUNCTION_TRACE ("rs_address16_stream"); 295 ACPI_FUNCTION_TRACE ("rs_address16_stream");
306 296
307 297
308 /* 298 /* The descriptor field is static */
309 * The descriptor field is static 299
310 */
311 *buffer = 0x88; 300 *buffer = 0x88;
312 buffer += 1; 301 buffer += 1;
313 302
314 /* 303 /* Save a pointer to the Length field - to be filled in later */
315 * Save a pointer to the Length field - to be filled in later 304
316 */
317 length_field = buffer; 305 length_field = buffer;
318 buffer += 2; 306 buffer += 2;
319 307
320 /* 308 /* Set the Resource Type (Memory, Io, bus_number) */
321 * Set the Resource Type (Memory, Io, bus_number) 309
322 */
323 temp8 = (u8) (linked_list->data.address16.resource_type & 0x03); 310 temp8 = (u8) (linked_list->data.address16.resource_type & 0x03);
324 *buffer = temp8; 311 *buffer = temp8;
325 buffer += 1; 312 buffer += 1;
326 313
327 /* 314 /* Set the general flags */
328 * Set the general flags 315
329 */
330 temp8 = (u8) (linked_list->data.address16.producer_consumer & 0x01); 316 temp8 = (u8) (linked_list->data.address16.producer_consumer & 0x01);
331 317
332 temp8 |= (linked_list->data.address16.decode & 0x01) << 1; 318 temp8 |= (linked_list->data.address16.decode & 0x01) << 1;
@@ -336,9 +322,8 @@ acpi_rs_address16_stream (
336 *buffer = temp8; 322 *buffer = temp8;
337 buffer += 1; 323 buffer += 1;
338 324
339 /* 325 /* Set the type specific flags */
340 * Set the type specific flags 326
341 */
342 temp8 = 0; 327 temp8 = 0;
343 328
344 if (ACPI_MEMORY_RANGE == linked_list->data.address16.resource_type) { 329 if (ACPI_MEMORY_RANGE == linked_list->data.address16.resource_type) {
@@ -362,39 +347,34 @@ acpi_rs_address16_stream (
362 *buffer = temp8; 347 *buffer = temp8;
363 buffer += 1; 348 buffer += 1;
364 349
365 /* 350 /* Set the address space granularity */
366 * Set the address space granularity 351
367 */
368 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.granularity); 352 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.granularity);
369 buffer += 2; 353 buffer += 2;
370 354
371 /* 355 /* Set the address range minimum */
372 * Set the address range minimum 356
373 */
374 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.min_address_range); 357 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.min_address_range);
375 buffer += 2; 358 buffer += 2;
376 359
377 /* 360 /* Set the address range maximum */
378 * Set the address range maximum 361
379 */
380 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.max_address_range); 362 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.max_address_range);
381 buffer += 2; 363 buffer += 2;
382 364
383 /* 365 /* Set the address translation offset */
384 * Set the address translation offset 366
385 */ 367 ACPI_MOVE_32_TO_16 (buffer,
386 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.address_translation_offset); 368 &linked_list->data.address16.address_translation_offset);
387 buffer += 2; 369 buffer += 2;
388 370
389 /* 371 /* Set the address length */
390 * Set the address length 372
391 */
392 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.address_length); 373 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.address16.address_length);
393 buffer += 2; 374 buffer += 2;
394 375
395 /* 376 /* Resource Source Index and Resource Source are optional */
396 * Resource Source Index and Resource Source are optional 377
397 */
398 if (0 != linked_list->data.address16.resource_source.string_length) { 378 if (0 != linked_list->data.address16.resource_source.string_length) {
399 temp8 = (u8) linked_list->data.address16.resource_source.index; 379 temp8 = (u8) linked_list->data.address16.resource_source.index;
400 380
@@ -403,9 +383,8 @@ acpi_rs_address16_stream (
403 383
404 temp_pointer = (char *) buffer; 384 temp_pointer = (char *) buffer;
405 385
406 /* 386 /* Copy the string */
407 * Copy the string 387
408 */
409 ACPI_STRCPY (temp_pointer, 388 ACPI_STRCPY (temp_pointer,
410 linked_list->data.address16.resource_source.string_ptr); 389 linked_list->data.address16.resource_source.string_ptr);
411 390
@@ -413,12 +392,12 @@ acpi_rs_address16_stream (
413 * Buffer needs to be set to the length of the sting + one for the 392 * Buffer needs to be set to the length of the sting + one for the
414 * terminating null 393 * terminating null
415 */ 394 */
416 buffer += (acpi_size)(ACPI_STRLEN (linked_list->data.address16.resource_source.string_ptr) + 1); 395 buffer += (acpi_size)(ACPI_STRLEN (
396 linked_list->data.address16.resource_source.string_ptr) + 1);
417 } 397 }
418 398
419 /* 399 /* Return the number of bytes consumed in this operation */
420 * Return the number of bytes consumed in this operation 400
421 */
422 actual_bytes = ACPI_PTR_DIFF (buffer, *output_buffer); 401 actual_bytes = ACPI_PTR_DIFF (buffer, *output_buffer);
423 *bytes_consumed = actual_bytes; 402 *bytes_consumed = actual_bytes;
424 403
@@ -475,9 +454,8 @@ acpi_rs_address32_resource (
475 buffer = byte_stream_buffer; 454 buffer = byte_stream_buffer;
476 struct_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_address32); 455 struct_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_address32);
477 456
478 /* 457 /* Point past the Descriptor to get the number of bytes consumed */
479 * Point past the Descriptor to get the number of bytes consumed 458
480 */
481 buffer += 1; 459 buffer += 1;
482 ACPI_MOVE_16_TO_16 (&temp16, buffer); 460 ACPI_MOVE_16_TO_16 (&temp16, buffer);
483 461
@@ -490,9 +468,8 @@ acpi_rs_address32_resource (
490 *bytes_consumed = temp16 + 3; 468 *bytes_consumed = temp16 + 3;
491 output_struct->id = ACPI_RSTYPE_ADDRESS32; 469 output_struct->id = ACPI_RSTYPE_ADDRESS32;
492 470
493 /* 471 /* Get the Resource Type (Byte3) */
494 * Get the Resource Type (Byte3) 472
495 */
496 buffer += 2; 473 buffer += 2;
497 temp8 = *buffer; 474 temp8 = *buffer;
498 475
@@ -504,35 +481,29 @@ acpi_rs_address32_resource (
504 481
505 output_struct->data.address32.resource_type = temp8; 482 output_struct->data.address32.resource_type = temp8;
506 483
507 /* 484 /* Get the General Flags (Byte4) */
508 * Get the General Flags (Byte4) 485
509 */
510 buffer += 1; 486 buffer += 1;
511 temp8 = *buffer; 487 temp8 = *buffer;
512 488
513 /* 489 /* Producer / Consumer */
514 * Producer / Consumer 490
515 */
516 output_struct->data.address32.producer_consumer = temp8 & 0x01; 491 output_struct->data.address32.producer_consumer = temp8 & 0x01;
517 492
518 /* 493 /* Decode */
519 * Decode 494
520 */
521 output_struct->data.address32.decode = (temp8 >> 1) & 0x01; 495 output_struct->data.address32.decode = (temp8 >> 1) & 0x01;
522 496
523 /* 497 /* Min Address Fixed */
524 * Min Address Fixed 498
525 */
526 output_struct->data.address32.min_address_fixed = (temp8 >> 2) & 0x01; 499 output_struct->data.address32.min_address_fixed = (temp8 >> 2) & 0x01;
527 500
528 /* 501 /* Max Address Fixed */
529 * Max Address Fixed 502
530 */
531 output_struct->data.address32.max_address_fixed = (temp8 >> 3) & 0x01; 503 output_struct->data.address32.max_address_fixed = (temp8 >> 3) & 0x01;
532 504
533 /* 505 /* Get the Type Specific Flags (Byte5) */
534 * Get the Type Specific Flags (Byte5) 506
535 */
536 buffer += 1; 507 buffer += 1;
537 temp8 = *buffer; 508 temp8 = *buffer;
538 509
@@ -556,39 +527,34 @@ acpi_rs_address32_resource (
556 } 527 }
557 } 528 }
558 529
559 /* 530 /* Get Granularity (Bytes 6-9) */
560 * Get Granularity (Bytes 6-9) 531
561 */
562 buffer += 1; 532 buffer += 1;
563 ACPI_MOVE_32_TO_32 (&output_struct->data.address32.granularity, buffer); 533 ACPI_MOVE_32_TO_32 (&output_struct->data.address32.granularity, buffer);
564 534
565 /* 535 /* Get min_address_range (Bytes 10-13) */
566 * Get min_address_range (Bytes 10-13) 536
567 */
568 buffer += 4; 537 buffer += 4;
569 ACPI_MOVE_32_TO_32 (&output_struct->data.address32.min_address_range, buffer); 538 ACPI_MOVE_32_TO_32 (&output_struct->data.address32.min_address_range, buffer);
570 539
571 /* 540 /* Get max_address_range (Bytes 14-17) */
572 * Get max_address_range (Bytes 14-17) 541
573 */
574 buffer += 4; 542 buffer += 4;
575 ACPI_MOVE_32_TO_32 (&output_struct->data.address32.max_address_range, buffer); 543 ACPI_MOVE_32_TO_32 (&output_struct->data.address32.max_address_range, buffer);
576 544
577 /* 545 /* Get address_translation_offset (Bytes 18-21) */
578 * Get address_translation_offset (Bytes 18-21) 546
579 */
580 buffer += 4; 547 buffer += 4;
581 ACPI_MOVE_32_TO_32 (&output_struct->data.address32.address_translation_offset, buffer); 548 ACPI_MOVE_32_TO_32 (&output_struct->data.address32.address_translation_offset,
549 buffer);
550
551 /* Get address_length (Bytes 22-25) */
582 552
583 /*
584 * Get address_length (Bytes 22-25)
585 */
586 buffer += 4; 553 buffer += 4;
587 ACPI_MOVE_32_TO_32 (&output_struct->data.address32.address_length, buffer); 554 ACPI_MOVE_32_TO_32 (&output_struct->data.address32.address_length, buffer);
588 555
589 /* 556 /* Resource Source Index (if present) */
590 * Resource Source Index (if present) 557
591 */
592 buffer += 4; 558 buffer += 4;
593 559
594 /* 560 /*
@@ -615,7 +581,8 @@ acpi_rs_address32_resource (
615 output_struct->data.address32.resource_source.string_ptr = 581 output_struct->data.address32.resource_source.string_ptr =
616 (char *)((u8 *)output_struct + struct_size); 582 (char *)((u8 *)output_struct + struct_size);
617 583
618 temp_ptr = (u8 *) output_struct->data.address32.resource_source.string_ptr; 584 temp_ptr = (u8 *)
585 output_struct->data.address32.resource_source.string_ptr;
619 586
620 /* Copy the string into the buffer */ 587 /* Copy the string into the buffer */
621 588
@@ -628,9 +595,8 @@ acpi_rs_address32_resource (
628 index += 1; 595 index += 1;
629 } 596 }
630 597
631 /* 598 /* Add the terminating null */
632 * Add the terminating null 599
633 */
634 *temp_ptr = 0x00; 600 *temp_ptr = 0x00;
635 output_struct->data.address32.resource_source.string_length = index + 1; 601 output_struct->data.address32.resource_source.string_length = index + 1;
636 602
@@ -648,14 +614,12 @@ acpi_rs_address32_resource (
648 output_struct->data.address32.resource_source.string_ptr = NULL; 614 output_struct->data.address32.resource_source.string_ptr = NULL;
649 } 615 }
650 616
651 /* 617 /* Set the Length parameter */
652 * Set the Length parameter 618
653 */
654 output_struct->length = (u32) struct_size; 619 output_struct->length = (u32) struct_size;
655 620
656 /* 621 /* Return the final size of the structure */
657 * Return the final size of the structure 622
658 */
659 *structure_size = struct_size; 623 *structure_size = struct_size;
660 return_ACPI_STATUS (AE_OK); 624 return_ACPI_STATUS (AE_OK);
661} 625}
@@ -694,29 +658,25 @@ acpi_rs_address32_stream (
694 658
695 buffer = *output_buffer; 659 buffer = *output_buffer;
696 660
697 /* 661 /* The descriptor field is static */
698 * The descriptor field is static 662
699 */
700 *buffer = 0x87; 663 *buffer = 0x87;
701 buffer += 1; 664 buffer += 1;
702 665
703 /* 666 /* Set a pointer to the Length field - to be filled in later */
704 * Set a pointer to the Length field - to be filled in later 667
705 */
706 length_field = ACPI_CAST_PTR (u16, buffer); 668 length_field = ACPI_CAST_PTR (u16, buffer);
707 buffer += 2; 669 buffer += 2;
708 670
709 /* 671 /* Set the Resource Type (Memory, Io, bus_number) */
710 * Set the Resource Type (Memory, Io, bus_number) 672
711 */
712 temp8 = (u8) (linked_list->data.address32.resource_type & 0x03); 673 temp8 = (u8) (linked_list->data.address32.resource_type & 0x03);
713 674
714 *buffer = temp8; 675 *buffer = temp8;
715 buffer += 1; 676 buffer += 1;
716 677
717 /* 678 /* Set the general flags */
718 * Set the general flags 679
719 */
720 temp8 = (u8) (linked_list->data.address32.producer_consumer & 0x01); 680 temp8 = (u8) (linked_list->data.address32.producer_consumer & 0x01);
721 temp8 |= (linked_list->data.address32.decode & 0x01) << 1; 681 temp8 |= (linked_list->data.address32.decode & 0x01) << 1;
722 temp8 |= (linked_list->data.address32.min_address_fixed & 0x01) << 2; 682 temp8 |= (linked_list->data.address32.min_address_fixed & 0x01) << 2;
@@ -725,9 +685,8 @@ acpi_rs_address32_stream (
725 *buffer = temp8; 685 *buffer = temp8;
726 buffer += 1; 686 buffer += 1;
727 687
728 /* 688 /* Set the type specific flags */
729 * Set the type specific flags 689
730 */
731 temp8 = 0; 690 temp8 = 0;
732 691
733 if (ACPI_MEMORY_RANGE == linked_list->data.address32.resource_type) { 692 if (ACPI_MEMORY_RANGE == linked_list->data.address32.resource_type) {
@@ -751,39 +710,34 @@ acpi_rs_address32_stream (
751 *buffer = temp8; 710 *buffer = temp8;
752 buffer += 1; 711 buffer += 1;
753 712
754 /* 713 /* Set the address space granularity */
755 * Set the address space granularity 714
756 */
757 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.granularity); 715 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.granularity);
758 buffer += 4; 716 buffer += 4;
759 717
760 /* 718 /* Set the address range minimum */
761 * Set the address range minimum 719
762 */
763 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.min_address_range); 720 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.min_address_range);
764 buffer += 4; 721 buffer += 4;
765 722
766 /* 723 /* Set the address range maximum */
767 * Set the address range maximum 724
768 */
769 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.max_address_range); 725 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.max_address_range);
770 buffer += 4; 726 buffer += 4;
771 727
772 /* 728 /* Set the address translation offset */
773 * Set the address translation offset 729
774 */ 730 ACPI_MOVE_32_TO_32 (buffer,
775 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.address_translation_offset); 731 &linked_list->data.address32.address_translation_offset);
776 buffer += 4; 732 buffer += 4;
777 733
778 /* 734 /* Set the address length */
779 * Set the address length 735
780 */
781 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.address_length); 736 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.address32.address_length);
782 buffer += 4; 737 buffer += 4;
783 738
784 /* 739 /* Resource Source Index and Resource Source are optional */
785 * Resource Source Index and Resource Source are optional 740
786 */
787 if (0 != linked_list->data.address32.resource_source.string_length) { 741 if (0 != linked_list->data.address32.resource_source.string_length) {
788 temp8 = (u8) linked_list->data.address32.resource_source.index; 742 temp8 = (u8) linked_list->data.address32.resource_source.index;
789 743
@@ -792,9 +746,8 @@ acpi_rs_address32_stream (
792 746
793 temp_pointer = (char *) buffer; 747 temp_pointer = (char *) buffer;
794 748
795 /* 749 /* Copy the string */
796 * Copy the string 750
797 */
798 ACPI_STRCPY (temp_pointer, 751 ACPI_STRCPY (temp_pointer,
799 linked_list->data.address32.resource_source.string_ptr); 752 linked_list->data.address32.resource_source.string_ptr);
800 753
@@ -802,12 +755,12 @@ acpi_rs_address32_stream (
802 * Buffer needs to be set to the length of the sting + one for the 755 * Buffer needs to be set to the length of the sting + one for the
803 * terminating null 756 * terminating null
804 */ 757 */
805 buffer += (acpi_size)(ACPI_STRLEN (linked_list->data.address32.resource_source.string_ptr) + 1); 758 buffer += (acpi_size)(ACPI_STRLEN (
759 linked_list->data.address32.resource_source.string_ptr) + 1);
806 } 760 }
807 761
808 /* 762 /* Return the number of bytes consumed in this operation */
809 * Return the number of bytes consumed in this operation 763
810 */
811 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); 764 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer);
812 765
813 /* 766 /*
@@ -864,9 +817,8 @@ acpi_rs_address64_resource (
864 struct_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_address64); 817 struct_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_address64);
865 resource_type = *buffer; 818 resource_type = *buffer;
866 819
867 /* 820 /* Point past the Descriptor to get the number of bytes consumed */
868 * Point past the Descriptor to get the number of bytes consumed 821
869 */
870 buffer += 1; 822 buffer += 1;
871 ACPI_MOVE_16_TO_16 (&temp16, buffer); 823 ACPI_MOVE_16_TO_16 (&temp16, buffer);
872 824
@@ -879,9 +831,8 @@ acpi_rs_address64_resource (
879 *bytes_consumed = temp16 + 3; 831 *bytes_consumed = temp16 + 3;
880 output_struct->id = ACPI_RSTYPE_ADDRESS64; 832 output_struct->id = ACPI_RSTYPE_ADDRESS64;
881 833
882 /* 834 /* Get the Resource Type (Byte3) */
883 * Get the Resource Type (Byte3) 835
884 */
885 buffer += 2; 836 buffer += 2;
886 temp8 = *buffer; 837 temp8 = *buffer;
887 838
@@ -893,35 +844,29 @@ acpi_rs_address64_resource (
893 844
894 output_struct->data.address64.resource_type = temp8; 845 output_struct->data.address64.resource_type = temp8;
895 846
896 /* 847 /* Get the General Flags (Byte4) */
897 * Get the General Flags (Byte4) 848
898 */
899 buffer += 1; 849 buffer += 1;
900 temp8 = *buffer; 850 temp8 = *buffer;
901 851
902 /* 852 /* Producer / Consumer */
903 * Producer / Consumer 853
904 */
905 output_struct->data.address64.producer_consumer = temp8 & 0x01; 854 output_struct->data.address64.producer_consumer = temp8 & 0x01;
906 855
907 /* 856 /* Decode */
908 * Decode 857
909 */
910 output_struct->data.address64.decode = (temp8 >> 1) & 0x01; 858 output_struct->data.address64.decode = (temp8 >> 1) & 0x01;
911 859
912 /* 860 /* Min Address Fixed */
913 * Min Address Fixed 861
914 */
915 output_struct->data.address64.min_address_fixed = (temp8 >> 2) & 0x01; 862 output_struct->data.address64.min_address_fixed = (temp8 >> 2) & 0x01;
916 863
917 /* 864 /* Max Address Fixed */
918 * Max Address Fixed 865
919 */
920 output_struct->data.address64.max_address_fixed = (temp8 >> 3) & 0x01; 866 output_struct->data.address64.max_address_fixed = (temp8 >> 3) & 0x01;
921 867
922 /* 868 /* Get the Type Specific Flags (Byte5) */
923 * Get the Type Specific Flags (Byte5) 869
924 */
925 buffer += 1; 870 buffer += 1;
926 temp8 = *buffer; 871 temp8 = *buffer;
927 872
@@ -951,33 +896,29 @@ acpi_rs_address64_resource (
951 buffer += 2; 896 buffer += 2;
952 } 897 }
953 898
954 /* 899 /* Get Granularity (Bytes 6-13) or (Bytes 8-15) */
955 * Get Granularity (Bytes 6-13) or (Bytes 8-15) 900
956 */
957 buffer += 1; 901 buffer += 1;
958 ACPI_MOVE_64_TO_64 (&output_struct->data.address64.granularity, buffer); 902 ACPI_MOVE_64_TO_64 (&output_struct->data.address64.granularity, buffer);
959 903
960 /* 904 /* Get min_address_range (Bytes 14-21) or (Bytes 16-23) */
961 * Get min_address_range (Bytes 14-21) or (Bytes 16-23) 905
962 */
963 buffer += 8; 906 buffer += 8;
964 ACPI_MOVE_64_TO_64 (&output_struct->data.address64.min_address_range, buffer); 907 ACPI_MOVE_64_TO_64 (&output_struct->data.address64.min_address_range, buffer);
965 908
966 /* 909 /* Get max_address_range (Bytes 22-29) or (Bytes 24-31) */
967 * Get max_address_range (Bytes 22-29) or (Bytes 24-31) 910
968 */
969 buffer += 8; 911 buffer += 8;
970 ACPI_MOVE_64_TO_64 (&output_struct->data.address64.max_address_range, buffer); 912 ACPI_MOVE_64_TO_64 (&output_struct->data.address64.max_address_range, buffer);
971 913
972 /* 914 /* Get address_translation_offset (Bytes 30-37) or (Bytes 32-39) */
973 * Get address_translation_offset (Bytes 30-37) or (Bytes 32-39) 915
974 */
975 buffer += 8; 916 buffer += 8;
976 ACPI_MOVE_64_TO_64 (&output_struct->data.address64.address_translation_offset, buffer); 917 ACPI_MOVE_64_TO_64 (&output_struct->data.address64.address_translation_offset,
918 buffer);
919
920 /* Get address_length (Bytes 38-45) or (Bytes 40-47) */
977 921
978 /*
979 * Get address_length (Bytes 38-45) or (Bytes 40-47)
980 */
981 buffer += 8; 922 buffer += 8;
982 ACPI_MOVE_64_TO_64 (&output_struct->data.address64.address_length, buffer); 923 ACPI_MOVE_64_TO_64 (&output_struct->data.address64.address_length, buffer);
983 924
@@ -989,14 +930,15 @@ acpi_rs_address64_resource (
989 /* Get type_specific_attribute (Bytes 48-55) */ 930 /* Get type_specific_attribute (Bytes 48-55) */
990 931
991 buffer += 8; 932 buffer += 8;
992 ACPI_MOVE_64_TO_64 (&output_struct->data.address64.type_specific_attributes, buffer); 933 ACPI_MOVE_64_TO_64 (
934 &output_struct->data.address64.type_specific_attributes,
935 buffer);
993 } 936 }
994 else { 937 else {
995 output_struct->data.address64.type_specific_attributes = 0; 938 output_struct->data.address64.type_specific_attributes = 0;
996 939
997 /* 940 /* Resource Source Index (if present) */
998 * Resource Source Index (if present) 941
999 */
1000 buffer += 8; 942 buffer += 8;
1001 943
1002 /* 944 /*
@@ -1025,7 +967,8 @@ acpi_rs_address64_resource (
1025 output_struct->data.address64.resource_source.string_ptr = 967 output_struct->data.address64.resource_source.string_ptr =
1026 (char *)((u8 *)output_struct + struct_size); 968 (char *)((u8 *)output_struct + struct_size);
1027 969
1028 temp_ptr = (u8 *) output_struct->data.address64.resource_source.string_ptr; 970 temp_ptr = (u8 *)
971 output_struct->data.address64.resource_source.string_ptr;
1029 972
1030 /* Copy the string into the buffer */ 973 /* Copy the string into the buffer */
1031 974
@@ -1042,7 +985,8 @@ acpi_rs_address64_resource (
1042 * Add the terminating null 985 * Add the terminating null
1043 */ 986 */
1044 *temp_ptr = 0x00; 987 *temp_ptr = 0x00;
1045 output_struct->data.address64.resource_source.string_length = index + 1; 988 output_struct->data.address64.resource_source.string_length =
989 index + 1;
1046 990
1047 /* 991 /*
1048 * In order for the struct_size to fall on a 32-bit boundary, 992 * In order for the struct_size to fall on a 32-bit boundary,
@@ -1054,14 +998,12 @@ acpi_rs_address64_resource (
1054 } 998 }
1055 } 999 }
1056 1000
1057 /* 1001 /* Set the Length parameter */
1058 * Set the Length parameter 1002
1059 */
1060 output_struct->length = (u32) struct_size; 1003 output_struct->length = (u32) struct_size;
1061 1004
1062 /* 1005 /* Return the final size of the structure */
1063 * Return the final size of the structure 1006
1064 */
1065 *structure_size = struct_size; 1007 *structure_size = struct_size;
1066 return_ACPI_STATUS (AE_OK); 1008 return_ACPI_STATUS (AE_OK);
1067} 1009}
@@ -1100,29 +1042,25 @@ acpi_rs_address64_stream (
1100 1042
1101 buffer = *output_buffer; 1043 buffer = *output_buffer;
1102 1044
1103 /* 1045 /* The descriptor field is static */
1104 * The descriptor field is static 1046
1105 */
1106 *buffer = 0x8A; 1047 *buffer = 0x8A;
1107 buffer += 1; 1048 buffer += 1;
1108 1049
1109 /* 1050 /* Set a pointer to the Length field - to be filled in later */
1110 * Set a pointer to the Length field - to be filled in later 1051
1111 */
1112 length_field = ACPI_CAST_PTR (u16, buffer); 1052 length_field = ACPI_CAST_PTR (u16, buffer);
1113 buffer += 2; 1053 buffer += 2;
1114 1054
1115 /* 1055 /* Set the Resource Type (Memory, Io, bus_number) */
1116 * Set the Resource Type (Memory, Io, bus_number) 1056
1117 */
1118 temp8 = (u8) (linked_list->data.address64.resource_type & 0x03); 1057 temp8 = (u8) (linked_list->data.address64.resource_type & 0x03);
1119 1058
1120 *buffer = temp8; 1059 *buffer = temp8;
1121 buffer += 1; 1060 buffer += 1;
1122 1061
1123 /* 1062 /* Set the general flags */
1124 * Set the general flags 1063
1125 */
1126 temp8 = (u8) (linked_list->data.address64.producer_consumer & 0x01); 1064 temp8 = (u8) (linked_list->data.address64.producer_consumer & 0x01);
1127 temp8 |= (linked_list->data.address64.decode & 0x01) << 1; 1065 temp8 |= (linked_list->data.address64.decode & 0x01) << 1;
1128 temp8 |= (linked_list->data.address64.min_address_fixed & 0x01) << 2; 1066 temp8 |= (linked_list->data.address64.min_address_fixed & 0x01) << 2;
@@ -1131,9 +1069,8 @@ acpi_rs_address64_stream (
1131 *buffer = temp8; 1069 *buffer = temp8;
1132 buffer += 1; 1070 buffer += 1;
1133 1071
1134 /* 1072 /* Set the type specific flags */
1135 * Set the type specific flags 1073
1136 */
1137 temp8 = 0; 1074 temp8 = 0;
1138 1075
1139 if (ACPI_MEMORY_RANGE == linked_list->data.address64.resource_type) { 1076 if (ACPI_MEMORY_RANGE == linked_list->data.address64.resource_type) {
@@ -1157,39 +1094,34 @@ acpi_rs_address64_stream (
1157 *buffer = temp8; 1094 *buffer = temp8;
1158 buffer += 1; 1095 buffer += 1;
1159 1096
1160 /* 1097 /* Set the address space granularity */
1161 * Set the address space granularity 1098
1162 */
1163 ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.granularity); 1099 ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.granularity);
1164 buffer += 8; 1100 buffer += 8;
1165 1101
1166 /* 1102 /* Set the address range minimum */
1167 * Set the address range minimum 1103
1168 */
1169 ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.min_address_range); 1104 ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.min_address_range);
1170 buffer += 8; 1105 buffer += 8;
1171 1106
1172 /* 1107 /* Set the address range maximum */
1173 * Set the address range maximum 1108
1174 */
1175 ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.max_address_range); 1109 ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.max_address_range);
1176 buffer += 8; 1110 buffer += 8;
1177 1111
1178 /* 1112 /* Set the address translation offset */
1179 * Set the address translation offset 1113
1180 */ 1114 ACPI_MOVE_64_TO_64 (buffer,
1181 ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.address_translation_offset); 1115 &linked_list->data.address64.address_translation_offset);
1182 buffer += 8; 1116 buffer += 8;
1183 1117
1184 /* 1118 /* Set the address length */
1185 * Set the address length 1119
1186 */
1187 ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.address_length); 1120 ACPI_MOVE_64_TO_64 (buffer, &linked_list->data.address64.address_length);
1188 buffer += 8; 1121 buffer += 8;
1189 1122
1190 /* 1123 /* Resource Source Index and Resource Source are optional */
1191 * Resource Source Index and Resource Source are optional 1124
1192 */
1193 if (0 != linked_list->data.address64.resource_source.string_length) { 1125 if (0 != linked_list->data.address64.resource_source.string_length) {
1194 temp8 = (u8) linked_list->data.address64.resource_source.index; 1126 temp8 = (u8) linked_list->data.address64.resource_source.index;
1195 1127
@@ -1198,21 +1130,21 @@ acpi_rs_address64_stream (
1198 1130
1199 temp_pointer = (char *) buffer; 1131 temp_pointer = (char *) buffer;
1200 1132
1201 /* 1133 /* Copy the string */
1202 * Copy the string 1134
1203 */ 1135 ACPI_STRCPY (temp_pointer,
1204 ACPI_STRCPY (temp_pointer, linked_list->data.address64.resource_source.string_ptr); 1136 linked_list->data.address64.resource_source.string_ptr);
1205 1137
1206 /* 1138 /*
1207 * Buffer needs to be set to the length of the sting + one for the 1139 * Buffer needs to be set to the length of the sting + one for the
1208 * terminating null 1140 * terminating null
1209 */ 1141 */
1210 buffer += (acpi_size)(ACPI_STRLEN (linked_list->data.address64.resource_source.string_ptr) + 1); 1142 buffer += (acpi_size)(ACPI_STRLEN (
1143 linked_list->data.address64.resource_source.string_ptr) + 1);
1211 } 1144 }
1212 1145
1213 /* 1146 /* Return the number of bytes consumed in this operation */
1214 * Return the number of bytes consumed in this operation 1147
1215 */
1216 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); 1148 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer);
1217 1149
1218 /* 1150 /*
diff --git a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c
index 8a5f0a52371d..98176f2fcb5d 100644
--- a/drivers/acpi/resources/rscalc.c
+++ b/drivers/acpi/resources/rscalc.c
@@ -81,9 +81,8 @@ acpi_rs_get_byte_stream_length (
81 81
82 82
83 while (!done) { 83 while (!done) {
84 /* 84 /* Init the variable that will hold the size to add to the total. */
85 * Init the variable that will hold the size to add to the total. 85
86 */
87 segment_size = 0; 86 segment_size = 0;
88 87
89 switch (linked_list->id) { 88 switch (linked_list->id) {
@@ -196,7 +195,8 @@ acpi_rs_get_byte_stream_length (
196 segment_size = 16; 195 segment_size = 16;
197 196
198 if (linked_list->data.address16.resource_source.string_ptr) { 197 if (linked_list->data.address16.resource_source.string_ptr) {
199 segment_size += linked_list->data.address16.resource_source.string_length; 198 segment_size +=
199 linked_list->data.address16.resource_source.string_length;
200 segment_size++; 200 segment_size++;
201 } 201 }
202 break; 202 break;
@@ -212,7 +212,8 @@ acpi_rs_get_byte_stream_length (
212 segment_size = 26; 212 segment_size = 26;
213 213
214 if (linked_list->data.address32.resource_source.string_ptr) { 214 if (linked_list->data.address32.resource_source.string_ptr) {
215 segment_size += linked_list->data.address32.resource_source.string_length; 215 segment_size +=
216 linked_list->data.address32.resource_source.string_length;
216 segment_size++; 217 segment_size++;
217 } 218 }
218 break; 219 break;
@@ -227,7 +228,8 @@ acpi_rs_get_byte_stream_length (
227 segment_size = 46; 228 segment_size = 46;
228 229
229 if (linked_list->data.address64.resource_source.string_ptr) { 230 if (linked_list->data.address64.resource_source.string_ptr) {
230 segment_size += linked_list->data.address64.resource_source.string_length; 231 segment_size +=
232 linked_list->data.address64.resource_source.string_length;
231 segment_size++; 233 segment_size++;
232 } 234 }
233 break; 235 break;
@@ -241,38 +243,36 @@ acpi_rs_get_byte_stream_length (
241 * Index + the length of the null terminated string 243 * Index + the length of the null terminated string
242 * Resource Source + 1 for the null. 244 * Resource Source + 1 for the null.
243 */ 245 */
244 segment_size = 9 + 246 segment_size = 9 + (((acpi_size)
245 (((acpi_size) linked_list->data.extended_irq.number_of_interrupts - 1) * 4); 247 linked_list->data.extended_irq.number_of_interrupts - 1) * 4);
246 248
247 if (linked_list->data.extended_irq.resource_source.string_ptr) { 249 if (linked_list->data.extended_irq.resource_source.string_ptr) {
248 segment_size += linked_list->data.extended_irq.resource_source.string_length; 250 segment_size +=
251 linked_list->data.extended_irq.resource_source.string_length;
249 segment_size++; 252 segment_size++;
250 } 253 }
251 break; 254 break;
252 255
253 default: 256 default:
254 /* 257
255 * If we get here, everything is out of sync, exit with error 258 /* If we get here, everything is out of sync, exit with error */
256 */ 259
257 return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE); 260 return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
258 261
259 } /* switch (linked_list->Id) */ 262 } /* switch (linked_list->Id) */
260 263
261 /* 264 /* Update the total */
262 * Update the total 265
263 */
264 byte_stream_size_needed += segment_size; 266 byte_stream_size_needed += segment_size;
265 267
266 /* 268 /* Point to the next object */
267 * Point to the next object 269
268 */
269 linked_list = ACPI_PTR_ADD (struct acpi_resource, 270 linked_list = ACPI_PTR_ADD (struct acpi_resource,
270 linked_list, linked_list->length); 271 linked_list, linked_list->length);
271 } 272 }
272 273
273 /* 274 /* This is the data the caller needs */
274 * This is the data the caller needs 275
275 */
276 *size_needed = byte_stream_size_needed; 276 *size_needed = byte_stream_size_needed;
277 return_ACPI_STATUS (AE_OK); 277 return_ACPI_STATUS (AE_OK);
278} 278}
@@ -320,9 +320,8 @@ acpi_rs_get_list_length (
320 320
321 321
322 while (bytes_parsed < byte_stream_buffer_length) { 322 while (bytes_parsed < byte_stream_buffer_length) {
323 /* 323 /* The next byte in the stream is the resource type */
324 * The next byte in the stream is the resource type 324
325 */
326 resource_type = acpi_rs_get_resource_type (*byte_stream_buffer); 325 resource_type = acpi_rs_get_resource_type (*byte_stream_buffer);
327 326
328 switch (resource_type) { 327 switch (resource_type) {
@@ -346,9 +345,8 @@ acpi_rs_get_list_length (
346 ACPI_MOVE_16_TO_16 (&temp16, buffer); 345 ACPI_MOVE_16_TO_16 (&temp16, buffer);
347 bytes_consumed = temp16 + 3; 346 bytes_consumed = temp16 + 3;
348 347
349 /* 348 /* Ensure a 32-bit boundary for the structure */
350 * Ensure a 32-bit boundary for the structure 349
351 */
352 temp16 = (u16) ACPI_ROUND_UP_to_32_bITS (temp16); 350 temp16 = (u16) ACPI_ROUND_UP_to_32_bITS (temp16);
353 351
354 structure_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_vendor) + 352 structure_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_vendor) +
@@ -416,9 +414,8 @@ acpi_rs_get_list_length (
416 temp8 = 0; 414 temp8 = 0;
417 } 415 }
418 416
419 /* 417 /* Ensure a 64-bit boundary for the structure */
420 * Ensure a 64-bit boundary for the structure 418
421 */
422 temp8 = (u8) ACPI_ROUND_UP_to_64_bITS (temp8); 419 temp8 = (u8) ACPI_ROUND_UP_to_64_bITS (temp8);
423 420
424 structure_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_address64) + 421 structure_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_address64) +
@@ -452,9 +449,8 @@ acpi_rs_get_list_length (
452 temp8 = 0; 449 temp8 = 0;
453 } 450 }
454 451
455 /* 452 /* Ensure a 32-bit boundary for the structure */
456 * Ensure a 32-bit boundary for the structure 453
457 */
458 temp8 = (u8) ACPI_ROUND_UP_to_32_bITS (temp8); 454 temp8 = (u8) ACPI_ROUND_UP_to_32_bITS (temp8);
459 455
460 structure_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_address32) + 456 structure_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_address32) +
@@ -488,9 +484,8 @@ acpi_rs_get_list_length (
488 temp8 = 0; 484 temp8 = 0;
489 } 485 }
490 486
491 /* 487 /* Ensure a 32-bit boundary for the structure */
492 * Ensure a 32-bit boundary for the structure 488
493 */
494 temp8 = (u8) ACPI_ROUND_UP_to_32_bITS (temp8); 489 temp8 = (u8) ACPI_ROUND_UP_to_32_bITS (temp8);
495 490
496 structure_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_address16) + 491 structure_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_address16) +
@@ -537,9 +532,8 @@ acpi_rs_get_list_length (
537 temp8 = 0; 532 temp8 = 0;
538 } 533 }
539 534
540 /* 535 /* Ensure a 32-bit boundary for the structure */
541 * Ensure a 32-bit boundary for the structure 536
542 */
543 temp8 = (u8) ACPI_ROUND_UP_to_32_bITS (temp8); 537 temp8 = (u8) ACPI_ROUND_UP_to_32_bITS (temp8);
544 538
545 structure_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_ext_irq) + 539 structure_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_ext_irq) +
@@ -567,9 +561,8 @@ acpi_rs_get_list_length (
567 561
568 ++buffer; 562 ++buffer;
569 563
570 /* 564 /* Look at the number of bits set */
571 * Look at the number of bits set 565
572 */
573 ACPI_MOVE_16_TO_16 (&temp16, buffer); 566 ACPI_MOVE_16_TO_16 (&temp16, buffer);
574 567
575 for (index = 0; index < 16; index++) { 568 for (index = 0; index < 16; index++) {
@@ -596,9 +589,8 @@ acpi_rs_get_list_length (
596 589
597 ++buffer; 590 ++buffer;
598 591
599 /* 592 /* Look at the number of bits set */
600 * Look at the number of bits set 593
601 */
602 temp8 = *buffer; 594 temp8 = *buffer;
603 595
604 for(index = 0; index < 8; index++) { 596 for(index = 0; index < 8; index++) {
@@ -670,9 +662,8 @@ acpi_rs_get_list_length (
670 temp8 = (u8) (temp8 & 0x7); 662 temp8 = (u8) (temp8 & 0x7);
671 bytes_consumed = temp8 + 1; 663 bytes_consumed = temp8 + 1;
672 664
673 /* 665 /* Ensure a 32-bit boundary for the structure */
674 * Ensure a 32-bit boundary for the structure 666
675 */
676 temp8 = (u8) ACPI_ROUND_UP_to_32_bITS (temp8); 667 temp8 = (u8) ACPI_ROUND_UP_to_32_bITS (temp8);
677 structure_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_vendor) + 668 structure_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_vendor) +
678 (temp8 * sizeof (u8)); 669 (temp8 * sizeof (u8));
@@ -697,21 +688,18 @@ acpi_rs_get_list_length (
697 return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE); 688 return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
698 } 689 }
699 690
700 /* 691 /* Update the return value and counter */
701 * Update the return value and counter 692
702 */
703 buffer_size += (u32) ACPI_ALIGN_RESOURCE_SIZE (structure_size); 693 buffer_size += (u32) ACPI_ALIGN_RESOURCE_SIZE (structure_size);
704 bytes_parsed += bytes_consumed; 694 bytes_parsed += bytes_consumed;
705 695
706 /* 696 /* Set the byte stream to point to the next resource */
707 * Set the byte stream to point to the next resource 697
708 */
709 byte_stream_buffer += bytes_consumed; 698 byte_stream_buffer += bytes_consumed;
710 } 699 }
711 700
712 /* 701 /* This is the data the caller needs */
713 * This is the data the caller needs 702
714 */
715 *size_needed = buffer_size; 703 *size_needed = buffer_size;
716 return_ACPI_STATUS (AE_OK); 704 return_ACPI_STATUS (AE_OK);
717} 705}
@@ -767,9 +755,8 @@ acpi_rs_get_pci_routing_table_length (
767 top_object_list = package_object->package.elements; 755 top_object_list = package_object->package.elements;
768 756
769 for (index = 0; index < number_of_elements; index++) { 757 for (index = 0; index < number_of_elements; index++) {
770 /* 758 /* Dereference the sub-package */
771 * Dereference the sub-package 759
772 */
773 package_element = *top_object_list; 760 package_element = *top_object_list;
774 761
775 /* 762 /*
@@ -778,37 +765,40 @@ acpi_rs_get_pci_routing_table_length (
778 */ 765 */
779 sub_object_list = package_element->package.elements; 766 sub_object_list = package_element->package.elements;
780 767
781 /* 768 /* Scan the irq_table_elements for the Source Name String */
782 * Scan the irq_table_elements for the Source Name String 769
783 */
784 name_found = FALSE; 770 name_found = FALSE;
785 771
786 for (table_index = 0; table_index < 4 && !name_found; table_index++) { 772 for (table_index = 0; table_index < 4 && !name_found; table_index++) {
787 if ((ACPI_TYPE_STRING == ACPI_GET_OBJECT_TYPE (*sub_object_list)) || 773 if ((ACPI_TYPE_STRING ==
788 ((ACPI_TYPE_LOCAL_REFERENCE == ACPI_GET_OBJECT_TYPE (*sub_object_list)) && 774 ACPI_GET_OBJECT_TYPE (*sub_object_list)) ||
789 ((*sub_object_list)->reference.opcode == AML_INT_NAMEPATH_OP))) { 775
776 ((ACPI_TYPE_LOCAL_REFERENCE ==
777 ACPI_GET_OBJECT_TYPE (*sub_object_list)) &&
778
779 ((*sub_object_list)->reference.opcode ==
780 AML_INT_NAMEPATH_OP))) {
790 name_found = TRUE; 781 name_found = TRUE;
791 } 782 }
792 else { 783 else {
793 /* 784 /* Look at the next element */
794 * Look at the next element 785
795 */
796 sub_object_list++; 786 sub_object_list++;
797 } 787 }
798 } 788 }
799 789
800 temp_size_needed += (sizeof (struct acpi_pci_routing_table) - 4); 790 temp_size_needed += (sizeof (struct acpi_pci_routing_table) - 4);
801 791
802 /* 792 /* Was a String type found? */
803 * Was a String type found? 793
804 */
805 if (name_found) { 794 if (name_found) {
806 if (ACPI_GET_OBJECT_TYPE (*sub_object_list) == ACPI_TYPE_STRING) { 795 if (ACPI_GET_OBJECT_TYPE (*sub_object_list) == ACPI_TYPE_STRING) {
807 /* 796 /*
808 * The length String.Length field does not include the 797 * The length String.Length field does not include the
809 * terminating NULL, add 1 798 * terminating NULL, add 1
810 */ 799 */
811 temp_size_needed += ((acpi_size) (*sub_object_list)->string.length + 1); 800 temp_size_needed += ((acpi_size)
801 (*sub_object_list)->string.length + 1);
812 } 802 }
813 else { 803 else {
814 temp_size_needed += acpi_ns_get_pathname_length ( 804 temp_size_needed += acpi_ns_get_pathname_length (
@@ -827,14 +817,14 @@ acpi_rs_get_pci_routing_table_length (
827 817
828 temp_size_needed = ACPI_ROUND_UP_to_64_bITS (temp_size_needed); 818 temp_size_needed = ACPI_ROUND_UP_to_64_bITS (temp_size_needed);
829 819
830 /* 820 /* Point to the next union acpi_operand_object */
831 * Point to the next union acpi_operand_object 821
832 */
833 top_object_list++; 822 top_object_list++;
834 } 823 }
835 824
836 /* 825 /*
837 * Adding an extra element to the end of the list, essentially a NULL terminator 826 * Adding an extra element to the end of the list, essentially a
827 * NULL terminator
838 */ 828 */
839 *buffer_size_needed = temp_size_needed + sizeof (struct acpi_pci_routing_table); 829 *buffer_size_needed = temp_size_needed + sizeof (struct acpi_pci_routing_table);
840 return_ACPI_STATUS (AE_OK); 830 return_ACPI_STATUS (AE_OK);
diff --git a/drivers/acpi/resources/rscreate.c b/drivers/acpi/resources/rscreate.c
index a3a0cbfda68d..8e0eae0d50bb 100644
--- a/drivers/acpi/resources/rscreate.c
+++ b/drivers/acpi/resources/rscreate.c
@@ -87,9 +87,8 @@ acpi_rs_create_resource_list (
87 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "byte_stream_buffer = %p\n", 87 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "byte_stream_buffer = %p\n",
88 byte_stream_buffer)); 88 byte_stream_buffer));
89 89
90 /* 90 /* Params already validated, so we don't re-validate here */
91 * Params already validated, so we don't re-validate here 91
92 */
93 byte_stream_buffer_length = byte_stream_buffer->buffer.length; 92 byte_stream_buffer_length = byte_stream_buffer->buffer.length;
94 byte_stream_start = byte_stream_buffer->buffer.pointer; 93 byte_stream_start = byte_stream_buffer->buffer.pointer;
95 94
@@ -171,9 +170,8 @@ acpi_rs_create_pci_routing_table (
171 170
172 /* Params already validated, so we don't re-validate here */ 171 /* Params already validated, so we don't re-validate here */
173 172
174 /* 173 /* Get the required buffer length */
175 * Get the required buffer length 174
176 */
177 status = acpi_rs_get_pci_routing_table_length (package_object, 175 status = acpi_rs_get_pci_routing_table_length (package_object,
178 &buffer_size_needed); 176 &buffer_size_needed);
179 if (ACPI_FAILURE (status)) { 177 if (ACPI_FAILURE (status)) {
@@ -217,9 +215,8 @@ acpi_rs_create_pci_routing_table (
217 */ 215 */
218 user_prt->length = (sizeof (struct acpi_pci_routing_table) - 4); 216 user_prt->length = (sizeof (struct acpi_pci_routing_table) - 4);
219 217
220 /* 218 /* Each element of the top-level package must also be a package */
221 * Each element of the top-level package must also be a package 219
222 */
223 if (ACPI_GET_OBJECT_TYPE (*top_object_list) != ACPI_TYPE_PACKAGE) { 220 if (ACPI_GET_OBJECT_TYPE (*top_object_list) != ACPI_TYPE_PACKAGE) {
224 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 221 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
225 "(PRT[%X]) Need sub-package, found %s\n", 222 "(PRT[%X]) Need sub-package, found %s\n",
@@ -243,9 +240,8 @@ acpi_rs_create_pci_routing_table (
243 */ 240 */
244 sub_object_list = (*top_object_list)->package.elements; 241 sub_object_list = (*top_object_list)->package.elements;
245 242
246 /* 243 /* 1) First subobject: Dereference the PRT.Address */
247 * 1) First subobject: Dereference the PRT.Address 244
248 */
249 obj_desc = sub_object_list[0]; 245 obj_desc = sub_object_list[0];
250 if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) { 246 if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
251 user_prt->address = obj_desc->integer.value; 247 user_prt->address = obj_desc->integer.value;
@@ -257,9 +253,8 @@ acpi_rs_create_pci_routing_table (
257 return_ACPI_STATUS (AE_BAD_DATA); 253 return_ACPI_STATUS (AE_BAD_DATA);
258 } 254 }
259 255
260 /* 256 /* 2) Second subobject: Dereference the PRT.Pin */
261 * 2) Second subobject: Dereference the PRT.Pin 257
262 */
263 obj_desc = sub_object_list[1]; 258 obj_desc = sub_object_list[1];
264 if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) { 259 if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
265 user_prt->pin = (u32) obj_desc->integer.value; 260 user_prt->pin = (u32) obj_desc->integer.value;
@@ -271,9 +266,8 @@ acpi_rs_create_pci_routing_table (
271 return_ACPI_STATUS (AE_BAD_DATA); 266 return_ACPI_STATUS (AE_BAD_DATA);
272 } 267 }
273 268
274 /* 269 /* 3) Third subobject: Dereference the PRT.source_name */
275 * 3) Third subobject: Dereference the PRT.source_name 270
276 */
277 obj_desc = sub_object_list[2]; 271 obj_desc = sub_object_list[2];
278 switch (ACPI_GET_OBJECT_TYPE (obj_desc)) { 272 switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
279 case ACPI_TYPE_LOCAL_REFERENCE: 273 case ACPI_TYPE_LOCAL_REFERENCE:
@@ -296,7 +290,9 @@ acpi_rs_create_pci_routing_table (
296 290
297 status = acpi_ns_handle_to_pathname ((acpi_handle) node, &path_buffer); 291 status = acpi_ns_handle_to_pathname ((acpi_handle) node, &path_buffer);
298 292
299 user_prt->length += (u32) ACPI_STRLEN (user_prt->source) + 1; /* include null terminator */ 293 /* +1 to include null terminator */
294
295 user_prt->length += (u32) ACPI_STRLEN (user_prt->source) + 1;
300 break; 296 break;
301 297
302 298
@@ -304,8 +300,10 @@ acpi_rs_create_pci_routing_table (
304 300
305 ACPI_STRCPY (user_prt->source, obj_desc->string.pointer); 301 ACPI_STRCPY (user_prt->source, obj_desc->string.pointer);
306 302
307 /* Add to the Length field the length of the string (add 1 for terminator) */ 303 /*
308 304 * Add to the Length field the length of the string
305 * (add 1 for terminator)
306 */
309 user_prt->length += obj_desc->string.length + 1; 307 user_prt->length += obj_desc->string.length + 1;
310 break; 308 break;
311 309
@@ -333,9 +331,8 @@ acpi_rs_create_pci_routing_table (
333 331
334 user_prt->length = (u32) ACPI_ROUND_UP_to_64_bITS (user_prt->length); 332 user_prt->length = (u32) ACPI_ROUND_UP_to_64_bITS (user_prt->length);
335 333
336 /* 334 /* 4) Fourth subobject: Dereference the PRT.source_index */
337 * 4) Fourth subobject: Dereference the PRT.source_index 335
338 */
339 obj_desc = sub_object_list[3]; 336 obj_desc = sub_object_list[3];
340 if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) { 337 if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
341 user_prt->source_index = (u32) obj_desc->integer.value; 338 user_prt->source_index = (u32) obj_desc->integer.value;
diff --git a/drivers/acpi/resources/rsdump.c b/drivers/acpi/resources/rsdump.c
index eef1b1f2c685..1935dab2ab51 100644
--- a/drivers/acpi/resources/rsdump.c
+++ b/drivers/acpi/resources/rsdump.c
@@ -48,9 +48,62 @@
48#define _COMPONENT ACPI_RESOURCES 48#define _COMPONENT ACPI_RESOURCES
49 ACPI_MODULE_NAME ("rsdump") 49 ACPI_MODULE_NAME ("rsdump")
50 50
51/* Local prototypes */
51 52
52#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 53static void
54acpi_rs_dump_irq (
55 union acpi_resource_data *data);
56
57static void
58acpi_rs_dump_address16 (
59 union acpi_resource_data *data);
60
61static void
62acpi_rs_dump_address32 (
63 union acpi_resource_data *data);
64
65static void
66acpi_rs_dump_address64 (
67 union acpi_resource_data *data);
68
69static void
70acpi_rs_dump_dma (
71 union acpi_resource_data *data);
72
73static void
74acpi_rs_dump_io (
75 union acpi_resource_data *data);
76
77static void
78acpi_rs_dump_extended_irq (
79 union acpi_resource_data *data);
53 80
81static void
82acpi_rs_dump_fixed_io (
83 union acpi_resource_data *data);
84
85static void
86acpi_rs_dump_fixed_memory32 (
87 union acpi_resource_data *data);
88
89static void
90acpi_rs_dump_memory24 (
91 union acpi_resource_data *data);
92
93static void
94acpi_rs_dump_memory32 (
95 union acpi_resource_data *data);
96
97static void
98acpi_rs_dump_start_depend_fns (
99 union acpi_resource_data *data);
100
101static void
102acpi_rs_dump_vendor_specific (
103 union acpi_resource_data *data);
104
105
106#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
54/******************************************************************************* 107/*******************************************************************************
55 * 108 *
56 * FUNCTION: acpi_rs_dump_irq 109 * FUNCTION: acpi_rs_dump_irq
@@ -63,7 +116,7 @@
63 * 116 *
64 ******************************************************************************/ 117 ******************************************************************************/
65 118
66void 119static void
67acpi_rs_dump_irq ( 120acpi_rs_dump_irq (
68 union acpi_resource_data *data) 121 union acpi_resource_data *data)
69{ 122{
@@ -77,13 +130,13 @@ acpi_rs_dump_irq (
77 acpi_os_printf ("IRQ Resource\n"); 130 acpi_os_printf ("IRQ Resource\n");
78 131
79 acpi_os_printf (" %s Triggered\n", 132 acpi_os_printf (" %s Triggered\n",
80 ACPI_LEVEL_SENSITIVE == irq_data->edge_level ? "Level" : "Edge"); 133 ACPI_LEVEL_SENSITIVE == irq_data->edge_level ? "Level" : "Edge");
81 134
82 acpi_os_printf (" Active %s\n", 135 acpi_os_printf (" Active %s\n",
83 ACPI_ACTIVE_LOW == irq_data->active_high_low ? "Low" : "High"); 136 ACPI_ACTIVE_LOW == irq_data->active_high_low ? "Low" : "High");
84 137
85 acpi_os_printf (" %s\n", 138 acpi_os_printf (" %s\n",
86 ACPI_SHARED == irq_data->shared_exclusive ? "Shared" : "Exclusive"); 139 ACPI_SHARED == irq_data->shared_exclusive ? "Shared" : "Exclusive");
87 140
88 acpi_os_printf (" %X Interrupts ( ", irq_data->number_of_interrupts); 141 acpi_os_printf (" %X Interrupts ( ", irq_data->number_of_interrupts);
89 142
@@ -108,7 +161,7 @@ acpi_rs_dump_irq (
108 * 161 *
109 ******************************************************************************/ 162 ******************************************************************************/
110 163
111void 164static void
112acpi_rs_dump_dma ( 165acpi_rs_dump_dma (
113 union acpi_resource_data *data) 166 union acpi_resource_data *data)
114{ 167{
@@ -144,7 +197,7 @@ acpi_rs_dump_dma (
144 } 197 }
145 198
146 acpi_os_printf (" %sBus Master\n", 199 acpi_os_printf (" %sBus Master\n",
147 ACPI_BUS_MASTER == dma_data->bus_master ? "" : "Not a "); 200 ACPI_BUS_MASTER == dma_data->bus_master ? "" : "Not a ");
148 201
149 202
150 switch (dma_data->transfer) { 203 switch (dma_data->transfer) {
@@ -165,7 +218,8 @@ acpi_rs_dump_dma (
165 break; 218 break;
166 } 219 }
167 220
168 acpi_os_printf (" Number of Channels: %X ( ", dma_data->number_of_channels); 221 acpi_os_printf (" Number of Channels: %X ( ",
222 dma_data->number_of_channels);
169 223
170 for (index = 0; index < dma_data->number_of_channels; index++) { 224 for (index = 0; index < dma_data->number_of_channels; index++) {
171 acpi_os_printf ("%X ", dma_data->channels[index]); 225 acpi_os_printf ("%X ", dma_data->channels[index]);
@@ -188,7 +242,7 @@ acpi_rs_dump_dma (
188 * 242 *
189 ******************************************************************************/ 243 ******************************************************************************/
190 244
191void 245static void
192acpi_rs_dump_start_depend_fns ( 246acpi_rs_dump_start_depend_fns (
193 union acpi_resource_data *data) 247 union acpi_resource_data *data)
194{ 248{
@@ -232,8 +286,7 @@ acpi_rs_dump_start_depend_fns (
232 break; 286 break;
233 287
234 default: 288 default:
235 acpi_os_printf (" Invalid performance " 289 acpi_os_printf (" Invalid performance robustness preference\n");
236 "robustness preference\n");
237 break; 290 break;
238 } 291 }
239 292
@@ -253,7 +306,7 @@ acpi_rs_dump_start_depend_fns (
253 * 306 *
254 ******************************************************************************/ 307 ******************************************************************************/
255 308
256void 309static void
257acpi_rs_dump_io ( 310acpi_rs_dump_io (
258 union acpi_resource_data *data) 311 union acpi_resource_data *data)
259{ 312{
@@ -266,19 +319,15 @@ acpi_rs_dump_io (
266 acpi_os_printf ("Io Resource\n"); 319 acpi_os_printf ("Io Resource\n");
267 320
268 acpi_os_printf (" %d bit decode\n", 321 acpi_os_printf (" %d bit decode\n",
269 ACPI_DECODE_16 == io_data->io_decode ? 16 : 10); 322 ACPI_DECODE_16 == io_data->io_decode ? 16 : 10);
270 323
271 acpi_os_printf (" Range minimum base: %08X\n", 324 acpi_os_printf (" Range minimum base: %08X\n", io_data->min_base_address);
272 io_data->min_base_address);
273 325
274 acpi_os_printf (" Range maximum base: %08X\n", 326 acpi_os_printf (" Range maximum base: %08X\n", io_data->max_base_address);
275 io_data->max_base_address);
276 327
277 acpi_os_printf (" Alignment: %08X\n", 328 acpi_os_printf (" Alignment: %08X\n", io_data->alignment);
278 io_data->alignment);
279 329
280 acpi_os_printf (" Range Length: %08X\n", 330 acpi_os_printf (" Range Length: %08X\n", io_data->range_length);
281 io_data->range_length);
282 331
283 return; 332 return;
284} 333}
@@ -296,7 +345,7 @@ acpi_rs_dump_io (
296 * 345 *
297 ******************************************************************************/ 346 ******************************************************************************/
298 347
299void 348static void
300acpi_rs_dump_fixed_io ( 349acpi_rs_dump_fixed_io (
301 union acpi_resource_data *data) 350 union acpi_resource_data *data)
302{ 351{
@@ -307,11 +356,9 @@ acpi_rs_dump_fixed_io (
307 356
308 357
309 acpi_os_printf ("Fixed Io Resource\n"); 358 acpi_os_printf ("Fixed Io Resource\n");
310 acpi_os_printf (" Range base address: %08X", 359 acpi_os_printf (" Range base address: %08X", fixed_io_data->base_address);
311 fixed_io_data->base_address);
312 360
313 acpi_os_printf (" Range length: %08X", 361 acpi_os_printf (" Range length: %08X", fixed_io_data->range_length);
314 fixed_io_data->range_length);
315 362
316 return; 363 return;
317} 364}
@@ -329,7 +376,7 @@ acpi_rs_dump_fixed_io (
329 * 376 *
330 ******************************************************************************/ 377 ******************************************************************************/
331 378
332void 379static void
333acpi_rs_dump_vendor_specific ( 380acpi_rs_dump_vendor_specific (
334 union acpi_resource_data *data) 381 union acpi_resource_data *data)
335{ 382{
@@ -346,7 +393,7 @@ acpi_rs_dump_vendor_specific (
346 393
347 for (index = 0; index < vendor_data->length; index++) { 394 for (index = 0; index < vendor_data->length; index++) {
348 acpi_os_printf (" Byte %X: %08X\n", 395 acpi_os_printf (" Byte %X: %08X\n",
349 index, vendor_data->reserved[index]); 396 index, vendor_data->reserved[index]);
350 } 397 }
351 398
352 return; 399 return;
@@ -365,7 +412,7 @@ acpi_rs_dump_vendor_specific (
365 * 412 *
366 ******************************************************************************/ 413 ******************************************************************************/
367 414
368void 415static void
369acpi_rs_dump_memory24 ( 416acpi_rs_dump_memory24 (
370 union acpi_resource_data *data) 417 union acpi_resource_data *data)
371{ 418{
@@ -378,21 +425,19 @@ acpi_rs_dump_memory24 (
378 acpi_os_printf ("24-Bit Memory Range Resource\n"); 425 acpi_os_printf ("24-Bit Memory Range Resource\n");
379 426
380 acpi_os_printf (" Read%s\n", 427 acpi_os_printf (" Read%s\n",
381 ACPI_READ_WRITE_MEMORY == 428 ACPI_READ_WRITE_MEMORY ==
382 memory24_data->read_write_attribute ? 429 memory24_data->read_write_attribute ?
383 "/Write" : " only"); 430 "/Write" : " only");
384 431
385 acpi_os_printf (" Range minimum base: %08X\n", 432 acpi_os_printf (" Range minimum base: %08X\n",
386 memory24_data->min_base_address); 433 memory24_data->min_base_address);
387 434
388 acpi_os_printf (" Range maximum base: %08X\n", 435 acpi_os_printf (" Range maximum base: %08X\n",
389 memory24_data->max_base_address); 436 memory24_data->max_base_address);
390 437
391 acpi_os_printf (" Alignment: %08X\n", 438 acpi_os_printf (" Alignment: %08X\n", memory24_data->alignment);
392 memory24_data->alignment);
393 439
394 acpi_os_printf (" Range length: %08X\n", 440 acpi_os_printf (" Range length: %08X\n", memory24_data->range_length);
395 memory24_data->range_length);
396 441
397 return; 442 return;
398} 443}
@@ -410,7 +455,7 @@ acpi_rs_dump_memory24 (
410 * 455 *
411 ******************************************************************************/ 456 ******************************************************************************/
412 457
413void 458static void
414acpi_rs_dump_memory32 ( 459acpi_rs_dump_memory32 (
415 union acpi_resource_data *data) 460 union acpi_resource_data *data)
416{ 461{
@@ -423,21 +468,19 @@ acpi_rs_dump_memory32 (
423 acpi_os_printf ("32-Bit Memory Range Resource\n"); 468 acpi_os_printf ("32-Bit Memory Range Resource\n");
424 469
425 acpi_os_printf (" Read%s\n", 470 acpi_os_printf (" Read%s\n",
426 ACPI_READ_WRITE_MEMORY == 471 ACPI_READ_WRITE_MEMORY ==
427 memory32_data->read_write_attribute ? 472 memory32_data->read_write_attribute ?
428 "/Write" : " only"); 473 "/Write" : " only");
429 474
430 acpi_os_printf (" Range minimum base: %08X\n", 475 acpi_os_printf (" Range minimum base: %08X\n",
431 memory32_data->min_base_address); 476 memory32_data->min_base_address);
432 477
433 acpi_os_printf (" Range maximum base: %08X\n", 478 acpi_os_printf (" Range maximum base: %08X\n",
434 memory32_data->max_base_address); 479 memory32_data->max_base_address);
435 480
436 acpi_os_printf (" Alignment: %08X\n", 481 acpi_os_printf (" Alignment: %08X\n", memory32_data->alignment);
437 memory32_data->alignment);
438 482
439 acpi_os_printf (" Range length: %08X\n", 483 acpi_os_printf (" Range length: %08X\n", memory32_data->range_length);
440 memory32_data->range_length);
441 484
442 return; 485 return;
443} 486}
@@ -455,11 +498,12 @@ acpi_rs_dump_memory32 (
455 * 498 *
456 ******************************************************************************/ 499 ******************************************************************************/
457 500
458void 501static void
459acpi_rs_dump_fixed_memory32 ( 502acpi_rs_dump_fixed_memory32 (
460 union acpi_resource_data *data) 503 union acpi_resource_data *data)
461{ 504{
462 struct acpi_resource_fixed_mem32 *fixed_memory32_data = (struct acpi_resource_fixed_mem32 *) data; 505 struct acpi_resource_fixed_mem32 *fixed_memory32_data =
506 (struct acpi_resource_fixed_mem32 *) data;
463 507
464 508
465 ACPI_FUNCTION_ENTRY (); 509 ACPI_FUNCTION_ENTRY ();
@@ -468,15 +512,14 @@ acpi_rs_dump_fixed_memory32 (
468 acpi_os_printf ("32-Bit Fixed Location Memory Range Resource\n"); 512 acpi_os_printf ("32-Bit Fixed Location Memory Range Resource\n");
469 513
470 acpi_os_printf (" Read%s\n", 514 acpi_os_printf (" Read%s\n",
471 ACPI_READ_WRITE_MEMORY == 515 ACPI_READ_WRITE_MEMORY ==
472 fixed_memory32_data->read_write_attribute ? 516 fixed_memory32_data->read_write_attribute ? "/Write" : " Only");
473 "/Write" : " Only");
474 517
475 acpi_os_printf (" Range base address: %08X\n", 518 acpi_os_printf (" Range base address: %08X\n",
476 fixed_memory32_data->range_base_address); 519 fixed_memory32_data->range_base_address);
477 520
478 acpi_os_printf (" Range length: %08X\n", 521 acpi_os_printf (" Range length: %08X\n",
479 fixed_memory32_data->range_length); 522 fixed_memory32_data->range_length);
480 523
481 return; 524 return;
482} 525}
@@ -494,7 +537,7 @@ acpi_rs_dump_fixed_memory32 (
494 * 537 *
495 ******************************************************************************/ 538 ******************************************************************************/
496 539
497void 540static void
498acpi_rs_dump_address16 ( 541acpi_rs_dump_address16 (
499 union acpi_resource_data *data) 542 union acpi_resource_data *data)
500{ 543{
@@ -514,35 +557,30 @@ acpi_rs_dump_address16 (
514 557
515 switch (address16_data->attribute.memory.cache_attribute) { 558 switch (address16_data->attribute.memory.cache_attribute) {
516 case ACPI_NON_CACHEABLE_MEMORY: 559 case ACPI_NON_CACHEABLE_MEMORY:
517 acpi_os_printf (" Type Specific: " 560 acpi_os_printf (" Type Specific: Noncacheable memory\n");
518 "Noncacheable memory\n");
519 break; 561 break;
520 562
521 case ACPI_CACHABLE_MEMORY: 563 case ACPI_CACHABLE_MEMORY:
522 acpi_os_printf (" Type Specific: " 564 acpi_os_printf (" Type Specific: Cacheable memory\n");
523 "Cacheable memory\n");
524 break; 565 break;
525 566
526 case ACPI_WRITE_COMBINING_MEMORY: 567 case ACPI_WRITE_COMBINING_MEMORY:
527 acpi_os_printf (" Type Specific: " 568 acpi_os_printf (" Type Specific: Write-combining memory\n");
528 "Write-combining memory\n");
529 break; 569 break;
530 570
531 case ACPI_PREFETCHABLE_MEMORY: 571 case ACPI_PREFETCHABLE_MEMORY:
532 acpi_os_printf (" Type Specific: " 572 acpi_os_printf (" Type Specific: Prefetchable memory\n");
533 "Prefetchable memory\n");
534 break; 573 break;
535 574
536 default: 575 default:
537 acpi_os_printf (" Type Specific: " 576 acpi_os_printf (" Type Specific: Invalid cache attribute\n");
538 "Invalid cache attribute\n");
539 break; 577 break;
540 } 578 }
541 579
542 acpi_os_printf (" Type Specific: Read%s\n", 580 acpi_os_printf (" Type Specific: Read%s\n",
543 ACPI_READ_WRITE_MEMORY == 581 ACPI_READ_WRITE_MEMORY ==
544 address16_data->attribute.memory.read_write_attribute ? 582 address16_data->attribute.memory.read_write_attribute ?
545 "/Write" : " Only"); 583 "/Write" : " Only");
546 break; 584 break;
547 585
548 case ACPI_IO_RANGE: 586 case ACPI_IO_RANGE:
@@ -551,30 +589,26 @@ acpi_rs_dump_address16 (
551 589
552 switch (address16_data->attribute.io.range_attribute) { 590 switch (address16_data->attribute.io.range_attribute) {
553 case ACPI_NON_ISA_ONLY_RANGES: 591 case ACPI_NON_ISA_ONLY_RANGES:
554 acpi_os_printf (" Type Specific: " 592 acpi_os_printf (" Type Specific: Non-ISA Io Addresses\n");
555 "Non-ISA Io Addresses\n");
556 break; 593 break;
557 594
558 case ACPI_ISA_ONLY_RANGES: 595 case ACPI_ISA_ONLY_RANGES:
559 acpi_os_printf (" Type Specific: " 596 acpi_os_printf (" Type Specific: ISA Io Addresses\n");
560 "ISA Io Addresses\n");
561 break; 597 break;
562 598
563 case ACPI_ENTIRE_RANGE: 599 case ACPI_ENTIRE_RANGE:
564 acpi_os_printf (" Type Specific: " 600 acpi_os_printf (" Type Specific: ISA and non-ISA Io Addresses\n");
565 "ISA and non-ISA Io Addresses\n");
566 break; 601 break;
567 602
568 default: 603 default:
569 acpi_os_printf (" Type Specific: " 604 acpi_os_printf (" Type Specific: Invalid range attribute\n");
570 "Invalid range attribute\n");
571 break; 605 break;
572 } 606 }
573 607
574 acpi_os_printf (" Type Specific: %s Translation\n", 608 acpi_os_printf (" Type Specific: %s Translation\n",
575 ACPI_SPARSE_TRANSLATION == 609 ACPI_SPARSE_TRANSLATION ==
576 address16_data->attribute.io.translation_attribute ? 610 address16_data->attribute.io.translation_attribute ?
577 "Sparse" : "Dense"); 611 "Sparse" : "Dense");
578 break; 612 break;
579 613
580 case ACPI_BUS_NUMBER_RANGE: 614 case ACPI_BUS_NUMBER_RANGE:
@@ -589,41 +623,42 @@ acpi_rs_dump_address16 (
589 } 623 }
590 624
591 acpi_os_printf (" Resource %s\n", 625 acpi_os_printf (" Resource %s\n",
592 ACPI_CONSUMER == address16_data->producer_consumer ? 626 ACPI_CONSUMER == address16_data->producer_consumer ?
593 "Consumer" : "Producer"); 627 "Consumer" : "Producer");
594 628
595 acpi_os_printf (" %s decode\n", 629 acpi_os_printf (" %s decode\n",
596 ACPI_SUB_DECODE == address16_data->decode ? 630 ACPI_SUB_DECODE == address16_data->decode ?
597 "Subtractive" : "Positive"); 631 "Subtractive" : "Positive");
598 632
599 acpi_os_printf (" Min address is %s fixed\n", 633 acpi_os_printf (" Min address is %s fixed\n",
600 ACPI_ADDRESS_FIXED == address16_data->min_address_fixed ? 634 ACPI_ADDRESS_FIXED == address16_data->min_address_fixed ?
601 "" : "not"); 635 "" : "not");
602 636
603 acpi_os_printf (" Max address is %s fixed\n", 637 acpi_os_printf (" Max address is %s fixed\n",
604 ACPI_ADDRESS_FIXED == address16_data->max_address_fixed ? 638 ACPI_ADDRESS_FIXED == address16_data->max_address_fixed ?
605 "" : "not"); 639 "" : "not");
606 640
607 acpi_os_printf (" Granularity: %08X\n", 641 acpi_os_printf (" Granularity: %08X\n",
608 address16_data->granularity); 642 address16_data->granularity);
609 643
610 acpi_os_printf (" Address range min: %08X\n", 644 acpi_os_printf (" Address range min: %08X\n",
611 address16_data->min_address_range); 645 address16_data->min_address_range);
612 646
613 acpi_os_printf (" Address range max: %08X\n", 647 acpi_os_printf (" Address range max: %08X\n",
614 address16_data->max_address_range); 648 address16_data->max_address_range);
615 649
616 acpi_os_printf (" Address translation offset: %08X\n", 650 acpi_os_printf (" Address translation offset: %08X\n",
617 address16_data->address_translation_offset); 651 address16_data->address_translation_offset);
618 652
619 acpi_os_printf (" Address Length: %08X\n", 653 acpi_os_printf (" Address Length: %08X\n",
620 address16_data->address_length); 654 address16_data->address_length);
621 655
622 if (0xFF != address16_data->resource_source.index) { 656 if (0xFF != address16_data->resource_source.index) {
623 acpi_os_printf (" Resource Source Index: %X\n", 657 acpi_os_printf (" Resource Source Index: %X\n",
624 address16_data->resource_source.index); 658 address16_data->resource_source.index);
659
625 acpi_os_printf (" Resource Source: %s\n", 660 acpi_os_printf (" Resource Source: %s\n",
626 address16_data->resource_source.string_ptr); 661 address16_data->resource_source.string_ptr);
627 } 662 }
628 663
629 return; 664 return;
@@ -642,7 +677,7 @@ acpi_rs_dump_address16 (
642 * 677 *
643 ******************************************************************************/ 678 ******************************************************************************/
644 679
645void 680static void
646acpi_rs_dump_address32 ( 681acpi_rs_dump_address32 (
647 union acpi_resource_data *data) 682 union acpi_resource_data *data)
648{ 683{
@@ -661,35 +696,30 @@ acpi_rs_dump_address32 (
661 696
662 switch (address32_data->attribute.memory.cache_attribute) { 697 switch (address32_data->attribute.memory.cache_attribute) {
663 case ACPI_NON_CACHEABLE_MEMORY: 698 case ACPI_NON_CACHEABLE_MEMORY:
664 acpi_os_printf (" Type Specific: " 699 acpi_os_printf (" Type Specific: Noncacheable memory\n");
665 "Noncacheable memory\n");
666 break; 700 break;
667 701
668 case ACPI_CACHABLE_MEMORY: 702 case ACPI_CACHABLE_MEMORY:
669 acpi_os_printf (" Type Specific: " 703 acpi_os_printf (" Type Specific: Cacheable memory\n");
670 "Cacheable memory\n");
671 break; 704 break;
672 705
673 case ACPI_WRITE_COMBINING_MEMORY: 706 case ACPI_WRITE_COMBINING_MEMORY:
674 acpi_os_printf (" Type Specific: " 707 acpi_os_printf (" Type Specific: Write-combining memory\n");
675 "Write-combining memory\n");
676 break; 708 break;
677 709
678 case ACPI_PREFETCHABLE_MEMORY: 710 case ACPI_PREFETCHABLE_MEMORY:
679 acpi_os_printf (" Type Specific: " 711 acpi_os_printf (" Type Specific: Prefetchable memory\n");
680 "Prefetchable memory\n");
681 break; 712 break;
682 713
683 default: 714 default:
684 acpi_os_printf (" Type Specific: " 715 acpi_os_printf (" Type Specific: Invalid cache attribute\n");
685 "Invalid cache attribute\n");
686 break; 716 break;
687 } 717 }
688 718
689 acpi_os_printf (" Type Specific: Read%s\n", 719 acpi_os_printf (" Type Specific: Read%s\n",
690 ACPI_READ_WRITE_MEMORY == 720 ACPI_READ_WRITE_MEMORY ==
691 address32_data->attribute.memory.read_write_attribute ? 721 address32_data->attribute.memory.read_write_attribute ?
692 "/Write" : " Only"); 722 "/Write" : " Only");
693 break; 723 break;
694 724
695 case ACPI_IO_RANGE: 725 case ACPI_IO_RANGE:
@@ -698,30 +728,26 @@ acpi_rs_dump_address32 (
698 728
699 switch (address32_data->attribute.io.range_attribute) { 729 switch (address32_data->attribute.io.range_attribute) {
700 case ACPI_NON_ISA_ONLY_RANGES: 730 case ACPI_NON_ISA_ONLY_RANGES:
701 acpi_os_printf (" Type Specific: " 731 acpi_os_printf (" Type Specific: Non-ISA Io Addresses\n");
702 "Non-ISA Io Addresses\n");
703 break; 732 break;
704 733
705 case ACPI_ISA_ONLY_RANGES: 734 case ACPI_ISA_ONLY_RANGES:
706 acpi_os_printf (" Type Specific: " 735 acpi_os_printf (" Type Specific: ISA Io Addresses\n");
707 "ISA Io Addresses\n");
708 break; 736 break;
709 737
710 case ACPI_ENTIRE_RANGE: 738 case ACPI_ENTIRE_RANGE:
711 acpi_os_printf (" Type Specific: " 739 acpi_os_printf (" Type Specific: ISA and non-ISA Io Addresses\n");
712 "ISA and non-ISA Io Addresses\n");
713 break; 740 break;
714 741
715 default: 742 default:
716 acpi_os_printf (" Type Specific: " 743 acpi_os_printf (" Type Specific: Invalid Range attribute");
717 "Invalid Range attribute");
718 break; 744 break;
719 } 745 }
720 746
721 acpi_os_printf (" Type Specific: %s Translation\n", 747 acpi_os_printf (" Type Specific: %s Translation\n",
722 ACPI_SPARSE_TRANSLATION == 748 ACPI_SPARSE_TRANSLATION ==
723 address32_data->attribute.io.translation_attribute ? 749 address32_data->attribute.io.translation_attribute ?
724 "Sparse" : "Dense"); 750 "Sparse" : "Dense");
725 break; 751 break;
726 752
727 case ACPI_BUS_NUMBER_RANGE: 753 case ACPI_BUS_NUMBER_RANGE:
@@ -731,46 +757,48 @@ acpi_rs_dump_address32 (
731 757
732 default: 758 default:
733 759
734 acpi_os_printf (" Resource Type: 0x%2.2X\n", address32_data->resource_type); 760 acpi_os_printf (" Resource Type: 0x%2.2X\n",
761 address32_data->resource_type);
735 break; 762 break;
736 } 763 }
737 764
738 acpi_os_printf (" Resource %s\n", 765 acpi_os_printf (" Resource %s\n",
739 ACPI_CONSUMER == address32_data->producer_consumer ? 766 ACPI_CONSUMER == address32_data->producer_consumer ?
740 "Consumer" : "Producer"); 767 "Consumer" : "Producer");
741 768
742 acpi_os_printf (" %s decode\n", 769 acpi_os_printf (" %s decode\n",
743 ACPI_SUB_DECODE == address32_data->decode ? 770 ACPI_SUB_DECODE == address32_data->decode ?
744 "Subtractive" : "Positive"); 771 "Subtractive" : "Positive");
745 772
746 acpi_os_printf (" Min address is %s fixed\n", 773 acpi_os_printf (" Min address is %s fixed\n",
747 ACPI_ADDRESS_FIXED == address32_data->min_address_fixed ? 774 ACPI_ADDRESS_FIXED == address32_data->min_address_fixed ?
748 "" : "not "); 775 "" : "not ");
749 776
750 acpi_os_printf (" Max address is %s fixed\n", 777 acpi_os_printf (" Max address is %s fixed\n",
751 ACPI_ADDRESS_FIXED == address32_data->max_address_fixed ? 778 ACPI_ADDRESS_FIXED == address32_data->max_address_fixed ?
752 "" : "not "); 779 "" : "not ");
753 780
754 acpi_os_printf (" Granularity: %08X\n", 781 acpi_os_printf (" Granularity: %08X\n",
755 address32_data->granularity); 782 address32_data->granularity);
756 783
757 acpi_os_printf (" Address range min: %08X\n", 784 acpi_os_printf (" Address range min: %08X\n",
758 address32_data->min_address_range); 785 address32_data->min_address_range);
759 786
760 acpi_os_printf (" Address range max: %08X\n", 787 acpi_os_printf (" Address range max: %08X\n",
761 address32_data->max_address_range); 788 address32_data->max_address_range);
762 789
763 acpi_os_printf (" Address translation offset: %08X\n", 790 acpi_os_printf (" Address translation offset: %08X\n",
764 address32_data->address_translation_offset); 791 address32_data->address_translation_offset);
765 792
766 acpi_os_printf (" Address Length: %08X\n", 793 acpi_os_printf (" Address Length: %08X\n",
767 address32_data->address_length); 794 address32_data->address_length);
768 795
769 if(0xFF != address32_data->resource_source.index) { 796 if(0xFF != address32_data->resource_source.index) {
770 acpi_os_printf (" Resource Source Index: %X\n", 797 acpi_os_printf (" Resource Source Index: %X\n",
771 address32_data->resource_source.index); 798 address32_data->resource_source.index);
799
772 acpi_os_printf (" Resource Source: %s\n", 800 acpi_os_printf (" Resource Source: %s\n",
773 address32_data->resource_source.string_ptr); 801 address32_data->resource_source.string_ptr);
774 } 802 }
775 803
776 return; 804 return;
@@ -789,7 +817,7 @@ acpi_rs_dump_address32 (
789 * 817 *
790 ******************************************************************************/ 818 ******************************************************************************/
791 819
792void 820static void
793acpi_rs_dump_address64 ( 821acpi_rs_dump_address64 (
794 union acpi_resource_data *data) 822 union acpi_resource_data *data)
795{ 823{
@@ -808,35 +836,30 @@ acpi_rs_dump_address64 (
808 836
809 switch (address64_data->attribute.memory.cache_attribute) { 837 switch (address64_data->attribute.memory.cache_attribute) {
810 case ACPI_NON_CACHEABLE_MEMORY: 838 case ACPI_NON_CACHEABLE_MEMORY:
811 acpi_os_printf (" Type Specific: " 839 acpi_os_printf (" Type Specific: Noncacheable memory\n");
812 "Noncacheable memory\n");
813 break; 840 break;
814 841
815 case ACPI_CACHABLE_MEMORY: 842 case ACPI_CACHABLE_MEMORY:
816 acpi_os_printf (" Type Specific: " 843 acpi_os_printf (" Type Specific: Cacheable memory\n");
817 "Cacheable memory\n");
818 break; 844 break;
819 845
820 case ACPI_WRITE_COMBINING_MEMORY: 846 case ACPI_WRITE_COMBINING_MEMORY:
821 acpi_os_printf (" Type Specific: " 847 acpi_os_printf (" Type Specific: Write-combining memory\n");
822 "Write-combining memory\n");
823 break; 848 break;
824 849
825 case ACPI_PREFETCHABLE_MEMORY: 850 case ACPI_PREFETCHABLE_MEMORY:
826 acpi_os_printf (" Type Specific: " 851 acpi_os_printf (" Type Specific: Prefetchable memory\n");
827 "Prefetchable memory\n");
828 break; 852 break;
829 853
830 default: 854 default:
831 acpi_os_printf (" Type Specific: " 855 acpi_os_printf (" Type Specific: Invalid cache attribute\n");
832 "Invalid cache attribute\n");
833 break; 856 break;
834 } 857 }
835 858
836 acpi_os_printf (" Type Specific: Read%s\n", 859 acpi_os_printf (" Type Specific: Read%s\n",
837 ACPI_READ_WRITE_MEMORY == 860 ACPI_READ_WRITE_MEMORY ==
838 address64_data->attribute.memory.read_write_attribute ? 861 address64_data->attribute.memory.read_write_attribute ?
839 "/Write" : " Only"); 862 "/Write" : " Only");
840 break; 863 break;
841 864
842 case ACPI_IO_RANGE: 865 case ACPI_IO_RANGE:
@@ -845,30 +868,26 @@ acpi_rs_dump_address64 (
845 868
846 switch (address64_data->attribute.io.range_attribute) { 869 switch (address64_data->attribute.io.range_attribute) {
847 case ACPI_NON_ISA_ONLY_RANGES: 870 case ACPI_NON_ISA_ONLY_RANGES:
848 acpi_os_printf (" Type Specific: " 871 acpi_os_printf (" Type Specific: Non-ISA Io Addresses\n");
849 "Non-ISA Io Addresses\n");
850 break; 872 break;
851 873
852 case ACPI_ISA_ONLY_RANGES: 874 case ACPI_ISA_ONLY_RANGES:
853 acpi_os_printf (" Type Specific: " 875 acpi_os_printf (" Type Specific: ISA Io Addresses\n");
854 "ISA Io Addresses\n");
855 break; 876 break;
856 877
857 case ACPI_ENTIRE_RANGE: 878 case ACPI_ENTIRE_RANGE:
858 acpi_os_printf (" Type Specific: " 879 acpi_os_printf (" Type Specific: ISA and non-ISA Io Addresses\n");
859 "ISA and non-ISA Io Addresses\n");
860 break; 880 break;
861 881
862 default: 882 default:
863 acpi_os_printf (" Type Specific: " 883 acpi_os_printf (" Type Specific: Invalid Range attribute");
864 "Invalid Range attribute");
865 break; 884 break;
866 } 885 }
867 886
868 acpi_os_printf (" Type Specific: %s Translation\n", 887 acpi_os_printf (" Type Specific: %s Translation\n",
869 ACPI_SPARSE_TRANSLATION == 888 ACPI_SPARSE_TRANSLATION ==
870 address64_data->attribute.io.translation_attribute ? 889 address64_data->attribute.io.translation_attribute ?
871 "Sparse" : "Dense"); 890 "Sparse" : "Dense");
872 break; 891 break;
873 892
874 case ACPI_BUS_NUMBER_RANGE: 893 case ACPI_BUS_NUMBER_RANGE:
@@ -878,49 +897,51 @@ acpi_rs_dump_address64 (
878 897
879 default: 898 default:
880 899
881 acpi_os_printf (" Resource Type: 0x%2.2X\n", address64_data->resource_type); 900 acpi_os_printf (" Resource Type: 0x%2.2X\n",
901 address64_data->resource_type);
882 break; 902 break;
883 } 903 }
884 904
885 acpi_os_printf (" Resource %s\n", 905 acpi_os_printf (" Resource %s\n",
886 ACPI_CONSUMER == address64_data->producer_consumer ? 906 ACPI_CONSUMER == address64_data->producer_consumer ?
887 "Consumer" : "Producer"); 907 "Consumer" : "Producer");
888 908
889 acpi_os_printf (" %s decode\n", 909 acpi_os_printf (" %s decode\n",
890 ACPI_SUB_DECODE == address64_data->decode ? 910 ACPI_SUB_DECODE == address64_data->decode ?
891 "Subtractive" : "Positive"); 911 "Subtractive" : "Positive");
892 912
893 acpi_os_printf (" Min address is %s fixed\n", 913 acpi_os_printf (" Min address is %s fixed\n",
894 ACPI_ADDRESS_FIXED == address64_data->min_address_fixed ? 914 ACPI_ADDRESS_FIXED == address64_data->min_address_fixed ?
895 "" : "not "); 915 "" : "not ");
896 916
897 acpi_os_printf (" Max address is %s fixed\n", 917 acpi_os_printf (" Max address is %s fixed\n",
898 ACPI_ADDRESS_FIXED == address64_data->max_address_fixed ? 918 ACPI_ADDRESS_FIXED == address64_data->max_address_fixed ?
899 "" : "not "); 919 "" : "not ");
900 920
901 acpi_os_printf (" Granularity: %8.8X%8.8X\n", 921 acpi_os_printf (" Granularity: %8.8X%8.8X\n",
902 ACPI_FORMAT_UINT64 (address64_data->granularity)); 922 ACPI_FORMAT_UINT64 (address64_data->granularity));
903 923
904 acpi_os_printf (" Address range min: %8.8X%8.8X\n", 924 acpi_os_printf (" Address range min: %8.8X%8.8X\n",
905 ACPI_FORMAT_UINT64 (address64_data->min_address_range)); 925 ACPI_FORMAT_UINT64 (address64_data->min_address_range));
906 926
907 acpi_os_printf (" Address range max: %8.8X%8.8X\n", 927 acpi_os_printf (" Address range max: %8.8X%8.8X\n",
908 ACPI_FORMAT_UINT64 (address64_data->max_address_range)); 928 ACPI_FORMAT_UINT64 (address64_data->max_address_range));
909 929
910 acpi_os_printf (" Address translation offset: %8.8X%8.8X\n", 930 acpi_os_printf (" Address translation offset: %8.8X%8.8X\n",
911 ACPI_FORMAT_UINT64 (address64_data->address_translation_offset)); 931 ACPI_FORMAT_UINT64 (address64_data->address_translation_offset));
912 932
913 acpi_os_printf (" Address Length: %8.8X%8.8X\n", 933 acpi_os_printf (" Address Length: %8.8X%8.8X\n",
914 ACPI_FORMAT_UINT64 (address64_data->address_length)); 934 ACPI_FORMAT_UINT64 (address64_data->address_length));
915 935
916 acpi_os_printf (" Type Specific Attributes: %8.8X%8.8X\n", 936 acpi_os_printf (" Type Specific Attributes: %8.8X%8.8X\n",
917 ACPI_FORMAT_UINT64 (address64_data->type_specific_attributes)); 937 ACPI_FORMAT_UINT64 (address64_data->type_specific_attributes));
918 938
919 if (0xFF != address64_data->resource_source.index) { 939 if (0xFF != address64_data->resource_source.index) {
920 acpi_os_printf (" Resource Source Index: %X\n", 940 acpi_os_printf (" Resource Source Index: %X\n",
921 address64_data->resource_source.index); 941 address64_data->resource_source.index);
942
922 acpi_os_printf (" Resource Source: %s\n", 943 acpi_os_printf (" Resource Source: %s\n",
923 address64_data->resource_source.string_ptr); 944 address64_data->resource_source.string_ptr);
924 } 945 }
925 946
926 return; 947 return;
@@ -939,7 +960,7 @@ acpi_rs_dump_address64 (
939 * 960 *
940 ******************************************************************************/ 961 ******************************************************************************/
941 962
942void 963static void
943acpi_rs_dump_extended_irq ( 964acpi_rs_dump_extended_irq (
944 union acpi_resource_data *data) 965 union acpi_resource_data *data)
945{ 966{
@@ -953,23 +974,22 @@ acpi_rs_dump_extended_irq (
953 acpi_os_printf ("Extended IRQ Resource\n"); 974 acpi_os_printf ("Extended IRQ Resource\n");
954 975
955 acpi_os_printf (" Resource %s\n", 976 acpi_os_printf (" Resource %s\n",
956 ACPI_CONSUMER == ext_irq_data->producer_consumer ? 977 ACPI_CONSUMER == ext_irq_data->producer_consumer ?
957 "Consumer" : "Producer"); 978 "Consumer" : "Producer");
958 979
959 acpi_os_printf (" %s\n", 980 acpi_os_printf (" %s\n",
960 ACPI_LEVEL_SENSITIVE == ext_irq_data->edge_level ? 981 ACPI_LEVEL_SENSITIVE == ext_irq_data->edge_level ?
961 "Level" : "Edge"); 982 "Level" : "Edge");
962 983
963 acpi_os_printf (" Active %s\n", 984 acpi_os_printf (" Active %s\n",
964 ACPI_ACTIVE_LOW == ext_irq_data->active_high_low ? 985 ACPI_ACTIVE_LOW == ext_irq_data->active_high_low ?
965 "low" : "high"); 986 "low" : "high");
966 987
967 acpi_os_printf (" %s\n", 988 acpi_os_printf (" %s\n",
968 ACPI_SHARED == ext_irq_data->shared_exclusive ? 989 ACPI_SHARED == ext_irq_data->shared_exclusive ?
969 "Shared" : "Exclusive"); 990 "Shared" : "Exclusive");
970 991
971 acpi_os_printf (" Interrupts : %X ( ", 992 acpi_os_printf (" Interrupts : %X ( ", ext_irq_data->number_of_interrupts);
972 ext_irq_data->number_of_interrupts);
973 993
974 for (index = 0; index < ext_irq_data->number_of_interrupts; index++) { 994 for (index = 0; index < ext_irq_data->number_of_interrupts; index++) {
975 acpi_os_printf ("%X ", ext_irq_data->interrupts[index]); 995 acpi_os_printf ("%X ", ext_irq_data->interrupts[index]);
@@ -979,9 +999,10 @@ acpi_rs_dump_extended_irq (
979 999
980 if(0xFF != ext_irq_data->resource_source.index) { 1000 if(0xFF != ext_irq_data->resource_source.index) {
981 acpi_os_printf (" Resource Source Index: %X", 1001 acpi_os_printf (" Resource Source Index: %X",
982 ext_irq_data->resource_source.index); 1002 ext_irq_data->resource_source.index);
1003
983 acpi_os_printf (" Resource Source: %s", 1004 acpi_os_printf (" Resource Source: %s",
984 ext_irq_data->resource_source.string_ptr); 1005 ext_irq_data->resource_source.string_ptr);
985 } 1006 }
986 1007
987 return; 1008 return;
@@ -992,7 +1013,7 @@ acpi_rs_dump_extended_irq (
992 * 1013 *
993 * FUNCTION: acpi_rs_dump_resource_list 1014 * FUNCTION: acpi_rs_dump_resource_list
994 * 1015 *
995 * PARAMETERS: Data - pointer to the resource structure to dump. 1016 * PARAMETERS: Resource - pointer to the resource structure to dump.
996 * 1017 *
997 * RETURN: None 1018 * RETURN: None
998 * 1019 *
@@ -1096,7 +1117,7 @@ acpi_rs_dump_resource_list (
1096 * 1117 *
1097 * FUNCTION: acpi_rs_dump_irq_list 1118 * FUNCTION: acpi_rs_dump_irq_list
1098 * 1119 *
1099 * PARAMETERS: Data - pointer to the routing table to dump. 1120 * PARAMETERS: route_table - pointer to the routing table to dump.
1100 * 1121 *
1101 * RETURN: None 1122 * RETURN: None
1102 * 1123 *
@@ -1124,20 +1145,17 @@ acpi_rs_dump_irq_list (
1124 acpi_os_printf ("PCI IRQ Routing Table structure %X.\n", count++); 1145 acpi_os_printf ("PCI IRQ Routing Table structure %X.\n", count++);
1125 1146
1126 acpi_os_printf (" Address: %8.8X%8.8X\n", 1147 acpi_os_printf (" Address: %8.8X%8.8X\n",
1127 ACPI_FORMAT_UINT64 (prt_element->address)); 1148 ACPI_FORMAT_UINT64 (prt_element->address));
1128 1149
1129 acpi_os_printf (" Pin: %X\n", prt_element->pin); 1150 acpi_os_printf (" Pin: %X\n", prt_element->pin);
1130 1151
1131 acpi_os_printf (" Source: %s\n", prt_element->source); 1152 acpi_os_printf (" Source: %s\n", prt_element->source);
1132 1153
1133 acpi_os_printf (" source_index: %X\n", 1154 acpi_os_printf (" source_index: %X\n", prt_element->source_index);
1134 prt_element->source_index);
1135 1155
1136 buffer += prt_element->length; 1156 buffer += prt_element->length;
1137
1138 prt_element = ACPI_CAST_PTR (struct acpi_pci_routing_table, buffer); 1157 prt_element = ACPI_CAST_PTR (struct acpi_pci_routing_table, buffer);
1139 1158 if (0 == prt_element->length) {
1140 if(0 == prt_element->length) {
1141 done = TRUE; 1159 done = TRUE;
1142 } 1160 }
1143 } 1161 }
diff --git a/drivers/acpi/resources/rsio.c b/drivers/acpi/resources/rsio.c
index 972c746d37e4..23a4d149fac8 100644
--- a/drivers/acpi/resources/rsio.c
+++ b/drivers/acpi/resources/rsio.c
@@ -81,67 +81,60 @@ acpi_rs_io_resource (
81 struct acpi_resource *output_struct = (void *) *output_buffer; 81 struct acpi_resource *output_struct = (void *) *output_buffer;
82 u16 temp16 = 0; 82 u16 temp16 = 0;
83 u8 temp8 = 0; 83 u8 temp8 = 0;
84 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_io); 84 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (
85 struct acpi_resource_io);
85 86
86 87
87 ACPI_FUNCTION_TRACE ("rs_io_resource"); 88 ACPI_FUNCTION_TRACE ("rs_io_resource");
88 89
89 90
90 /* 91 /* The number of bytes consumed are Constant */
91 * The number of bytes consumed are Constant 92
92 */
93 *bytes_consumed = 8; 93 *bytes_consumed = 8;
94 94
95 output_struct->id = ACPI_RSTYPE_IO; 95 output_struct->id = ACPI_RSTYPE_IO;
96 96
97 /* 97 /* Check Decode */
98 * Check Decode 98
99 */
100 buffer += 1; 99 buffer += 1;
101 temp8 = *buffer; 100 temp8 = *buffer;
102 101
103 output_struct->data.io.io_decode = temp8 & 0x01; 102 output_struct->data.io.io_decode = temp8 & 0x01;
104 103
105 /* 104 /* Check min_base Address */
106 * Check min_base Address 105
107 */
108 buffer += 1; 106 buffer += 1;
109 ACPI_MOVE_16_TO_16 (&temp16, buffer); 107 ACPI_MOVE_16_TO_16 (&temp16, buffer);
110 108
111 output_struct->data.io.min_base_address = temp16; 109 output_struct->data.io.min_base_address = temp16;
112 110
113 /* 111 /* Check max_base Address */
114 * Check max_base Address 112
115 */
116 buffer += 2; 113 buffer += 2;
117 ACPI_MOVE_16_TO_16 (&temp16, buffer); 114 ACPI_MOVE_16_TO_16 (&temp16, buffer);
118 115
119 output_struct->data.io.max_base_address = temp16; 116 output_struct->data.io.max_base_address = temp16;
120 117
121 /* 118 /* Check Base alignment */
122 * Check Base alignment 119
123 */
124 buffer += 2; 120 buffer += 2;
125 temp8 = *buffer; 121 temp8 = *buffer;
126 122
127 output_struct->data.io.alignment = temp8; 123 output_struct->data.io.alignment = temp8;
128 124
129 /* 125 /* Check range_length */
130 * Check range_length 126
131 */
132 buffer += 1; 127 buffer += 1;
133 temp8 = *buffer; 128 temp8 = *buffer;
134 129
135 output_struct->data.io.range_length = temp8; 130 output_struct->data.io.range_length = temp8;
136 131
137 /* 132 /* Set the Length parameter */
138 * Set the Length parameter 133
139 */
140 output_struct->length = (u32) struct_size; 134 output_struct->length = (u32) struct_size;
141 135
142 /* 136 /* Return the final size of the structure */
143 * Return the final size of the structure 137
144 */
145 *structure_size = struct_size; 138 *structure_size = struct_size;
146 return_ACPI_STATUS (AE_OK); 139 return_ACPI_STATUS (AE_OK);
147} 140}
@@ -179,43 +172,39 @@ acpi_rs_fixed_io_resource (
179 struct acpi_resource *output_struct = (void *) *output_buffer; 172 struct acpi_resource *output_struct = (void *) *output_buffer;
180 u16 temp16 = 0; 173 u16 temp16 = 0;
181 u8 temp8 = 0; 174 u8 temp8 = 0;
182 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_fixed_io); 175 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (
176 struct acpi_resource_fixed_io);
183 177
184 178
185 ACPI_FUNCTION_TRACE ("rs_fixed_io_resource"); 179 ACPI_FUNCTION_TRACE ("rs_fixed_io_resource");
186 180
187 181
188 /* 182 /* The number of bytes consumed are Constant */
189 * The number of bytes consumed are Constant 183
190 */
191 *bytes_consumed = 4; 184 *bytes_consumed = 4;
192 185
193 output_struct->id = ACPI_RSTYPE_FIXED_IO; 186 output_struct->id = ACPI_RSTYPE_FIXED_IO;
194 187
195 /* 188 /* Check Range Base Address */
196 * Check Range Base Address 189
197 */
198 buffer += 1; 190 buffer += 1;
199 ACPI_MOVE_16_TO_16 (&temp16, buffer); 191 ACPI_MOVE_16_TO_16 (&temp16, buffer);
200 192
201 output_struct->data.fixed_io.base_address = temp16; 193 output_struct->data.fixed_io.base_address = temp16;
202 194
203 /* 195 /* Check range_length */
204 * Check range_length 196
205 */
206 buffer += 2; 197 buffer += 2;
207 temp8 = *buffer; 198 temp8 = *buffer;
208 199
209 output_struct->data.fixed_io.range_length = temp8; 200 output_struct->data.fixed_io.range_length = temp8;
210 201
211 /* 202 /* Set the Length parameter */
212 * Set the Length parameter 203
213 */
214 output_struct->length = (u32) struct_size; 204 output_struct->length = (u32) struct_size;
215 205
216 /* 206 /* Return the final size of the structure */
217 * Return the final size of the structure 207
218 */
219 *structure_size = struct_size; 208 *structure_size = struct_size;
220 return_ACPI_STATUS (AE_OK); 209 return_ACPI_STATUS (AE_OK);
221} 210}
@@ -251,55 +240,48 @@ acpi_rs_io_stream (
251 ACPI_FUNCTION_TRACE ("rs_io_stream"); 240 ACPI_FUNCTION_TRACE ("rs_io_stream");
252 241
253 242
254 /* 243 /* The descriptor field is static */
255 * The descriptor field is static 244
256 */
257 *buffer = 0x47; 245 *buffer = 0x47;
258 buffer += 1; 246 buffer += 1;
259 247
260 /* 248 /* Io Information Byte */
261 * Io Information Byte 249
262 */
263 temp8 = (u8) (linked_list->data.io.io_decode & 0x01); 250 temp8 = (u8) (linked_list->data.io.io_decode & 0x01);
264 251
265 *buffer = temp8; 252 *buffer = temp8;
266 buffer += 1; 253 buffer += 1;
267 254
268 /* 255 /* Set the Range minimum base address */
269 * Set the Range minimum base address 256
270 */
271 temp16 = (u16) linked_list->data.io.min_base_address; 257 temp16 = (u16) linked_list->data.io.min_base_address;
272 258
273 ACPI_MOVE_16_TO_16 (buffer, &temp16); 259 ACPI_MOVE_16_TO_16 (buffer, &temp16);
274 buffer += 2; 260 buffer += 2;
275 261
276 /* 262 /* Set the Range maximum base address */
277 * Set the Range maximum base address 263
278 */
279 temp16 = (u16) linked_list->data.io.max_base_address; 264 temp16 = (u16) linked_list->data.io.max_base_address;
280 265
281 ACPI_MOVE_16_TO_16 (buffer, &temp16); 266 ACPI_MOVE_16_TO_16 (buffer, &temp16);
282 buffer += 2; 267 buffer += 2;
283 268
284 /* 269 /* Set the base alignment */
285 * Set the base alignment 270
286 */
287 temp8 = (u8) linked_list->data.io.alignment; 271 temp8 = (u8) linked_list->data.io.alignment;
288 272
289 *buffer = temp8; 273 *buffer = temp8;
290 buffer += 1; 274 buffer += 1;
291 275
292 /* 276 /* Set the range length */
293 * Set the range length 277
294 */
295 temp8 = (u8) linked_list->data.io.range_length; 278 temp8 = (u8) linked_list->data.io.range_length;
296 279
297 *buffer = temp8; 280 *buffer = temp8;
298 buffer += 1; 281 buffer += 1;
299 282
300 /* 283 /* Return the number of bytes consumed in this operation */
301 * Return the number of bytes consumed in this operation 284
302 */
303 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); 285 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer);
304 return_ACPI_STATUS (AE_OK); 286 return_ACPI_STATUS (AE_OK);
305} 287}
@@ -335,32 +317,28 @@ acpi_rs_fixed_io_stream (
335 ACPI_FUNCTION_TRACE ("rs_fixed_io_stream"); 317 ACPI_FUNCTION_TRACE ("rs_fixed_io_stream");
336 318
337 319
338 /* 320 /* The descriptor field is static */
339 * The descriptor field is static 321
340 */
341 *buffer = 0x4B; 322 *buffer = 0x4B;
342 323
343 buffer += 1; 324 buffer += 1;
344 325
345 /* 326 /* Set the Range base address */
346 * Set the Range base address 327
347 */
348 temp16 = (u16) linked_list->data.fixed_io.base_address; 328 temp16 = (u16) linked_list->data.fixed_io.base_address;
349 329
350 ACPI_MOVE_16_TO_16 (buffer, &temp16); 330 ACPI_MOVE_16_TO_16 (buffer, &temp16);
351 buffer += 2; 331 buffer += 2;
352 332
353 /* 333 /* Set the range length */
354 * Set the range length 334
355 */
356 temp8 = (u8) linked_list->data.fixed_io.range_length; 335 temp8 = (u8) linked_list->data.fixed_io.range_length;
357 336
358 *buffer = temp8; 337 *buffer = temp8;
359 buffer += 1; 338 buffer += 1;
360 339
361 /* 340 /* Return the number of bytes consumed in this operation */
362 * Return the number of bytes consumed in this operation 341
363 */
364 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); 342 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer);
365 return_ACPI_STATUS (AE_OK); 343 return_ACPI_STATUS (AE_OK);
366} 344}
@@ -399,21 +377,20 @@ acpi_rs_dma_resource (
399 u8 temp8 = 0; 377 u8 temp8 = 0;
400 u8 index; 378 u8 index;
401 u8 i; 379 u8 i;
402 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_dma); 380 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (
381 struct acpi_resource_dma);
403 382
404 383
405 ACPI_FUNCTION_TRACE ("rs_dma_resource"); 384 ACPI_FUNCTION_TRACE ("rs_dma_resource");
406 385
407 386
408 /* 387 /* The number of bytes consumed are Constant */
409 * The number of bytes consumed are Constant 388
410 */
411 *bytes_consumed = 3; 389 *bytes_consumed = 3;
412 output_struct->id = ACPI_RSTYPE_DMA; 390 output_struct->id = ACPI_RSTYPE_DMA;
413 391
414 /* 392 /* Point to the 8-bits of Byte 1 */
415 * Point to the 8-bits of Byte 1 393
416 */
417 buffer += 1; 394 buffer += 1;
418 temp8 = *buffer; 395 temp8 = *buffer;
419 396
@@ -430,46 +407,40 @@ acpi_rs_dma_resource (
430 407
431 output_struct->data.dma.number_of_channels = i; 408 output_struct->data.dma.number_of_channels = i;
432 if (i > 0) { 409 if (i > 0) {
433 /* 410 /* Calculate the structure size based upon the number of interrupts */
434 * Calculate the structure size based upon the number of interrupts 411
435 */
436 struct_size += ((acpi_size) i - 1) * 4; 412 struct_size += ((acpi_size) i - 1) * 4;
437 } 413 }
438 414
439 /* 415 /* Point to Byte 2 */
440 * Point to Byte 2 416
441 */
442 buffer += 1; 417 buffer += 1;
443 temp8 = *buffer; 418 temp8 = *buffer;
444 419
445 /* 420 /* Check for transfer preference (Bits[1:0]) */
446 * Check for transfer preference (Bits[1:0]) 421
447 */
448 output_struct->data.dma.transfer = temp8 & 0x03; 422 output_struct->data.dma.transfer = temp8 & 0x03;
449 423
450 if (0x03 == output_struct->data.dma.transfer) { 424 if (0x03 == output_struct->data.dma.transfer) {
451 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid DMA.Transfer preference (3)\n")); 425 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
426 "Invalid DMA.Transfer preference (3)\n"));
452 return_ACPI_STATUS (AE_BAD_DATA); 427 return_ACPI_STATUS (AE_BAD_DATA);
453 } 428 }
454 429
455 /* 430 /* Get bus master preference (Bit[2]) */
456 * Get bus master preference (Bit[2]) 431
457 */
458 output_struct->data.dma.bus_master = (temp8 >> 2) & 0x01; 432 output_struct->data.dma.bus_master = (temp8 >> 2) & 0x01;
459 433
460 /* 434 /* Get channel speed support (Bits[6:5]) */
461 * Get channel speed support (Bits[6:5]) 435
462 */
463 output_struct->data.dma.type = (temp8 >> 5) & 0x03; 436 output_struct->data.dma.type = (temp8 >> 5) & 0x03;
464 437
465 /* 438 /* Set the Length parameter */
466 * Set the Length parameter 439
467 */
468 output_struct->length = (u32) struct_size; 440 output_struct->length = (u32) struct_size;
469 441
470 /* 442 /* Return the final size of the structure */
471 * Return the final size of the structure 443
472 */
473 *structure_size = struct_size; 444 *structure_size = struct_size;
474 return_ACPI_STATUS (AE_OK); 445 return_ACPI_STATUS (AE_OK);
475} 446}
@@ -506,16 +477,14 @@ acpi_rs_dma_stream (
506 ACPI_FUNCTION_TRACE ("rs_dma_stream"); 477 ACPI_FUNCTION_TRACE ("rs_dma_stream");
507 478
508 479
509 /* 480 /* The descriptor field is static */
510 * The descriptor field is static 481
511 */
512 *buffer = 0x2A; 482 *buffer = 0x2A;
513 buffer += 1; 483 buffer += 1;
514 temp8 = 0; 484 temp8 = 0;
515 485
516 /* 486 /* Loop through all of the Channels and set the mask bits */
517 * Loop through all of the Channels and set the mask bits 487
518 */
519 for (index = 0; 488 for (index = 0;
520 index < linked_list->data.dma.number_of_channels; 489 index < linked_list->data.dma.number_of_channels;
521 index++) { 490 index++) {
@@ -526,9 +495,8 @@ acpi_rs_dma_stream (
526 *buffer = temp8; 495 *buffer = temp8;
527 buffer += 1; 496 buffer += 1;
528 497
529 /* 498 /* Set the DMA Info */
530 * Set the DMA Info 499
531 */
532 temp8 = (u8) ((linked_list->data.dma.type & 0x03) << 5); 500 temp8 = (u8) ((linked_list->data.dma.type & 0x03) << 5);
533 temp8 |= ((linked_list->data.dma.bus_master & 0x01) << 2); 501 temp8 |= ((linked_list->data.dma.bus_master & 0x01) << 2);
534 temp8 |= (linked_list->data.dma.transfer & 0x03); 502 temp8 |= (linked_list->data.dma.transfer & 0x03);
@@ -536,9 +504,8 @@ acpi_rs_dma_stream (
536 *buffer = temp8; 504 *buffer = temp8;
537 buffer += 1; 505 buffer += 1;
538 506
539 /* 507 /* Return the number of bytes consumed in this operation */
540 * Return the number of bytes consumed in this operation 508
541 */
542 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); 509 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer);
543 return_ACPI_STATUS (AE_OK); 510 return_ACPI_STATUS (AE_OK);
544} 511}
diff --git a/drivers/acpi/resources/rsirq.c b/drivers/acpi/resources/rsirq.c
index fd07a8702fbe..8a2b630be45b 100644
--- a/drivers/acpi/resources/rsirq.c
+++ b/drivers/acpi/resources/rsirq.c
@@ -83,7 +83,8 @@ acpi_rs_irq_resource (
83 u8 temp8 = 0; 83 u8 temp8 = 0;
84 u8 index; 84 u8 index;
85 u8 i; 85 u8 i;
86 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_irq); 86 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (
87 struct acpi_resource_irq);
87 88
88 89
89 ACPI_FUNCTION_TRACE ("rs_irq_resource"); 90 ACPI_FUNCTION_TRACE ("rs_irq_resource");
@@ -91,15 +92,14 @@ acpi_rs_irq_resource (
91 92
92 /* 93 /*
93 * The number of bytes consumed are contained in the descriptor 94 * The number of bytes consumed are contained in the descriptor
94 * (Bits:0-1) 95 * (Bits:0-1)
95 */ 96 */
96 temp8 = *buffer; 97 temp8 = *buffer;
97 *bytes_consumed = (temp8 & 0x03) + 1; 98 *bytes_consumed = (temp8 & 0x03) + 1;
98 output_struct->id = ACPI_RSTYPE_IRQ; 99 output_struct->id = ACPI_RSTYPE_IRQ;
99 100
100 /* 101 /* Point to the 16-bits of Bytes 1 and 2 */
101 * Point to the 16-bits of Bytes 1 and 2 102
102 */
103 buffer += 1; 103 buffer += 1;
104 ACPI_MOVE_16_TO_16 (&temp16, buffer); 104 ACPI_MOVE_16_TO_16 (&temp16, buffer);
105 105
@@ -118,22 +118,19 @@ acpi_rs_irq_resource (
118 118
119 output_struct->data.irq.number_of_interrupts = i; 119 output_struct->data.irq.number_of_interrupts = i;
120 if (i > 0) { 120 if (i > 0) {
121 /* 121 /* Calculate the structure size based upon the number of interrupts */
122 * Calculate the structure size based upon the number of interrupts 122
123 */
124 struct_size += ((acpi_size) i - 1) * 4; 123 struct_size += ((acpi_size) i - 1) * 4;
125 } 124 }
126 125
127 /* 126 /* Point to Byte 3 if it is used */
128 * Point to Byte 3 if it is used 127
129 */
130 if (4 == *bytes_consumed) { 128 if (4 == *bytes_consumed) {
131 buffer += 2; 129 buffer += 2;
132 temp8 = *buffer; 130 temp8 = *buffer;
133 131
134 /* 132 /* Check for HE, LL interrupts */
135 * Check for HE, LL interrupts 133
136 */
137 switch (temp8 & 0x09) { 134 switch (temp8 & 0x09) {
138 case 0x01: /* HE */ 135 case 0x01: /* HE */
139 output_struct->data.irq.edge_level = ACPI_EDGE_SENSITIVE; 136 output_struct->data.irq.edge_level = ACPI_EDGE_SENSITIVE;
@@ -152,13 +149,13 @@ acpi_rs_irq_resource (
152 * so 0x00 and 0x09 are illegal. 149 * so 0x00 and 0x09 are illegal.
153 */ 150 */
154 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 151 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
155 "Invalid interrupt polarity/trigger in resource list, %X\n", temp8)); 152 "Invalid interrupt polarity/trigger in resource list, %X\n",
153 temp8));
156 return_ACPI_STATUS (AE_BAD_DATA); 154 return_ACPI_STATUS (AE_BAD_DATA);
157 } 155 }
158 156
159 /* 157 /* Check for sharable */
160 * Check for sharable 158
161 */
162 output_struct->data.irq.shared_exclusive = (temp8 >> 3) & 0x01; 159 output_struct->data.irq.shared_exclusive = (temp8 >> 3) & 0x01;
163 } 160 }
164 else { 161 else {
@@ -171,14 +168,12 @@ acpi_rs_irq_resource (
171 output_struct->data.irq.shared_exclusive = ACPI_EXCLUSIVE; 168 output_struct->data.irq.shared_exclusive = ACPI_EXCLUSIVE;
172 } 169 }
173 170
174 /* 171 /* Set the Length parameter */
175 * Set the Length parameter 172
176 */
177 output_struct->length = (u32) struct_size; 173 output_struct->length = (u32) struct_size;
178 174
179 /* 175 /* Return the final size of the structure */
180 * Return the final size of the structure 176
181 */
182 *structure_size = struct_size; 177 *structure_size = struct_size;
183 return_ACPI_STATUS (AE_OK); 178 return_ACPI_STATUS (AE_OK);
184} 179}
@@ -234,9 +229,8 @@ acpi_rs_irq_stream (
234 buffer += 1; 229 buffer += 1;
235 temp16 = 0; 230 temp16 = 0;
236 231
237 /* 232 /* Loop through all of the interrupts and set the mask bits */
238 * Loop through all of the interrupts and set the mask bits 233
239 */
240 for(index = 0; 234 for(index = 0;
241 index < linked_list->data.irq.number_of_interrupts; 235 index < linked_list->data.irq.number_of_interrupts;
242 index++) { 236 index++) {
@@ -247,9 +241,8 @@ acpi_rs_irq_stream (
247 ACPI_MOVE_16_TO_16 (buffer, &temp16); 241 ACPI_MOVE_16_TO_16 (buffer, &temp16);
248 buffer += 2; 242 buffer += 2;
249 243
250 /* 244 /* Set the IRQ Info byte if needed. */
251 * Set the IRQ Info byte if needed. 245
252 */
253 if (IRqinfo_byte_needed) { 246 if (IRqinfo_byte_needed) {
254 temp8 = 0; 247 temp8 = 0;
255 temp8 = (u8) ((linked_list->data.irq.shared_exclusive & 248 temp8 = (u8) ((linked_list->data.irq.shared_exclusive &
@@ -267,9 +260,8 @@ acpi_rs_irq_stream (
267 buffer += 1; 260 buffer += 1;
268 } 261 }
269 262
270 /* 263 /* Return the number of bytes consumed in this operation */
271 * Return the number of bytes consumed in this operation 264
272 */
273 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); 265 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer);
274 return_ACPI_STATUS (AE_OK); 266 return_ACPI_STATUS (AE_OK);
275} 267}
@@ -309,15 +301,15 @@ acpi_rs_extended_irq_resource (
309 u8 temp8 = 0; 301 u8 temp8 = 0;
310 u8 *temp_ptr; 302 u8 *temp_ptr;
311 u8 index; 303 u8 index;
312 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_ext_irq); 304 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (
305 struct acpi_resource_ext_irq);
313 306
314 307
315 ACPI_FUNCTION_TRACE ("rs_extended_irq_resource"); 308 ACPI_FUNCTION_TRACE ("rs_extended_irq_resource");
316 309
317 310
318 /* 311 /* Point past the Descriptor to get the number of bytes consumed */
319 * Point past the Descriptor to get the number of bytes consumed 312
320 */
321 buffer += 1; 313 buffer += 1;
322 ACPI_MOVE_16_TO_16 (&temp16, buffer); 314 ACPI_MOVE_16_TO_16 (&temp16, buffer);
323 315
@@ -330,9 +322,8 @@ acpi_rs_extended_irq_resource (
330 *bytes_consumed = temp16 + 3; 322 *bytes_consumed = temp16 + 3;
331 output_struct->id = ACPI_RSTYPE_EXT_IRQ; 323 output_struct->id = ACPI_RSTYPE_EXT_IRQ;
332 324
333 /* 325 /* Point to the Byte3 */
334 * Point to the Byte3 326
335 */
336 buffer += 2; 327 buffer += 2;
337 temp8 = *buffer; 328 temp8 = *buffer;
338 329
@@ -347,21 +338,18 @@ acpi_rs_extended_irq_resource (
347 * - Edge/Level are defined opposite in the table vs the headers 338 * - Edge/Level are defined opposite in the table vs the headers
348 */ 339 */
349 output_struct->data.extended_irq.edge_level = 340 output_struct->data.extended_irq.edge_level =
350 (temp8 & 0x2) ? ACPI_EDGE_SENSITIVE : ACPI_LEVEL_SENSITIVE; 341 (temp8 & 0x2) ? ACPI_EDGE_SENSITIVE : ACPI_LEVEL_SENSITIVE;
342
343 /* Check Interrupt Polarity */
351 344
352 /*
353 * Check Interrupt Polarity
354 */
355 output_struct->data.extended_irq.active_high_low = (temp8 >> 2) & 0x1; 345 output_struct->data.extended_irq.active_high_low = (temp8 >> 2) & 0x1;
356 346
357 /* 347 /* Check for sharable */
358 * Check for sharable 348
359 */
360 output_struct->data.extended_irq.shared_exclusive = (temp8 >> 3) & 0x01; 349 output_struct->data.extended_irq.shared_exclusive = (temp8 >> 3) & 0x01;
361 350
362 /* 351 /* Point to Byte4 (IRQ Table length) */
363 * Point to Byte4 (IRQ Table length) 352
364 */
365 buffer += 1; 353 buffer += 1;
366 temp8 = *buffer; 354 temp8 = *buffer;
367 355
@@ -379,14 +367,12 @@ acpi_rs_extended_irq_resource (
379 */ 367 */
380 struct_size += (temp8 - 1) * 4; 368 struct_size += (temp8 - 1) * 4;
381 369
382 /* 370 /* Point to Byte5 (First IRQ Number) */
383 * Point to Byte5 (First IRQ Number) 371
384 */
385 buffer += 1; 372 buffer += 1;
386 373
387 /* 374 /* Cycle through every IRQ in the table */
388 * Cycle through every IRQ in the table 375
389 */
390 for (index = 0; index < temp8; index++) { 376 for (index = 0; index < temp8; index++) {
391 ACPI_MOVE_32_TO_32 ( 377 ACPI_MOVE_32_TO_32 (
392 &output_struct->data.extended_irq.interrupts[index], buffer); 378 &output_struct->data.extended_irq.interrupts[index], buffer);
@@ -407,7 +393,8 @@ acpi_rs_extended_irq_resource (
407 * we add 1 to the length. 393 * we add 1 to the length.
408 */ 394 */
409 if (*bytes_consumed > 395 if (*bytes_consumed >
410 ((acpi_size) output_struct->data.extended_irq.number_of_interrupts * 4) + (5 + 1)) { 396 ((acpi_size) output_struct->data.extended_irq.number_of_interrupts * 4) +
397 (5 + 1)) {
411 /* Dereference the Index */ 398 /* Dereference the Index */
412 399
413 temp8 = *buffer; 400 temp8 = *buffer;
@@ -417,13 +404,13 @@ acpi_rs_extended_irq_resource (
417 404
418 buffer += 1; 405 buffer += 1;
419 406
420 /* 407 /* Point the String pointer to the end of this structure. */
421 * Point the String pointer to the end of this structure. 408
422 */
423 output_struct->data.extended_irq.resource_source.string_ptr = 409 output_struct->data.extended_irq.resource_source.string_ptr =
424 (char *)((char *) output_struct + struct_size); 410 (char *)((char *) output_struct + struct_size);
425 411
426 temp_ptr = (u8 *) output_struct->data.extended_irq.resource_source.string_ptr; 412 temp_ptr = (u8 *)
413 output_struct->data.extended_irq.resource_source.string_ptr;
427 414
428 /* Copy the string into the buffer */ 415 /* Copy the string into the buffer */
429 416
@@ -436,9 +423,8 @@ acpi_rs_extended_irq_resource (
436 index += 1; 423 index += 1;
437 } 424 }
438 425
439 /* 426 /* Add the terminating null */
440 * Add the terminating null 427
441 */
442 *temp_ptr = 0x00; 428 *temp_ptr = 0x00;
443 output_struct->data.extended_irq.resource_source.string_length = index + 1; 429 output_struct->data.extended_irq.resource_source.string_length = index + 1;
444 430
@@ -456,14 +442,12 @@ acpi_rs_extended_irq_resource (
456 output_struct->data.extended_irq.resource_source.string_ptr = NULL; 442 output_struct->data.extended_irq.resource_source.string_ptr = NULL;
457 } 443 }
458 444
459 /* 445 /* Set the Length parameter */
460 * Set the Length parameter 446
461 */
462 output_struct->length = (u32) struct_size; 447 output_struct->length = (u32) struct_size;
463 448
464 /* 449 /* Return the final size of the structure */
465 * Return the final size of the structure 450
466 */
467 *structure_size = struct_size; 451 *structure_size = struct_size;
468 return_ACPI_STATUS (AE_OK); 452 return_ACPI_STATUS (AE_OK);
469} 453}
@@ -501,21 +485,18 @@ acpi_rs_extended_irq_stream (
501 ACPI_FUNCTION_TRACE ("rs_extended_irq_stream"); 485 ACPI_FUNCTION_TRACE ("rs_extended_irq_stream");
502 486
503 487
504 /* 488 /* The descriptor field is static */
505 * The descriptor field is static 489
506 */
507 *buffer = 0x89; 490 *buffer = 0x89;
508 buffer += 1; 491 buffer += 1;
509 492
510 /* 493 /* Set a pointer to the Length field - to be filled in later */
511 * Set a pointer to the Length field - to be filled in later 494
512 */
513 length_field = ACPI_CAST_PTR (u16, buffer); 495 length_field = ACPI_CAST_PTR (u16, buffer);
514 buffer += 2; 496 buffer += 2;
515 497
516 /* 498 /* Set the Interrupt vector flags */
517 * Set the Interrupt vector flags 499
518 */
519 temp8 = (u8)(linked_list->data.extended_irq.producer_consumer & 0x01); 500 temp8 = (u8)(linked_list->data.extended_irq.producer_consumer & 0x01);
520 temp8 |= ((linked_list->data.extended_irq.shared_exclusive & 0x01) << 3); 501 temp8 |= ((linked_list->data.extended_irq.shared_exclusive & 0x01) << 3);
521 502
@@ -532,17 +513,15 @@ acpi_rs_extended_irq_stream (
532 temp8 |= 0x2; 513 temp8 |= 0x2;
533 } 514 }
534 515
535 /* 516 /* Set the Interrupt Polarity */
536 * Set the Interrupt Polarity 517
537 */
538 temp8 |= ((linked_list->data.extended_irq.active_high_low & 0x1) << 2); 518 temp8 |= ((linked_list->data.extended_irq.active_high_low & 0x1) << 2);
539 519
540 *buffer = temp8; 520 *buffer = temp8;
541 buffer += 1; 521 buffer += 1;
542 522
543 /* 523 /* Set the Interrupt table length */
544 * Set the Interrupt table length 524
545 */
546 temp8 = (u8) linked_list->data.extended_irq.number_of_interrupts; 525 temp8 = (u8) linked_list->data.extended_irq.number_of_interrupts;
547 526
548 *buffer = temp8; 527 *buffer = temp8;
@@ -555,18 +534,16 @@ acpi_rs_extended_irq_stream (
555 buffer += 4; 534 buffer += 4;
556 } 535 }
557 536
558 /* 537 /* Resource Source Index and Resource Source are optional */
559 * Resource Source Index and Resource Source are optional 538
560 */
561 if (0 != linked_list->data.extended_irq.resource_source.string_length) { 539 if (0 != linked_list->data.extended_irq.resource_source.string_length) {
562 *buffer = (u8) linked_list->data.extended_irq.resource_source.index; 540 *buffer = (u8) linked_list->data.extended_irq.resource_source.index;
563 buffer += 1; 541 buffer += 1;
564 542
565 temp_pointer = (char *) buffer; 543 temp_pointer = (char *) buffer;
566 544
567 /* 545 /* Copy the string */
568 * Copy the string 546
569 */
570 ACPI_STRCPY (temp_pointer, 547 ACPI_STRCPY (temp_pointer,
571 linked_list->data.extended_irq.resource_source.string_ptr); 548 linked_list->data.extended_irq.resource_source.string_ptr);
572 549
@@ -574,12 +551,12 @@ acpi_rs_extended_irq_stream (
574 * Buffer needs to be set to the length of the sting + one for the 551 * Buffer needs to be set to the length of the sting + one for the
575 * terminating null 552 * terminating null
576 */ 553 */
577 buffer += (acpi_size)(ACPI_STRLEN (linked_list->data.extended_irq.resource_source.string_ptr) + 1); 554 buffer += (acpi_size) (ACPI_STRLEN (
555 linked_list->data.extended_irq.resource_source.string_ptr) + 1);
578 } 556 }
579 557
580 /* 558 /* Return the number of bytes consumed in this operation */
581 * Return the number of bytes consumed in this operation 559
582 */
583 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); 560 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer);
584 561
585 /* 562 /*
diff --git a/drivers/acpi/resources/rslist.c b/drivers/acpi/resources/rslist.c
index e49c1e030f99..db7bcb4e60e3 100644
--- a/drivers/acpi/resources/rslist.c
+++ b/drivers/acpi/resources/rslist.c
@@ -55,7 +55,7 @@
55 * 55 *
56 * PARAMETERS: resource_start_byte - Byte 0 of a resource descriptor 56 * PARAMETERS: resource_start_byte - Byte 0 of a resource descriptor
57 * 57 *
58 * RETURN: The Resource Type (Name) with no extraneous bits 58 * RETURN: The Resource Type with no extraneous bits
59 * 59 *
60 * DESCRIPTION: Extract the Resource Type/Name from the first byte of 60 * DESCRIPTION: Extract the Resource Type/Name from the first byte of
61 * a resource descriptor. 61 * a resource descriptor.
@@ -70,28 +70,25 @@ acpi_rs_get_resource_type (
70 ACPI_FUNCTION_ENTRY (); 70 ACPI_FUNCTION_ENTRY ();
71 71
72 72
73 /* 73 /* Determine if this is a small or large resource */
74 * Determine if this is a small or large resource 74
75 */
76 switch (resource_start_byte & ACPI_RDESC_TYPE_MASK) { 75 switch (resource_start_byte & ACPI_RDESC_TYPE_MASK) {
77 case ACPI_RDESC_TYPE_SMALL: 76 case ACPI_RDESC_TYPE_SMALL:
78 77
79 /* 78 /* Small Resource Type -- Only bits 6:3 are valid */
80 * Small Resource Type -- Only bits 6:3 are valid 79
81 */
82 return ((u8) (resource_start_byte & ACPI_RDESC_SMALL_MASK)); 80 return ((u8) (resource_start_byte & ACPI_RDESC_SMALL_MASK));
83 81
84 82
85 case ACPI_RDESC_TYPE_LARGE: 83 case ACPI_RDESC_TYPE_LARGE:
86 84
87 /* 85 /* Large Resource Type -- All bits are valid */
88 * Large Resource Type -- All bits are valid 86
89 */
90 return (resource_start_byte); 87 return (resource_start_byte);
91 88
92 89
93 default: 90 default:
94 /* No other types of resource descriptor */ 91 /* Invalid type */
95 break; 92 break;
96 } 93 }
97 94
@@ -135,9 +132,8 @@ acpi_rs_byte_stream_to_list (
135 132
136 while (bytes_parsed < byte_stream_buffer_length && 133 while (bytes_parsed < byte_stream_buffer_length &&
137 !end_tag_processed) { 134 !end_tag_processed) {
138 /* 135 /* The next byte in the stream is the resource type */
139 * The next byte in the stream is the resource type 136
140 */
141 resource_type = acpi_rs_get_resource_type (*byte_stream_buffer); 137 resource_type = acpi_rs_get_resource_type (*byte_stream_buffer);
142 138
143 switch (resource_type) { 139 switch (resource_type) {
@@ -299,28 +295,23 @@ acpi_rs_byte_stream_to_list (
299 return_ACPI_STATUS (status); 295 return_ACPI_STATUS (status);
300 } 296 }
301 297
302 /* 298 /* Update the return value and counter */
303 * Update the return value and counter 299
304 */
305 bytes_parsed += bytes_consumed; 300 bytes_parsed += bytes_consumed;
306 301
307 /* 302 /* Set the byte stream to point to the next resource */
308 * Set the byte stream to point to the next resource 303
309 */
310 byte_stream_buffer += bytes_consumed; 304 byte_stream_buffer += bytes_consumed;
311 305
312 /* 306 /* Set the Buffer to the next structure */
313 * Set the Buffer to the next structure 307
314 */
315 resource = ACPI_CAST_PTR (struct acpi_resource, buffer); 308 resource = ACPI_CAST_PTR (struct acpi_resource, buffer);
316 resource->length = (u32) ACPI_ALIGN_RESOURCE_SIZE (resource->length); 309 resource->length = (u32) ACPI_ALIGN_RESOURCE_SIZE (resource->length);
317 buffer += ACPI_ALIGN_RESOURCE_SIZE (structure_size); 310 buffer += ACPI_ALIGN_RESOURCE_SIZE (structure_size);
311 }
318 312
319 } /* end while */ 313 /* Check the reason for exiting the while loop */
320 314
321 /*
322 * Check the reason for exiting the while loop
323 */
324 if (!end_tag_processed) { 315 if (!end_tag_processed) {
325 return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); 316 return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG);
326 } 317 }
@@ -424,9 +415,8 @@ acpi_rs_list_to_byte_stream (
424 */ 415 */
425 status = acpi_rs_end_tag_stream (linked_list, &buffer, &bytes_consumed); 416 status = acpi_rs_end_tag_stream (linked_list, &buffer, &bytes_consumed);
426 417
427 /* 418 /* An End Tag indicates the end of the Resource Template */
428 * An End Tag indicates the end of the Resource Template 419
429 */
430 done = TRUE; 420 done = TRUE;
431 break; 421 break;
432 422
@@ -488,27 +478,25 @@ acpi_rs_list_to_byte_stream (
488 default: 478 default:
489 /* 479 /*
490 * If we get here, everything is out of sync, 480 * If we get here, everything is out of sync,
491 * so exit with an error 481 * so exit with an error
492 */ 482 */
493 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid descriptor type (%X) in resource list\n", 483 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
484 "Invalid descriptor type (%X) in resource list\n",
494 linked_list->id)); 485 linked_list->id));
495 status = AE_BAD_DATA; 486 status = AE_BAD_DATA;
496 break; 487 break;
497 488 }
498 } /* switch (linked_list->Id) */
499 489
500 if (ACPI_FAILURE (status)) { 490 if (ACPI_FAILURE (status)) {
501 return_ACPI_STATUS (status); 491 return_ACPI_STATUS (status);
502 } 492 }
503 493
504 /* 494 /* Set the Buffer to point to the open byte */
505 * Set the Buffer to point to the open byte 495
506 */
507 buffer += bytes_consumed; 496 buffer += bytes_consumed;
508 497
509 /* 498 /* Point to the next object */
510 * Point to the next object 499
511 */
512 linked_list = ACPI_PTR_ADD (struct acpi_resource, 500 linked_list = ACPI_PTR_ADD (struct acpi_resource,
513 linked_list, linked_list->length); 501 linked_list, linked_list->length);
514 } 502 }
diff --git a/drivers/acpi/resources/rsmemory.c b/drivers/acpi/resources/rsmemory.c
index 7c935aecf075..91d0207f01ac 100644
--- a/drivers/acpi/resources/rsmemory.c
+++ b/drivers/acpi/resources/rsmemory.c
@@ -81,15 +81,15 @@ acpi_rs_memory24_resource (
81 struct acpi_resource *output_struct = (void *) *output_buffer; 81 struct acpi_resource *output_struct = (void *) *output_buffer;
82 u16 temp16 = 0; 82 u16 temp16 = 0;
83 u8 temp8 = 0; 83 u8 temp8 = 0;
84 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_mem24); 84 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (
85 struct acpi_resource_mem24);
85 86
86 87
87 ACPI_FUNCTION_TRACE ("rs_memory24_resource"); 88 ACPI_FUNCTION_TRACE ("rs_memory24_resource");
88 89
89 90
90 /* 91 /* Point past the Descriptor to get the number of bytes consumed */
91 * Point past the Descriptor to get the number of bytes consumed 92
92 */
93 buffer += 1; 93 buffer += 1;
94 94
95 ACPI_MOVE_16_TO_16 (&temp16, buffer); 95 ACPI_MOVE_16_TO_16 (&temp16, buffer);
@@ -97,48 +97,41 @@ acpi_rs_memory24_resource (
97 *bytes_consumed = (acpi_size) temp16 + 3; 97 *bytes_consumed = (acpi_size) temp16 + 3;
98 output_struct->id = ACPI_RSTYPE_MEM24; 98 output_struct->id = ACPI_RSTYPE_MEM24;
99 99
100 /* 100 /* Check Byte 3 the Read/Write bit */
101 * Check Byte 3 the Read/Write bit 101
102 */
103 temp8 = *buffer; 102 temp8 = *buffer;
104 buffer += 1; 103 buffer += 1;
105 output_struct->data.memory24.read_write_attribute = temp8 & 0x01; 104 output_struct->data.memory24.read_write_attribute = temp8 & 0x01;
106 105
107 /* 106 /* Get min_base_address (Bytes 4-5) */
108 * Get min_base_address (Bytes 4-5) 107
109 */
110 ACPI_MOVE_16_TO_16 (&temp16, buffer); 108 ACPI_MOVE_16_TO_16 (&temp16, buffer);
111 buffer += 2; 109 buffer += 2;
112 output_struct->data.memory24.min_base_address = temp16; 110 output_struct->data.memory24.min_base_address = temp16;
113 111
114 /* 112 /* Get max_base_address (Bytes 6-7) */
115 * Get max_base_address (Bytes 6-7) 113
116 */
117 ACPI_MOVE_16_TO_16 (&temp16, buffer); 114 ACPI_MOVE_16_TO_16 (&temp16, buffer);
118 buffer += 2; 115 buffer += 2;
119 output_struct->data.memory24.max_base_address = temp16; 116 output_struct->data.memory24.max_base_address = temp16;
120 117
121 /* 118 /* Get Alignment (Bytes 8-9) */
122 * Get Alignment (Bytes 8-9) 119
123 */
124 ACPI_MOVE_16_TO_16 (&temp16, buffer); 120 ACPI_MOVE_16_TO_16 (&temp16, buffer);
125 buffer += 2; 121 buffer += 2;
126 output_struct->data.memory24.alignment = temp16; 122 output_struct->data.memory24.alignment = temp16;
127 123
128 /* 124 /* Get range_length (Bytes 10-11) */
129 * Get range_length (Bytes 10-11) 125
130 */
131 ACPI_MOVE_16_TO_16 (&temp16, buffer); 126 ACPI_MOVE_16_TO_16 (&temp16, buffer);
132 output_struct->data.memory24.range_length = temp16; 127 output_struct->data.memory24.range_length = temp16;
133 128
134 /* 129 /* Set the Length parameter */
135 * Set the Length parameter 130
136 */
137 output_struct->length = (u32) struct_size; 131 output_struct->length = (u32) struct_size;
138 132
139 /* 133 /* Return the final size of the structure */
140 * Return the final size of the structure 134
141 */
142 *structure_size = struct_size; 135 *structure_size = struct_size;
143 return_ACPI_STATUS (AE_OK); 136 return_ACPI_STATUS (AE_OK);
144} 137}
@@ -174,53 +167,45 @@ acpi_rs_memory24_stream (
174 ACPI_FUNCTION_TRACE ("rs_memory24_stream"); 167 ACPI_FUNCTION_TRACE ("rs_memory24_stream");
175 168
176 169
177 /* 170 /* The descriptor field is static */
178 * The descriptor field is static 171
179 */
180 *buffer = 0x81; 172 *buffer = 0x81;
181 buffer += 1; 173 buffer += 1;
182 174
183 /* 175 /* The length field is static */
184 * The length field is static 176
185 */
186 temp16 = 0x09; 177 temp16 = 0x09;
187 ACPI_MOVE_16_TO_16 (buffer, &temp16); 178 ACPI_MOVE_16_TO_16 (buffer, &temp16);
188 buffer += 2; 179 buffer += 2;
189 180
190 /* 181 /* Set the Information Byte */
191 * Set the Information Byte 182
192 */
193 temp8 = (u8) (linked_list->data.memory24.read_write_attribute & 0x01); 183 temp8 = (u8) (linked_list->data.memory24.read_write_attribute & 0x01);
194 *buffer = temp8; 184 *buffer = temp8;
195 buffer += 1; 185 buffer += 1;
196 186
197 /* 187 /* Set the Range minimum base address */
198 * Set the Range minimum base address 188
199 */
200 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.memory24.min_base_address); 189 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.memory24.min_base_address);
201 buffer += 2; 190 buffer += 2;
202 191
203 /* 192 /* Set the Range maximum base address */
204 * Set the Range maximum base address 193
205 */
206 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.memory24.max_base_address); 194 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.memory24.max_base_address);
207 buffer += 2; 195 buffer += 2;
208 196
209 /* 197 /* Set the base alignment */
210 * Set the base alignment 198
211 */
212 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.memory24.alignment); 199 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.memory24.alignment);
213 buffer += 2; 200 buffer += 2;
214 201
215 /* 202 /* Set the range length */
216 * Set the range length 203
217 */
218 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.memory24.range_length); 204 ACPI_MOVE_32_TO_16 (buffer, &linked_list->data.memory24.range_length);
219 buffer += 2; 205 buffer += 2;
220 206
221 /* 207 /* Return the number of bytes consumed in this operation */
222 * Return the number of bytes consumed in this operation 208
223 */
224 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); 209 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer);
225 return_ACPI_STATUS (AE_OK); 210 return_ACPI_STATUS (AE_OK);
226} 211}
@@ -258,15 +243,15 @@ acpi_rs_memory32_range_resource (
258 struct acpi_resource *output_struct = (void *) *output_buffer; 243 struct acpi_resource *output_struct = (void *) *output_buffer;
259 u16 temp16 = 0; 244 u16 temp16 = 0;
260 u8 temp8 = 0; 245 u8 temp8 = 0;
261 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_mem32); 246 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (
247 struct acpi_resource_mem32);
262 248
263 249
264 ACPI_FUNCTION_TRACE ("rs_memory32_range_resource"); 250 ACPI_FUNCTION_TRACE ("rs_memory32_range_resource");
265 251
266 252
267 /* 253 /* Point past the Descriptor to get the number of bytes consumed */
268 * Point past the Descriptor to get the number of bytes consumed 254
269 */
270 buffer += 1; 255 buffer += 1;
271 256
272 ACPI_MOVE_16_TO_16 (&temp16, buffer); 257 ACPI_MOVE_16_TO_16 (&temp16, buffer);
@@ -285,45 +270,38 @@ acpi_rs_memory32_range_resource (
285 * 4 * sizeof(RESOURCE_DATA) instead of 4 * sizeof(u8) 270 * 4 * sizeof(RESOURCE_DATA) instead of 4 * sizeof(u8)
286 */ 271 */
287 272
288 /* 273 /* Check Byte 3 the Read/Write bit */
289 * Check Byte 3 the Read/Write bit 274
290 */
291 temp8 = *buffer; 275 temp8 = *buffer;
292 buffer += 1; 276 buffer += 1;
293 277
294 output_struct->data.memory32.read_write_attribute = temp8 & 0x01; 278 output_struct->data.memory32.read_write_attribute = temp8 & 0x01;
295 279
296 /* 280 /* Get min_base_address (Bytes 4-7) */
297 * Get min_base_address (Bytes 4-7) 281
298 */
299 ACPI_MOVE_32_TO_32 (&output_struct->data.memory32.min_base_address, buffer); 282 ACPI_MOVE_32_TO_32 (&output_struct->data.memory32.min_base_address, buffer);
300 buffer += 4; 283 buffer += 4;
301 284
302 /* 285 /* Get max_base_address (Bytes 8-11) */
303 * Get max_base_address (Bytes 8-11) 286
304 */
305 ACPI_MOVE_32_TO_32 (&output_struct->data.memory32.max_base_address, buffer); 287 ACPI_MOVE_32_TO_32 (&output_struct->data.memory32.max_base_address, buffer);
306 buffer += 4; 288 buffer += 4;
307 289
308 /* 290 /* Get Alignment (Bytes 12-15) */
309 * Get Alignment (Bytes 12-15) 291
310 */
311 ACPI_MOVE_32_TO_32 (&output_struct->data.memory32.alignment, buffer); 292 ACPI_MOVE_32_TO_32 (&output_struct->data.memory32.alignment, buffer);
312 buffer += 4; 293 buffer += 4;
313 294
314 /* 295 /* Get range_length (Bytes 16-19) */
315 * Get range_length (Bytes 16-19) 296
316 */
317 ACPI_MOVE_32_TO_32 (&output_struct->data.memory32.range_length, buffer); 297 ACPI_MOVE_32_TO_32 (&output_struct->data.memory32.range_length, buffer);
318 298
319 /* 299 /* Set the Length parameter */
320 * Set the Length parameter 300
321 */
322 output_struct->length = (u32) struct_size; 301 output_struct->length = (u32) struct_size;
323 302
324 /* 303 /* Return the final size of the structure */
325 * Return the final size of the structure 304
326 */
327 *structure_size = struct_size; 305 *structure_size = struct_size;
328 return_ACPI_STATUS (AE_OK); 306 return_ACPI_STATUS (AE_OK);
329} 307}
@@ -361,15 +339,15 @@ acpi_rs_fixed_memory32_resource (
361 struct acpi_resource *output_struct = (void *) *output_buffer; 339 struct acpi_resource *output_struct = (void *) *output_buffer;
362 u16 temp16 = 0; 340 u16 temp16 = 0;
363 u8 temp8 = 0; 341 u8 temp8 = 0;
364 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_fixed_mem32); 342 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (
343 struct acpi_resource_fixed_mem32);
365 344
366 345
367 ACPI_FUNCTION_TRACE ("rs_fixed_memory32_resource"); 346 ACPI_FUNCTION_TRACE ("rs_fixed_memory32_resource");
368 347
369 348
370 /* 349 /* Point past the Descriptor to get the number of bytes consumed */
371 * Point past the Descriptor to get the number of bytes consumed 350
372 */
373 buffer += 1; 351 buffer += 1;
374 ACPI_MOVE_16_TO_16 (&temp16, buffer); 352 ACPI_MOVE_16_TO_16 (&temp16, buffer);
375 353
@@ -378,32 +356,28 @@ acpi_rs_fixed_memory32_resource (
378 356
379 output_struct->id = ACPI_RSTYPE_FIXED_MEM32; 357 output_struct->id = ACPI_RSTYPE_FIXED_MEM32;
380 358
381 /* 359 /* Check Byte 3 the Read/Write bit */
382 * Check Byte 3 the Read/Write bit 360
383 */
384 temp8 = *buffer; 361 temp8 = *buffer;
385 buffer += 1; 362 buffer += 1;
386 output_struct->data.fixed_memory32.read_write_attribute = temp8 & 0x01; 363 output_struct->data.fixed_memory32.read_write_attribute = temp8 & 0x01;
387 364
388 /* 365 /* Get range_base_address (Bytes 4-7) */
389 * Get range_base_address (Bytes 4-7) 366
390 */ 367 ACPI_MOVE_32_TO_32 (&output_struct->data.fixed_memory32.range_base_address,
391 ACPI_MOVE_32_TO_32 (&output_struct->data.fixed_memory32.range_base_address, buffer); 368 buffer);
392 buffer += 4; 369 buffer += 4;
393 370
394 /* 371 /* Get range_length (Bytes 8-11) */
395 * Get range_length (Bytes 8-11) 372
396 */
397 ACPI_MOVE_32_TO_32 (&output_struct->data.fixed_memory32.range_length, buffer); 373 ACPI_MOVE_32_TO_32 (&output_struct->data.fixed_memory32.range_length, buffer);
398 374
399 /* 375 /* Set the Length parameter */
400 * Set the Length parameter 376
401 */
402 output_struct->length = (u32) struct_size; 377 output_struct->length = (u32) struct_size;
403 378
404 /* 379 /* Return the final size of the structure */
405 * Return the final size of the structure 380
406 */
407 *structure_size = struct_size; 381 *structure_size = struct_size;
408 return_ACPI_STATUS (AE_OK); 382 return_ACPI_STATUS (AE_OK);
409} 383}
@@ -439,54 +413,46 @@ acpi_rs_memory32_range_stream (
439 ACPI_FUNCTION_TRACE ("rs_memory32_range_stream"); 413 ACPI_FUNCTION_TRACE ("rs_memory32_range_stream");
440 414
441 415
442 /* 416 /* The descriptor field is static */
443 * The descriptor field is static 417
444 */
445 *buffer = 0x85; 418 *buffer = 0x85;
446 buffer += 1; 419 buffer += 1;
447 420
448 /* 421 /* The length field is static */
449 * The length field is static 422
450 */
451 temp16 = 0x11; 423 temp16 = 0x11;
452 424
453 ACPI_MOVE_16_TO_16 (buffer, &temp16); 425 ACPI_MOVE_16_TO_16 (buffer, &temp16);
454 buffer += 2; 426 buffer += 2;
455 427
456 /* 428 /* Set the Information Byte */
457 * Set the Information Byte 429
458 */
459 temp8 = (u8) (linked_list->data.memory32.read_write_attribute & 0x01); 430 temp8 = (u8) (linked_list->data.memory32.read_write_attribute & 0x01);
460 *buffer = temp8; 431 *buffer = temp8;
461 buffer += 1; 432 buffer += 1;
462 433
463 /* 434 /* Set the Range minimum base address */
464 * Set the Range minimum base address 435
465 */
466 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.memory32.min_base_address); 436 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.memory32.min_base_address);
467 buffer += 4; 437 buffer += 4;
468 438
469 /* 439 /* Set the Range maximum base address */
470 * Set the Range maximum base address 440
471 */
472 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.memory32.max_base_address); 441 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.memory32.max_base_address);
473 buffer += 4; 442 buffer += 4;
474 443
475 /* 444 /* Set the base alignment */
476 * Set the base alignment 445
477 */
478 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.memory32.alignment); 446 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.memory32.alignment);
479 buffer += 4; 447 buffer += 4;
480 448
481 /* 449 /* Set the range length */
482 * Set the range length 450
483 */
484 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.memory32.range_length); 451 ACPI_MOVE_32_TO_32 (buffer, &linked_list->data.memory32.range_length);
485 buffer += 4; 452 buffer += 4;
486 453
487 /* 454 /* Return the number of bytes consumed in this operation */
488 * Return the number of bytes consumed in this operation 455
489 */
490 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); 456 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer);
491 return_ACPI_STATUS (AE_OK); 457 return_ACPI_STATUS (AE_OK);
492} 458}
@@ -522,44 +488,38 @@ acpi_rs_fixed_memory32_stream (
522 ACPI_FUNCTION_TRACE ("rs_fixed_memory32_stream"); 488 ACPI_FUNCTION_TRACE ("rs_fixed_memory32_stream");
523 489
524 490
525 /* 491 /* The descriptor field is static */
526 * The descriptor field is static 492
527 */
528 *buffer = 0x86; 493 *buffer = 0x86;
529 buffer += 1; 494 buffer += 1;
530 495
531 /* 496 /* The length field is static */
532 * The length field is static 497
533 */
534 temp16 = 0x09; 498 temp16 = 0x09;
535 499
536 ACPI_MOVE_16_TO_16 (buffer, &temp16); 500 ACPI_MOVE_16_TO_16 (buffer, &temp16);
537 buffer += 2; 501 buffer += 2;
538 502
539 /* 503 /* Set the Information Byte */
540 * Set the Information Byte 504
541 */
542 temp8 = (u8) (linked_list->data.fixed_memory32.read_write_attribute & 0x01); 505 temp8 = (u8) (linked_list->data.fixed_memory32.read_write_attribute & 0x01);
543 *buffer = temp8; 506 *buffer = temp8;
544 buffer += 1; 507 buffer += 1;
545 508
546 /* 509 /* Set the Range base address */
547 * Set the Range base address 510
548 */
549 ACPI_MOVE_32_TO_32 (buffer, 511 ACPI_MOVE_32_TO_32 (buffer,
550 &linked_list->data.fixed_memory32.range_base_address); 512 &linked_list->data.fixed_memory32.range_base_address);
551 buffer += 4; 513 buffer += 4;
552 514
553 /* 515 /* Set the range length */
554 * Set the range length 516
555 */
556 ACPI_MOVE_32_TO_32 (buffer, 517 ACPI_MOVE_32_TO_32 (buffer,
557 &linked_list->data.fixed_memory32.range_length); 518 &linked_list->data.fixed_memory32.range_length);
558 buffer += 4; 519 buffer += 4;
559 520
560 /* 521 /* Return the number of bytes consumed in this operation */
561 * Return the number of bytes consumed in this operation 522
562 */
563 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); 523 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer);
564 return_ACPI_STATUS (AE_OK); 524 return_ACPI_STATUS (AE_OK);
565} 525}
diff --git a/drivers/acpi/resources/rsmisc.c b/drivers/acpi/resources/rsmisc.c
index d16be44b5df7..a1f1741f0d83 100644
--- a/drivers/acpi/resources/rsmisc.c
+++ b/drivers/acpi/resources/rsmisc.c
@@ -84,24 +84,20 @@ acpi_rs_end_tag_resource (
84 ACPI_FUNCTION_TRACE ("rs_end_tag_resource"); 84 ACPI_FUNCTION_TRACE ("rs_end_tag_resource");
85 85
86 86
87 /* 87 /* The number of bytes consumed is static */
88 * The number of bytes consumed is static 88
89 */
90 *bytes_consumed = 2; 89 *bytes_consumed = 2;
91 90
92 /* 91 /* Fill out the structure */
93 * Fill out the structure 92
94 */
95 output_struct->id = ACPI_RSTYPE_END_TAG; 93 output_struct->id = ACPI_RSTYPE_END_TAG;
96 94
97 /* 95 /* Set the Length parameter */
98 * Set the Length parameter 96
99 */
100 output_struct->length = 0; 97 output_struct->length = 0;
101 98
102 /* 99 /* Return the final size of the structure */
103 * Return the final size of the structure 100
104 */
105 *structure_size = struct_size; 101 *structure_size = struct_size;
106 return_ACPI_STATUS (AE_OK); 102 return_ACPI_STATUS (AE_OK);
107} 103}
@@ -136,9 +132,8 @@ acpi_rs_end_tag_stream (
136 ACPI_FUNCTION_TRACE ("rs_end_tag_stream"); 132 ACPI_FUNCTION_TRACE ("rs_end_tag_stream");
137 133
138 134
139 /* 135 /* The descriptor field is static */
140 * The descriptor field is static 136
141 */
142 *buffer = 0x79; 137 *buffer = 0x79;
143 buffer += 1; 138 buffer += 1;
144 139
@@ -151,9 +146,8 @@ acpi_rs_end_tag_stream (
151 *buffer = temp8; 146 *buffer = temp8;
152 buffer += 1; 147 buffer += 1;
153 148
154 /* 149 /* Return the number of bytes consumed in this operation */
155 * Return the number of bytes consumed in this operation 150
156 */
157 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); 151 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer);
158 return_ACPI_STATUS (AE_OK); 152 return_ACPI_STATUS (AE_OK);
159} 153}
@@ -192,21 +186,20 @@ acpi_rs_vendor_resource (
192 u16 temp16 = 0; 186 u16 temp16 = 0;
193 u8 temp8 = 0; 187 u8 temp8 = 0;
194 u8 index; 188 u8 index;
195 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_vendor); 189 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (
190 struct acpi_resource_vendor);
196 191
197 192
198 ACPI_FUNCTION_TRACE ("rs_vendor_resource"); 193 ACPI_FUNCTION_TRACE ("rs_vendor_resource");
199 194
200 195
201 /* 196 /* Dereference the Descriptor to find if this is a large or small item. */
202 * Dereference the Descriptor to find if this is a large or small item. 197
203 */
204 temp8 = *buffer; 198 temp8 = *buffer;
205 199
206 if (temp8 & 0x80) { 200 if (temp8 & 0x80) {
207 /* 201 /* Large Item, point to the length field */
208 * Large Item, point to the length field 202
209 */
210 buffer += 1; 203 buffer += 1;
211 204
212 /* Dereference */ 205 /* Dereference */
@@ -222,9 +215,8 @@ acpi_rs_vendor_resource (
222 buffer += 2; 215 buffer += 2;
223 } 216 }
224 else { 217 else {
225 /* 218 /* Small Item, dereference the size */
226 * Small Item, dereference the size 219
227 */
228 temp16 = (u8)(*buffer & 0x07); 220 temp16 = (u8)(*buffer & 0x07);
229 221
230 /* Calculate bytes consumed */ 222 /* Calculate bytes consumed */
@@ -251,14 +243,12 @@ acpi_rs_vendor_resource (
251 */ 243 */
252 struct_size += ACPI_ROUND_UP_to_32_bITS (temp16); 244 struct_size += ACPI_ROUND_UP_to_32_bITS (temp16);
253 245
254 /* 246 /* Set the Length parameter */
255 * Set the Length parameter 247
256 */
257 output_struct->length = (u32) struct_size; 248 output_struct->length = (u32) struct_size;
258 249
259 /* 250 /* Return the final size of the structure */
260 * Return the final size of the structure 251
261 */
262 *structure_size = struct_size; 252 *structure_size = struct_size;
263 return_ACPI_STATUS (AE_OK); 253 return_ACPI_STATUS (AE_OK);
264} 254}
@@ -295,13 +285,11 @@ acpi_rs_vendor_stream (
295 ACPI_FUNCTION_TRACE ("rs_vendor_stream"); 285 ACPI_FUNCTION_TRACE ("rs_vendor_stream");
296 286
297 287
298 /* 288 /* Dereference the length to find if this is a large or small item. */
299 * Dereference the length to find if this is a large or small item. 289
300 */
301 if(linked_list->data.vendor_specific.length > 7) { 290 if(linked_list->data.vendor_specific.length > 7) {
302 /* 291 /* Large Item, Set the descriptor field and length bytes */
303 * Large Item, Set the descriptor field and length bytes 292
304 */
305 *buffer = 0x84; 293 *buffer = 0x84;
306 buffer += 1; 294 buffer += 1;
307 295
@@ -311,9 +299,8 @@ acpi_rs_vendor_stream (
311 buffer += 2; 299 buffer += 2;
312 } 300 }
313 else { 301 else {
314 /* 302 /* Small Item, Set the descriptor field */
315 * Small Item, Set the descriptor field 303
316 */
317 temp8 = 0x70; 304 temp8 = 0x70;
318 temp8 |= (u8) linked_list->data.vendor_specific.length; 305 temp8 |= (u8) linked_list->data.vendor_specific.length;
319 306
@@ -321,9 +308,8 @@ acpi_rs_vendor_stream (
321 buffer += 1; 308 buffer += 1;
322 } 309 }
323 310
324 /* 311 /* Loop through all of the Vendor Specific fields */
325 * Loop through all of the Vendor Specific fields 312
326 */
327 for (index = 0; index < linked_list->data.vendor_specific.length; index++) { 313 for (index = 0; index < linked_list->data.vendor_specific.length; index++) {
328 temp8 = linked_list->data.vendor_specific.reserved[index]; 314 temp8 = linked_list->data.vendor_specific.reserved[index];
329 315
@@ -331,9 +317,8 @@ acpi_rs_vendor_stream (
331 buffer += 1; 317 buffer += 1;
332 } 318 }
333 319
334 /* 320 /* Return the number of bytes consumed in this operation */
335 * Return the number of bytes consumed in this operation 321
336 */
337 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); 322 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer);
338 return_ACPI_STATUS (AE_OK); 323 return_ACPI_STATUS (AE_OK);
339} 324}
@@ -370,40 +355,37 @@ acpi_rs_start_depend_fns_resource (
370 u8 *buffer = byte_stream_buffer; 355 u8 *buffer = byte_stream_buffer;
371 struct acpi_resource *output_struct = (void *) *output_buffer; 356 struct acpi_resource *output_struct = (void *) *output_buffer;
372 u8 temp8 = 0; 357 u8 temp8 = 0;
373 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_start_dpf); 358 acpi_size struct_size = ACPI_SIZEOF_RESOURCE (
359 struct acpi_resource_start_dpf);
374 360
375 361
376 ACPI_FUNCTION_TRACE ("rs_start_depend_fns_resource"); 362 ACPI_FUNCTION_TRACE ("rs_start_depend_fns_resource");
377 363
378 364
379 /* 365 /* The number of bytes consumed are found in the descriptor (Bits:0-1) */
380 * The number of bytes consumed are contained in the descriptor (Bits:0-1) 366
381 */
382 temp8 = *buffer; 367 temp8 = *buffer;
383 368
384 *bytes_consumed = (temp8 & 0x01) + 1; 369 *bytes_consumed = (temp8 & 0x01) + 1;
385 370
386 output_struct->id = ACPI_RSTYPE_START_DPF; 371 output_struct->id = ACPI_RSTYPE_START_DPF;
387 372
388 /* 373 /* Point to Byte 1 if it is used */
389 * Point to Byte 1 if it is used 374
390 */
391 if (2 == *bytes_consumed) { 375 if (2 == *bytes_consumed) {
392 buffer += 1; 376 buffer += 1;
393 temp8 = *buffer; 377 temp8 = *buffer;
394 378
395 /* 379 /* Check Compatibility priority */
396 * Check Compatibility priority 380
397 */
398 output_struct->data.start_dpf.compatibility_priority = temp8 & 0x03; 381 output_struct->data.start_dpf.compatibility_priority = temp8 & 0x03;
399 382
400 if (3 == output_struct->data.start_dpf.compatibility_priority) { 383 if (3 == output_struct->data.start_dpf.compatibility_priority) {
401 return_ACPI_STATUS (AE_AML_BAD_RESOURCE_VALUE); 384 return_ACPI_STATUS (AE_AML_BAD_RESOURCE_VALUE);
402 } 385 }
403 386
404 /* 387 /* Check Performance/Robustness preference */
405 * Check Performance/Robustness preference 388
406 */
407 output_struct->data.start_dpf.performance_robustness = (temp8 >> 2) & 0x03; 389 output_struct->data.start_dpf.performance_robustness = (temp8 >> 2) & 0x03;
408 390
409 if (3 == output_struct->data.start_dpf.performance_robustness) { 391 if (3 == output_struct->data.start_dpf.performance_robustness) {
@@ -412,20 +394,18 @@ acpi_rs_start_depend_fns_resource (
412 } 394 }
413 else { 395 else {
414 output_struct->data.start_dpf.compatibility_priority = 396 output_struct->data.start_dpf.compatibility_priority =
415 ACPI_ACCEPTABLE_CONFIGURATION; 397 ACPI_ACCEPTABLE_CONFIGURATION;
416 398
417 output_struct->data.start_dpf.performance_robustness = 399 output_struct->data.start_dpf.performance_robustness =
418 ACPI_ACCEPTABLE_CONFIGURATION; 400 ACPI_ACCEPTABLE_CONFIGURATION;
419 } 401 }
420 402
421 /* 403 /* Set the Length parameter */
422 * Set the Length parameter 404
423 */
424 output_struct->length = (u32) struct_size; 405 output_struct->length = (u32) struct_size;
425 406
426 /* 407 /* Return the final size of the structure */
427 * Return the final size of the structure 408
428 */
429 *structure_size = struct_size; 409 *structure_size = struct_size;
430 return_ACPI_STATUS (AE_OK); 410 return_ACPI_STATUS (AE_OK);
431} 411}
@@ -466,24 +446,20 @@ acpi_rs_end_depend_fns_resource (
466 ACPI_FUNCTION_TRACE ("rs_end_depend_fns_resource"); 446 ACPI_FUNCTION_TRACE ("rs_end_depend_fns_resource");
467 447
468 448
469 /* 449 /* The number of bytes consumed is static */
470 * The number of bytes consumed is static 450
471 */
472 *bytes_consumed = 1; 451 *bytes_consumed = 1;
473 452
474 /* 453 /* Fill out the structure */
475 * Fill out the structure 454
476 */
477 output_struct->id = ACPI_RSTYPE_END_DPF; 455 output_struct->id = ACPI_RSTYPE_END_DPF;
478 456
479 /* 457 /* Set the Length parameter */
480 * Set the Length parameter 458
481 */
482 output_struct->length = (u32) struct_size; 459 output_struct->length = (u32) struct_size;
483 460
484 /* 461 /* Return the final size of the structure */
485 * Return the final size of the structure 462
486 */
487 *structure_size = struct_size; 463 *structure_size = struct_size;
488 return_ACPI_STATUS (AE_OK); 464 return_ACPI_STATUS (AE_OK);
489} 465}
@@ -533,9 +509,8 @@ acpi_rs_start_depend_fns_stream (
533 *buffer = 0x31; 509 *buffer = 0x31;
534 buffer += 1; 510 buffer += 1;
535 511
536 /* 512 /* Set the Priority Byte Definition */
537 * Set the Priority Byte Definition 513
538 */
539 temp8 = 0; 514 temp8 = 0;
540 temp8 = (u8) ((linked_list->data.start_dpf.performance_robustness & 515 temp8 = (u8) ((linked_list->data.start_dpf.performance_robustness &
541 0x03) << 2); 516 0x03) << 2);
@@ -546,9 +521,8 @@ acpi_rs_start_depend_fns_stream (
546 521
547 buffer += 1; 522 buffer += 1;
548 523
549 /* 524 /* Return the number of bytes consumed in this operation */
550 * Return the number of bytes consumed in this operation 525
551 */
552 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); 526 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer);
553 return_ACPI_STATUS (AE_OK); 527 return_ACPI_STATUS (AE_OK);
554} 528}
@@ -582,15 +556,13 @@ acpi_rs_end_depend_fns_stream (
582 ACPI_FUNCTION_TRACE ("rs_end_depend_fns_stream"); 556 ACPI_FUNCTION_TRACE ("rs_end_depend_fns_stream");
583 557
584 558
585 /* 559 /* The descriptor field is static */
586 * The descriptor field is static 560
587 */
588 *buffer = 0x38; 561 *buffer = 0x38;
589 buffer += 1; 562 buffer += 1;
590 563
591 /* 564 /* Return the number of bytes consumed in this operation */
592 * Return the number of bytes consumed in this operation 565
593 */
594 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer); 566 *bytes_consumed = ACPI_PTR_DIFF (buffer, *output_buffer);
595 return_ACPI_STATUS (AE_OK); 567 return_ACPI_STATUS (AE_OK);
596} 568}
diff --git a/drivers/acpi/resources/rsutils.c b/drivers/acpi/resources/rsutils.c
index ee9ce13c053d..700cf7d65d76 100644
--- a/drivers/acpi/resources/rsutils.c
+++ b/drivers/acpi/resources/rsutils.c
@@ -83,10 +83,10 @@ acpi_rs_get_prt_method_data (
83 83
84 /* Parameters guaranteed valid by caller */ 84 /* Parameters guaranteed valid by caller */
85 85
86 /* 86 /* Execute the method, no parameters */
87 * Execute the method, no parameters 87
88 */ 88 status = acpi_ut_evaluate_object (handle, METHOD_NAME__PRT,
89 status = acpi_ut_evaluate_object (handle, "_PRT", ACPI_BTYPE_PACKAGE, &obj_desc); 89 ACPI_BTYPE_PACKAGE, &obj_desc);
90 if (ACPI_FAILURE (status)) { 90 if (ACPI_FAILURE (status)) {
91 return_ACPI_STATUS (status); 91 return_ACPI_STATUS (status);
92 } 92 }
@@ -136,10 +136,10 @@ acpi_rs_get_crs_method_data (
136 136
137 /* Parameters guaranteed valid by caller */ 137 /* Parameters guaranteed valid by caller */
138 138
139 /* 139 /* Execute the method, no parameters */
140 * Execute the method, no parameters 140
141 */ 141 status = acpi_ut_evaluate_object (handle, METHOD_NAME__CRS,
142 status = acpi_ut_evaluate_object (handle, "_CRS", ACPI_BTYPE_BUFFER, &obj_desc); 142 ACPI_BTYPE_BUFFER, &obj_desc);
143 if (ACPI_FAILURE (status)) { 143 if (ACPI_FAILURE (status)) {
144 return_ACPI_STATUS (status); 144 return_ACPI_STATUS (status);
145 } 145 }
@@ -175,6 +175,7 @@ acpi_rs_get_crs_method_data (
175 * and the contents of the callers buffer is undefined. 175 * and the contents of the callers buffer is undefined.
176 * 176 *
177 ******************************************************************************/ 177 ******************************************************************************/
178
178#ifdef ACPI_FUTURE_USAGE 179#ifdef ACPI_FUTURE_USAGE
179acpi_status 180acpi_status
180acpi_rs_get_prs_method_data ( 181acpi_rs_get_prs_method_data (
@@ -190,10 +191,10 @@ acpi_rs_get_prs_method_data (
190 191
191 /* Parameters guaranteed valid by caller */ 192 /* Parameters guaranteed valid by caller */
192 193
193 /* 194 /* Execute the method, no parameters */
194 * Execute the method, no parameters 195
195 */ 196 status = acpi_ut_evaluate_object (handle, METHOD_NAME__PRS,
196 status = acpi_ut_evaluate_object (handle, "_PRS", ACPI_BTYPE_BUFFER, &obj_desc); 197 ACPI_BTYPE_BUFFER, &obj_desc);
197 if (ACPI_FAILURE (status)) { 198 if (ACPI_FAILURE (status)) {
198 return_ACPI_STATUS (status); 199 return_ACPI_STATUS (status);
199 } 200 }
@@ -218,6 +219,7 @@ acpi_rs_get_prs_method_data (
218 * FUNCTION: acpi_rs_get_method_data 219 * FUNCTION: acpi_rs_get_method_data
219 * 220 *
220 * PARAMETERS: Handle - a handle to the containing object 221 * PARAMETERS: Handle - a handle to the containing object
222 * Path - Path to method, relative to Handle
221 * ret_buffer - a pointer to a buffer structure for the 223 * ret_buffer - a pointer to a buffer structure for the
222 * results 224 * results
223 * 225 *
@@ -246,9 +248,8 @@ acpi_rs_get_method_data (
246 248
247 /* Parameters guaranteed valid by caller */ 249 /* Parameters guaranteed valid by caller */
248 250
249 /* 251 /* Execute the method, no parameters */
250 * Execute the method, no parameters 252
251 */
252 status = acpi_ut_evaluate_object (handle, path, ACPI_BTYPE_BUFFER, &obj_desc); 253 status = acpi_ut_evaluate_object (handle, path, ACPI_BTYPE_BUFFER, &obj_desc);
253 if (ACPI_FAILURE (status)) { 254 if (ACPI_FAILURE (status)) {
254 return_ACPI_STATUS (status); 255 return_ACPI_STATUS (status);
@@ -314,18 +315,16 @@ acpi_rs_set_srs_method_data (
314 return_ACPI_STATUS (status); 315 return_ACPI_STATUS (status);
315 } 316 }
316 317
317 /* 318 /* Init the param object */
318 * Init the param object 319
319 */
320 params[0] = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER); 320 params[0] = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER);
321 if (!params[0]) { 321 if (!params[0]) {
322 acpi_os_free (buffer.pointer); 322 acpi_os_free (buffer.pointer);
323 return_ACPI_STATUS (AE_NO_MEMORY); 323 return_ACPI_STATUS (AE_NO_MEMORY);
324 } 324 }
325 325
326 /* 326 /* Set up the parameter object */
327 * Set up the parameter object 327
328 */
329 params[0]->buffer.length = (u32) buffer.length; 328 params[0]->buffer.length = (u32) buffer.length;
330 params[0]->buffer.pointer = buffer.pointer; 329 params[0]->buffer.pointer = buffer.pointer;
331 params[0]->common.flags = AOPOBJ_DATA_VALID; 330 params[0]->common.flags = AOPOBJ_DATA_VALID;
@@ -335,10 +334,9 @@ acpi_rs_set_srs_method_data (
335 info.parameters = params; 334 info.parameters = params;
336 info.parameter_type = ACPI_PARAM_ARGS; 335 info.parameter_type = ACPI_PARAM_ARGS;
337 336
338 /* 337 /* Execute the method, no return value */
339 * Execute the method, no return value 338
340 */ 339 status = acpi_ns_evaluate_relative (METHOD_NAME__SRS, &info);
341 status = acpi_ns_evaluate_relative ("_SRS", &info);
342 if (ACPI_SUCCESS (status)) { 340 if (ACPI_SUCCESS (status)) {
343 /* Delete any return object (especially if implicit_return is enabled) */ 341 /* Delete any return object (especially if implicit_return is enabled) */
344 342
@@ -347,9 +345,8 @@ acpi_rs_set_srs_method_data (
347 } 345 }
348 } 346 }
349 347
350 /* 348 /* Clean up and return the status from acpi_ns_evaluate_relative */
351 * Clean up and return the status from acpi_ns_evaluate_relative 349
352 */
353 acpi_ut_remove_reference (params[0]); 350 acpi_ut_remove_reference (params[0]);
354 return_ACPI_STATUS (status); 351 return_ACPI_STATUS (status);
355} 352}
diff --git a/drivers/acpi/resources/rsxface.c b/drivers/acpi/resources/rsxface.c
index a9cdcbeb3432..83c944b8b097 100644
--- a/drivers/acpi/resources/rsxface.c
+++ b/drivers/acpi/resources/rsxface.c
@@ -49,6 +49,23 @@
49#define _COMPONENT ACPI_RESOURCES 49#define _COMPONENT ACPI_RESOURCES
50 ACPI_MODULE_NAME ("rsxface") 50 ACPI_MODULE_NAME ("rsxface")
51 51
52/* Local macros for 16,32-bit to 64-bit conversion */
53
54#define ACPI_COPY_FIELD(out, in, field) ((out)->field = (in)->field)
55#define ACPI_COPY_ADDRESS(out, in) \
56 ACPI_COPY_FIELD(out, in, resource_type); \
57 ACPI_COPY_FIELD(out, in, producer_consumer); \
58 ACPI_COPY_FIELD(out, in, decode); \
59 ACPI_COPY_FIELD(out, in, min_address_fixed); \
60 ACPI_COPY_FIELD(out, in, max_address_fixed); \
61 ACPI_COPY_FIELD(out, in, attribute); \
62 ACPI_COPY_FIELD(out, in, granularity); \
63 ACPI_COPY_FIELD(out, in, min_address_range); \
64 ACPI_COPY_FIELD(out, in, max_address_range); \
65 ACPI_COPY_FIELD(out, in, address_translation_offset); \
66 ACPI_COPY_FIELD(out, in, address_length); \
67 ACPI_COPY_FIELD(out, in, resource_source);
68
52 69
53/******************************************************************************* 70/*******************************************************************************
54 * 71 *
@@ -180,6 +197,7 @@ EXPORT_SYMBOL(acpi_get_current_resources);
180 * and the value of ret_buffer is undefined. 197 * and the value of ret_buffer is undefined.
181 * 198 *
182 ******************************************************************************/ 199 ******************************************************************************/
200
183#ifdef ACPI_FUTURE_USAGE 201#ifdef ACPI_FUTURE_USAGE
184acpi_status 202acpi_status
185acpi_get_possible_resources ( 203acpi_get_possible_resources (
@@ -346,9 +364,8 @@ acpi_set_current_resources (
346 ACPI_FUNCTION_TRACE ("acpi_set_current_resources"); 364 ACPI_FUNCTION_TRACE ("acpi_set_current_resources");
347 365
348 366
349 /* 367 /* Must have a valid handle and buffer */
350 * Must have a valid handle and buffer 368
351 */
352 if ((!device_handle) || 369 if ((!device_handle) ||
353 (!in_buffer) || 370 (!in_buffer) ||
354 (!in_buffer->pointer) || 371 (!in_buffer->pointer) ||
@@ -362,21 +379,6 @@ acpi_set_current_resources (
362EXPORT_SYMBOL(acpi_set_current_resources); 379EXPORT_SYMBOL(acpi_set_current_resources);
363 380
364 381
365#define ACPI_COPY_FIELD(out, in, field) ((out)->field = (in)->field)
366#define ACPI_COPY_ADDRESS(out, in) \
367 ACPI_COPY_FIELD(out, in, resource_type); \
368 ACPI_COPY_FIELD(out, in, producer_consumer); \
369 ACPI_COPY_FIELD(out, in, decode); \
370 ACPI_COPY_FIELD(out, in, min_address_fixed); \
371 ACPI_COPY_FIELD(out, in, max_address_fixed); \
372 ACPI_COPY_FIELD(out, in, attribute); \
373 ACPI_COPY_FIELD(out, in, granularity); \
374 ACPI_COPY_FIELD(out, in, min_address_range); \
375 ACPI_COPY_FIELD(out, in, max_address_range); \
376 ACPI_COPY_FIELD(out, in, address_translation_offset); \
377 ACPI_COPY_FIELD(out, in, address_length); \
378 ACPI_COPY_FIELD(out, in, resource_source);
379
380/****************************************************************************** 382/******************************************************************************
381 * 383 *
382 * FUNCTION: acpi_resource_to_address64 384 * FUNCTION: acpi_resource_to_address64
@@ -408,14 +410,14 @@ acpi_resource_to_address64 (
408 case ACPI_RSTYPE_ADDRESS16: 410 case ACPI_RSTYPE_ADDRESS16:
409 411
410 address16 = (struct acpi_resource_address16 *) &resource->data; 412 address16 = (struct acpi_resource_address16 *) &resource->data;
411 ACPI_COPY_ADDRESS(out, address16); 413 ACPI_COPY_ADDRESS (out, address16);
412 break; 414 break;
413 415
414 416
415 case ACPI_RSTYPE_ADDRESS32: 417 case ACPI_RSTYPE_ADDRESS32:
416 418
417 address32 = (struct acpi_resource_address32 *) &resource->data; 419 address32 = (struct acpi_resource_address32 *) &resource->data;
418 ACPI_COPY_ADDRESS(out, address32); 420 ACPI_COPY_ADDRESS (out, address32);
419 break; 421 break;
420 422
421 423
@@ -434,4 +436,3 @@ acpi_resource_to_address64 (
434 return (AE_OK); 436 return (AE_OK);
435} 437}
436EXPORT_SYMBOL(acpi_resource_to_address64); 438EXPORT_SYMBOL(acpi_resource_to_address64);
437