diff options
Diffstat (limited to 'sys/contrib/dev/acpica/components/resources/rsmisc.c')
-rw-r--r-- | sys/contrib/dev/acpica/components/resources/rsmisc.c | 61 |
1 files changed, 33 insertions, 28 deletions
diff --git a/sys/contrib/dev/acpica/components/resources/rsmisc.c b/sys/contrib/dev/acpica/components/resources/rsmisc.c index bc5b803..57e85dd 100644 --- a/sys/contrib/dev/acpica/components/resources/rsmisc.c +++ b/sys/contrib/dev/acpica/components/resources/rsmisc.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -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) @@ -130,7 +130,7 @@ AcpiRsConvertAmlToResource ( /* * Get the resource type and the initial (minimum) length */ - ACPI_MEMSET (Resource, 0, INIT_RESOURCE_LENGTH (Info)); + memset (Resource, 0, INIT_RESOURCE_LENGTH (Info)); Resource->Type = INIT_RESOURCE_TYPE (Info); Resource->Length = INIT_RESOURCE_LENGTH (Info); break; @@ -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,24 +314,25 @@ 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; case ACPI_RSC_SET8: - ACPI_MEMSET (Destination, Info->AmlOffset, Info->Value); + memset (Destination, Info->AmlOffset, Info->Value); break; case ACPI_RSC_DATA8: Target = ACPI_ADD_PTR (char, Resource, Info->Value); - ACPI_MEMCPY (Destination, Source, ACPI_GET16 (Target)); + memcpy (Destination, Source, ACPI_GET16 (Target)); break; case ACPI_RSC_ADDRESS: @@ -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,16 +499,17 @@ 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) { case ACPI_RSC_INITSET: - ACPI_MEMSET (Aml, 0, INIT_RESOURCE_LENGTH (Info)); + 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); } |