diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2015-11-25 21:04:42 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2015-11-25 21:04:42 +0000 |
commit | b9098066cd6284319bca922f13e59517f774a103 (patch) | |
tree | f01fd6c9053cb01ed84c00cb42ee789adafceaf5 /source/components/resources/rsmisc.c | |
parent | 1e24cf365bc9c8df179b145c90d52852724e54ee (diff) |
Notes
Diffstat (limited to 'source/components/resources/rsmisc.c')
-rw-r--r-- | source/components/resources/rsmisc.c | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/source/components/resources/rsmisc.c b/source/components/resources/rsmisc.c index 83f50aa95dacd..a47a8cce25667 100644 --- a/source/components/resources/rsmisc.c +++ b/source/components/resources/rsmisc.c @@ -121,7 +121,7 @@ AcpiRsConvertAmlToResource ( * Source is the external AML byte stream buffer, * destination is the internal resource descriptor */ - Source = ACPI_ADD_PTR (void, Aml, Info->AmlOffset); + Source = ACPI_ADD_PTR (void, Aml, Info->AmlOffset); Destination = ACPI_ADD_PTR (void, Resource, Info->ResourceOffset); switch (Info->Opcode) @@ -200,8 +200,7 @@ AcpiRsConvertAmlToResource ( ItemCount = ACPI_GET8 (Source); ACPI_SET8 (Destination, ItemCount); - Resource->Length = Resource->Length + - (Info->Value * ItemCount); + Resource->Length = Resource->Length + (Info->Value * ItemCount); break; case ACPI_RSC_COUNT_GPIO_RES: @@ -273,7 +272,7 @@ AcpiRsConvertAmlToResource ( /* Generate and set the PIN data pointer */ Target = (char *) ACPI_ADD_PTR (void, Resource, - (Resource->Length - ItemCount * 2)); + (Resource->Length - ItemCount * 2)); *(UINT16 **) Destination = ACPI_CAST_PTR (UINT16, Target); /* Copy the PIN data */ @@ -287,7 +286,7 @@ AcpiRsConvertAmlToResource ( /* Generate and set the ResourceSource string pointer */ Target = (char *) ACPI_ADD_PTR (void, Resource, - (Resource->Length - ItemCount)); + (Resource->Length - ItemCount)); *(UINT8 **) Destination = ACPI_CAST_PTR (UINT8, Target); /* Copy the ResourceSource string */ @@ -301,7 +300,7 @@ AcpiRsConvertAmlToResource ( /* Generate and set the Vendor Data pointer */ Target = (char *) ACPI_ADD_PTR (void, Resource, - (Resource->Length - ItemCount)); + (Resource->Length - ItemCount)); *(UINT8 **) Destination = ACPI_CAST_PTR (UINT8, Target); /* Copy the Vendor Data */ @@ -315,12 +314,13 @@ AcpiRsConvertAmlToResource ( /* Generate and set the ResourceSource string pointer */ Target = (char *) ACPI_ADD_PTR (void, Resource, - (Resource->Length - ItemCount)); + (Resource->Length - ItemCount)); *(UINT8 **) Destination = ACPI_CAST_PTR (UINT8, Target); /* Copy the ResourceSource string */ - Source = ACPI_ADD_PTR (void, Aml, (ACPI_GET16 (Source) + Info->Value)); + Source = ACPI_ADD_PTR ( + void, Aml, (ACPI_GET16 (Source) + Info->Value)); AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode); break; @@ -442,7 +442,8 @@ Exit: { /* Round the resource struct length up to the next boundary (32 or 64) */ - Resource->Length = (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (Resource->Length); + Resource->Length = (UINT32) + ACPI_ROUND_UP_TO_NATIVE_WORD (Resource->Length); } return_ACPI_STATUS (AE_OK); } @@ -498,7 +499,7 @@ AcpiRsConvertResourceToAml ( * Source is the internal resource descriptor, * destination is the external AML byte stream buffer */ - Source = ACPI_ADD_PTR (void, Resource, Info->ResourceOffset); + Source = ACPI_ADD_PTR (void, Resource, Info->ResourceOffset); Destination = ACPI_ADD_PTR (void, Aml, Info->AmlOffset); switch (Info->Opcode) @@ -507,7 +508,8 @@ AcpiRsConvertResourceToAml ( memset (Aml, 0, INIT_RESOURCE_LENGTH (Info)); AmlLength = INIT_RESOURCE_LENGTH (Info); - AcpiRsSetResourceHeader (INIT_RESOURCE_TYPE (Info), AmlLength, Aml); + AcpiRsSetResourceHeader ( + INIT_RESOURCE_TYPE (Info), AmlLength, Aml); break; case ACPI_RSC_INITGET: @@ -549,7 +551,8 @@ AcpiRsConvertResourceToAml ( ItemCount = ACPI_GET8 (Source); ACPI_SET8 (Destination, ItemCount); - AmlLength = (UINT16) (AmlLength + (Info->Value * (ItemCount - 1))); + AmlLength = (UINT16) + (AmlLength + (Info->Value * (ItemCount - 1))); break; case ACPI_RSC_COUNT16: @@ -575,7 +578,8 @@ AcpiRsConvertResourceToAml ( ItemCount = ACPI_GET16 (Source); ACPI_SET16 (Destination, ItemCount); - AmlLength = (UINT16) (AmlLength + (Info->Value * ItemCount)); + AmlLength = (UINT16) ( + AmlLength + (Info->Value * ItemCount)); AcpiRsSetResourceLength (AmlLength, Aml); break; @@ -636,7 +640,7 @@ AcpiRsConvertResourceToAml ( case ACPI_RSC_MOVE_GPIO_PIN: Destination = (char *) ACPI_ADD_PTR (void, Aml, - ACPI_GET16 (Destination)); + ACPI_GET16 (Destination)); Source = * (UINT16 **) Source; AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); break; @@ -646,7 +650,7 @@ AcpiRsConvertResourceToAml ( /* Used for both ResourceSource string and VendorData */ Destination = (char *) ACPI_ADD_PTR (void, Aml, - ACPI_GET16 (Destination)); + ACPI_GET16 (Destination)); Source = * (UINT8 **) Source; AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); break; @@ -654,7 +658,7 @@ AcpiRsConvertResourceToAml ( case ACPI_RSC_MOVE_SERIAL_VEN: Destination = (char *) ACPI_ADD_PTR (void, Aml, - (AmlLength - ItemCount)); + (AmlLength - ItemCount)); Source = * (UINT8 **) Source; AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); break; @@ -662,7 +666,7 @@ AcpiRsConvertResourceToAml ( case ACPI_RSC_MOVE_SERIAL_RES: Destination = (char *) ACPI_ADD_PTR (void, Aml, - (AmlLength - ItemCount)); + (AmlLength - ItemCount)); Source = * (UINT8 **) Source; AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); break; @@ -679,7 +683,7 @@ AcpiRsConvertResourceToAml ( * Optional ResourceSource (Index and String) */ AmlLength = AcpiRsSetResourceSource ( - Aml, (ACPI_RS_LENGTH) AmlLength, Source); + Aml, (ACPI_RS_LENGTH) AmlLength, Source); AcpiRsSetResourceLength (AmlLength, Aml); break; @@ -705,8 +709,8 @@ AcpiRsConvertResourceToAml ( /* * 16-bit encoded bitmask (IRQ macro) */ - Temp16 = AcpiRsEncodeBitmask (Source, - *ACPI_ADD_PTR (UINT8, Resource, Info->Value)); + Temp16 = AcpiRsEncodeBitmask ( + Source, *ACPI_ADD_PTR (UINT8, Resource, Info->Value)); ACPI_MOVE_16_TO_16 (Destination, &Temp16); break; @@ -729,7 +733,7 @@ AcpiRsConvertResourceToAml ( case ACPI_RSC_COMPARE_VALUE: if (*ACPI_ADD_PTR (UINT8, Resource, - COMPARE_TARGET (Info)) != COMPARE_VALUE (Info)) + COMPARE_TARGET (Info)) != COMPARE_VALUE (Info)) { goto Exit; } @@ -747,7 +751,7 @@ AcpiRsConvertResourceToAml ( * Control - Exit conversion if equal */ if (*ACPI_ADD_PTR (UINT8, Resource, - COMPARE_TARGET (Info)) == COMPARE_VALUE (Info)) + COMPARE_TARGET (Info)) == COMPARE_VALUE (Info)) { goto Exit; } @@ -771,7 +775,8 @@ Exit: #if 0 /* Previous resource validations */ - if (Aml->ExtAddress64.RevisionID != AML_RESOURCE_EXTENDED_ADDRESS_REVISION) + if (Aml->ExtAddress64.RevisionID != + AML_RESOURCE_EXTENDED_ADDRESS_REVISION) { return_ACPI_STATUS (AE_SUPPORT); } |