rsmisc.c (241973) | rsmisc.c (243347) |
---|---|
1/******************************************************************************* 2 * 3 * Module Name: rsmisc - Miscellaneous resource descriptors 4 * 5 ******************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2012, Intel Corp. --- 138 unchanged lines hidden (view full) --- 147 FlagsMode = TRUE; 148 break; 149 150 151 case ACPI_RSC_1BITFLAG: 152 /* 153 * Mask and shift the flag bit 154 */ | 1/******************************************************************************* 2 * 3 * Module Name: rsmisc - Miscellaneous resource descriptors 4 * 5 ******************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2012, Intel Corp. --- 138 unchanged lines hidden (view full) --- 147 FlagsMode = TRUE; 148 break; 149 150 151 case ACPI_RSC_1BITFLAG: 152 /* 153 * Mask and shift the flag bit 154 */ |
155 ACPI_SET8 (Destination) = (UINT8) 156 ((ACPI_GET8 (Source) >> Info->Value) & 0x01); | 155 ACPI_SET8 (Destination, 156 ((ACPI_GET8 (Source) >> Info->Value) & 0x01)); |
157 break; 158 159 160 case ACPI_RSC_2BITFLAG: 161 /* 162 * Mask and shift the flag bits 163 */ | 157 break; 158 159 160 case ACPI_RSC_2BITFLAG: 161 /* 162 * Mask and shift the flag bits 163 */ |
164 ACPI_SET8 (Destination) = (UINT8) 165 ((ACPI_GET8 (Source) >> Info->Value) & 0x03); | 164 ACPI_SET8 (Destination, 165 ((ACPI_GET8 (Source) >> Info->Value) & 0x03)); |
166 break; 167 168 169 case ACPI_RSC_3BITFLAG: 170 /* 171 * Mask and shift the flag bits 172 */ | 166 break; 167 168 169 case ACPI_RSC_3BITFLAG: 170 /* 171 * Mask and shift the flag bits 172 */ |
173 ACPI_SET8 (Destination) = (UINT8) 174 ((ACPI_GET8 (Source) >> Info->Value) & 0x07); | 173 ACPI_SET8 (Destination, 174 ((ACPI_GET8 (Source) >> Info->Value) & 0x07)); |
175 break; 176 177 178 case ACPI_RSC_COUNT: 179 180 ItemCount = ACPI_GET8 (Source); | 175 break; 176 177 178 case ACPI_RSC_COUNT: 179 180 ItemCount = ACPI_GET8 (Source); |
181 ACPI_SET8 (Destination) = (UINT8) ItemCount; | 181 ACPI_SET8 (Destination, ItemCount); |
182 183 Resource->Length = Resource->Length + 184 (Info->Value * (ItemCount - 1)); 185 break; 186 187 188 case ACPI_RSC_COUNT16: 189 190 ItemCount = AmlResourceLength; | 182 183 Resource->Length = Resource->Length + 184 (Info->Value * (ItemCount - 1)); 185 break; 186 187 188 case ACPI_RSC_COUNT16: 189 190 ItemCount = AmlResourceLength; |
191 ACPI_SET16 (Destination) = ItemCount; | 191 ACPI_SET16 (Destination, ItemCount); |
192 193 Resource->Length = Resource->Length + 194 (Info->Value * (ItemCount - 1)); 195 break; 196 197 198 case ACPI_RSC_COUNT_GPIO_PIN: 199 200 Target = ACPI_ADD_PTR (void, Aml, Info->Value); 201 ItemCount = ACPI_GET16 (Target) - ACPI_GET16 (Source); 202 203 Resource->Length = Resource->Length + ItemCount; 204 ItemCount = ItemCount / 2; | 192 193 Resource->Length = Resource->Length + 194 (Info->Value * (ItemCount - 1)); 195 break; 196 197 198 case ACPI_RSC_COUNT_GPIO_PIN: 199 200 Target = ACPI_ADD_PTR (void, Aml, Info->Value); 201 ItemCount = ACPI_GET16 (Target) - ACPI_GET16 (Source); 202 203 Resource->Length = Resource->Length + ItemCount; 204 ItemCount = ItemCount / 2; |
205 ACPI_SET16 (Destination) = ItemCount; | 205 ACPI_SET16 (Destination, ItemCount); |
206 break; 207 208 209 case ACPI_RSC_COUNT_GPIO_VEN: 210 211 ItemCount = ACPI_GET8 (Source); | 206 break; 207 208 209 case ACPI_RSC_COUNT_GPIO_VEN: 210 211 ItemCount = ACPI_GET8 (Source); |
212 ACPI_SET8 (Destination) = (UINT8) ItemCount; | 212 ACPI_SET8 (Destination, ItemCount); |
213 214 Resource->Length = Resource->Length + 215 (Info->Value * ItemCount); 216 break; 217 218 219 case ACPI_RSC_COUNT_GPIO_RES: 220 --- 14 unchanged lines hidden (view full) --- 235 /* No vendor data to worry about */ 236 237 ItemCount = Aml->LargeHeader.ResourceLength + 238 sizeof (AML_RESOURCE_LARGE_HEADER) - 239 ACPI_GET16 (Source); 240 } 241 242 Resource->Length = Resource->Length + ItemCount; | 213 214 Resource->Length = Resource->Length + 215 (Info->Value * ItemCount); 216 break; 217 218 219 case ACPI_RSC_COUNT_GPIO_RES: 220 --- 14 unchanged lines hidden (view full) --- 235 /* No vendor data to worry about */ 236 237 ItemCount = Aml->LargeHeader.ResourceLength + 238 sizeof (AML_RESOURCE_LARGE_HEADER) - 239 ACPI_GET16 (Source); 240 } 241 242 Resource->Length = Resource->Length + ItemCount; |
243 ACPI_SET16 (Destination) = ItemCount; | 243 ACPI_SET16 (Destination, ItemCount); |
244 break; 245 246 247 case ACPI_RSC_COUNT_SERIAL_VEN: 248 249 ItemCount = ACPI_GET16 (Source) - Info->Value; 250 251 Resource->Length = Resource->Length + ItemCount; | 244 break; 245 246 247 case ACPI_RSC_COUNT_SERIAL_VEN: 248 249 ItemCount = ACPI_GET16 (Source) - Info->Value; 250 251 Resource->Length = Resource->Length + ItemCount; |
252 ACPI_SET16 (Destination) = ItemCount; | 252 ACPI_SET16 (Destination, ItemCount); |
253 break; 254 255 256 case ACPI_RSC_COUNT_SERIAL_RES: 257 258 ItemCount = (AmlResourceLength + 259 sizeof (AML_RESOURCE_LARGE_HEADER)) - 260 ACPI_GET16 (Source) - Info->Value; 261 262 Resource->Length = Resource->Length + ItemCount; | 253 break; 254 255 256 case ACPI_RSC_COUNT_SERIAL_RES: 257 258 ItemCount = (AmlResourceLength + 259 sizeof (AML_RESOURCE_LARGE_HEADER)) - 260 ACPI_GET16 (Source) - Info->Value; 261 262 Resource->Length = Resource->Length + ItemCount; |
263 ACPI_SET16 (Destination) = ItemCount; | 263 ACPI_SET16 (Destination, ItemCount); |
264 break; 265 266 267 case ACPI_RSC_LENGTH: 268 269 Resource->Length = Resource->Length + Info->Value; 270 break; 271 --- 129 unchanged lines hidden (view full) --- 401 */ 402 ItemCount = AcpiRsDecodeBitmask (ACPI_GET8 (Source), Destination); 403 if (ItemCount) 404 { 405 Resource->Length += (ItemCount - 1); 406 } 407 408 Target = ACPI_ADD_PTR (char, Resource, Info->Value); | 264 break; 265 266 267 case ACPI_RSC_LENGTH: 268 269 Resource->Length = Resource->Length + Info->Value; 270 break; 271 --- 129 unchanged lines hidden (view full) --- 401 */ 402 ItemCount = AcpiRsDecodeBitmask (ACPI_GET8 (Source), Destination); 403 if (ItemCount) 404 { 405 Resource->Length += (ItemCount - 1); 406 } 407 408 Target = ACPI_ADD_PTR (char, Resource, Info->Value); |
409 ACPI_SET8 (Target) = (UINT8) ItemCount; | 409 ACPI_SET8 (Target, ItemCount); |
410 break; 411 412 413 case ACPI_RSC_BITMASK16: 414 /* 415 * 16-bit encoded bitmask (IRQ macro) 416 */ 417 ACPI_MOVE_16_TO_16 (&Temp16, Source); 418 419 ItemCount = AcpiRsDecodeBitmask (Temp16, Destination); 420 if (ItemCount) 421 { 422 Resource->Length += (ItemCount - 1); 423 } 424 425 Target = ACPI_ADD_PTR (char, Resource, Info->Value); | 410 break; 411 412 413 case ACPI_RSC_BITMASK16: 414 /* 415 * 16-bit encoded bitmask (IRQ macro) 416 */ 417 ACPI_MOVE_16_TO_16 (&Temp16, Source); 418 419 ItemCount = AcpiRsDecodeBitmask (Temp16, Destination); 420 if (ItemCount) 421 { 422 Resource->Length += (ItemCount - 1); 423 } 424 425 Target = ACPI_ADD_PTR (char, Resource, Info->Value); |
426 ACPI_SET8 (Target) = (UINT8) ItemCount; | 426 ACPI_SET8 (Target, ItemCount); |
427 break; 428 429 430 case ACPI_RSC_EXIT_NE: 431 /* 432 * Control - Exit conversion if not equal 433 */ 434 switch (Info->ResourceOffset) --- 107 unchanged lines hidden (view full) --- 542 case ACPI_RSC_INITGET: 543 break; 544 545 546 case ACPI_RSC_FLAGINIT: 547 /* 548 * Clear the flag byte 549 */ | 427 break; 428 429 430 case ACPI_RSC_EXIT_NE: 431 /* 432 * Control - Exit conversion if not equal 433 */ 434 switch (Info->ResourceOffset) --- 107 unchanged lines hidden (view full) --- 542 case ACPI_RSC_INITGET: 543 break; 544 545 546 case ACPI_RSC_FLAGINIT: 547 /* 548 * Clear the flag byte 549 */ |
550 ACPI_SET8 (Destination) = 0; | 550 ACPI_SET8 (Destination, 0); |
551 break; 552 553 554 case ACPI_RSC_1BITFLAG: 555 /* 556 * Mask and shift the flag bit 557 */ | 551 break; 552 553 554 case ACPI_RSC_1BITFLAG: 555 /* 556 * Mask and shift the flag bit 557 */ |
558 ACPI_SET8 (Destination) |= (UINT8) 559 ((ACPI_GET8 (Source) & 0x01) << Info->Value); | 558 ACPI_SET_BIT (*ACPI_CAST8 (Destination), (UINT8) 559 ((ACPI_GET8 (Source) & 0x01) << Info->Value)); |
560 break; 561 562 563 case ACPI_RSC_2BITFLAG: 564 /* 565 * Mask and shift the flag bits 566 */ | 560 break; 561 562 563 case ACPI_RSC_2BITFLAG: 564 /* 565 * Mask and shift the flag bits 566 */ |
567 ACPI_SET8 (Destination) |= (UINT8) 568 ((ACPI_GET8 (Source) & 0x03) << Info->Value); | 567 ACPI_SET_BIT (*ACPI_CAST8 (Destination), (UINT8) 568 ((ACPI_GET8 (Source) & 0x03) << Info->Value)); |
569 break; 570 571 572 case ACPI_RSC_3BITFLAG: 573 /* 574 * Mask and shift the flag bits 575 */ | 569 break; 570 571 572 case ACPI_RSC_3BITFLAG: 573 /* 574 * Mask and shift the flag bits 575 */ |
576 ACPI_SET8 (Destination) |= (UINT8) 577 ((ACPI_GET8 (Source) & 0x07) << Info->Value); | 576 ACPI_SET_BIT (*ACPI_CAST8 (Destination), (UINT8) 577 ((ACPI_GET8 (Source) & 0x07) << Info->Value)); |
578 break; 579 580 581 case ACPI_RSC_COUNT: 582 583 ItemCount = ACPI_GET8 (Source); | 578 break; 579 580 581 case ACPI_RSC_COUNT: 582 583 ItemCount = ACPI_GET8 (Source); |
584 ACPI_SET8 (Destination) = (UINT8) ItemCount; | 584 ACPI_SET8 (Destination, ItemCount); |
585 586 AmlLength = (UINT16) (AmlLength + (Info->Value * (ItemCount - 1))); 587 break; 588 589 590 case ACPI_RSC_COUNT16: 591 592 ItemCount = ACPI_GET16 (Source); 593 AmlLength = (UINT16) (AmlLength + ItemCount); 594 AcpiRsSetResourceLength (AmlLength, Aml); 595 break; 596 597 598 case ACPI_RSC_COUNT_GPIO_PIN: 599 600 ItemCount = ACPI_GET16 (Source); | 585 586 AmlLength = (UINT16) (AmlLength + (Info->Value * (ItemCount - 1))); 587 break; 588 589 590 case ACPI_RSC_COUNT16: 591 592 ItemCount = ACPI_GET16 (Source); 593 AmlLength = (UINT16) (AmlLength + ItemCount); 594 AcpiRsSetResourceLength (AmlLength, Aml); 595 break; 596 597 598 case ACPI_RSC_COUNT_GPIO_PIN: 599 600 ItemCount = ACPI_GET16 (Source); |
601 ACPI_SET16 (Destination) = (UINT16) AmlLength; | 601 ACPI_SET16 (Destination, AmlLength); |
602 603 AmlLength = (UINT16) (AmlLength + ItemCount * 2); 604 Target = ACPI_ADD_PTR (void, Aml, Info->Value); | 602 603 AmlLength = (UINT16) (AmlLength + ItemCount * 2); 604 Target = ACPI_ADD_PTR (void, Aml, Info->Value); |
605 ACPI_SET16 (Target) = (UINT16) AmlLength; | 605 ACPI_SET16 (Target, AmlLength); |
606 AcpiRsSetResourceLength (AmlLength, Aml); 607 break; 608 609 610 case ACPI_RSC_COUNT_GPIO_VEN: 611 612 ItemCount = ACPI_GET16 (Source); | 606 AcpiRsSetResourceLength (AmlLength, Aml); 607 break; 608 609 610 case ACPI_RSC_COUNT_GPIO_VEN: 611 612 ItemCount = ACPI_GET16 (Source); |
613 ACPI_SET16 (Destination) = (UINT16) ItemCount; | 613 ACPI_SET16 (Destination, ItemCount); |
614 615 AmlLength = (UINT16) (AmlLength + (Info->Value * ItemCount)); 616 AcpiRsSetResourceLength (AmlLength, Aml); 617 break; 618 619 620 case ACPI_RSC_COUNT_GPIO_RES: 621 622 /* Set resource source string length */ 623 624 ItemCount = ACPI_GET16 (Source); | 614 615 AmlLength = (UINT16) (AmlLength + (Info->Value * ItemCount)); 616 AcpiRsSetResourceLength (AmlLength, Aml); 617 break; 618 619 620 case ACPI_RSC_COUNT_GPIO_RES: 621 622 /* Set resource source string length */ 623 624 ItemCount = ACPI_GET16 (Source); |
625 ACPI_SET16 (Destination) = (UINT16) AmlLength; | 625 ACPI_SET16 (Destination, AmlLength); |
626 627 /* Compute offset for the Vendor Data */ 628 629 AmlLength = (UINT16) (AmlLength + ItemCount); 630 Target = ACPI_ADD_PTR (void, Aml, Info->Value); 631 632 /* Set vendor offset only if there is vendor data */ 633 634 if (Resource->Data.Gpio.VendorLength) 635 { | 626 627 /* Compute offset for the Vendor Data */ 628 629 AmlLength = (UINT16) (AmlLength + ItemCount); 630 Target = ACPI_ADD_PTR (void, Aml, Info->Value); 631 632 /* Set vendor offset only if there is vendor data */ 633 634 if (Resource->Data.Gpio.VendorLength) 635 { |
636 ACPI_SET16 (Target) = (UINT16) AmlLength; | 636 ACPI_SET16 (Target, AmlLength); |
637 } 638 639 AcpiRsSetResourceLength (AmlLength, Aml); 640 break; 641 642 643 case ACPI_RSC_COUNT_SERIAL_VEN: 644 645 ItemCount = ACPI_GET16 (Source); | 637 } 638 639 AcpiRsSetResourceLength (AmlLength, Aml); 640 break; 641 642 643 case ACPI_RSC_COUNT_SERIAL_VEN: 644 645 ItemCount = ACPI_GET16 (Source); |
646 ACPI_SET16 (Destination) = ItemCount + Info->Value; | 646 ACPI_SET16 (Destination, ItemCount + Info->Value); |
647 AmlLength = (UINT16) (AmlLength + ItemCount); 648 AcpiRsSetResourceLength (AmlLength, Aml); 649 break; 650 651 652 case ACPI_RSC_COUNT_SERIAL_RES: 653 654 ItemCount = ACPI_GET16 (Source); --- 86 unchanged lines hidden (view full) --- 741 AcpiRsSetResourceLength (AmlLength, Aml); 742 break; 743 744 745 case ACPI_RSC_BITMASK: 746 /* 747 * 8-bit encoded bitmask (DMA macro) 748 */ | 647 AmlLength = (UINT16) (AmlLength + ItemCount); 648 AcpiRsSetResourceLength (AmlLength, Aml); 649 break; 650 651 652 case ACPI_RSC_COUNT_SERIAL_RES: 653 654 ItemCount = ACPI_GET16 (Source); --- 86 unchanged lines hidden (view full) --- 741 AcpiRsSetResourceLength (AmlLength, Aml); 742 break; 743 744 745 case ACPI_RSC_BITMASK: 746 /* 747 * 8-bit encoded bitmask (DMA macro) 748 */ |
749 ACPI_SET8 (Destination) = (UINT8) | 749 ACPI_SET8 (Destination, |
750 AcpiRsEncodeBitmask (Source, | 750 AcpiRsEncodeBitmask (Source, |
751 *ACPI_ADD_PTR (UINT8, Resource, Info->Value)); | 751 *ACPI_ADD_PTR (UINT8, Resource, Info->Value))); |
752 break; 753 754 755 case ACPI_RSC_BITMASK16: 756 /* 757 * 16-bit encoded bitmask (IRQ macro) 758 */ 759 Temp16 = AcpiRsEncodeBitmask (Source, --- 108 unchanged lines hidden --- | 752 break; 753 754 755 case ACPI_RSC_BITMASK16: 756 /* 757 * 16-bit encoded bitmask (IRQ macro) 758 */ 759 Temp16 = AcpiRsEncodeBitmask (Source, --- 108 unchanged lines hidden --- |