diff options
author | dim <dim@FreeBSD.org> | 2015-04-04 10:17:51 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-04-04 10:17:51 +0000 |
commit | 441da571d47ec226c5c1799fe6e9dad14931a813 (patch) | |
tree | 03ae73b5fa8cee569039a08677ba8f5db4c7032b /sys/contrib/dev/acpica/components/resources | |
parent | a66c38928305566ab81042d4242432a649ec767f (diff) | |
download | FreeBSD-src-441da571d47ec226c5c1799fe6e9dad14931a813.zip FreeBSD-src-441da571d47ec226c5c1799fe6e9dad14931a813.tar.gz |
MFC r272444 (by jkim):
Merge ACPICA 20140926.
MFC r278970 (by jkim):
Merge ACPICA 20141107 and 20150204.
Approved by: jkim
Relnotes: yes
Diffstat (limited to 'sys/contrib/dev/acpica/components/resources')
14 files changed, 55 insertions, 78 deletions
diff --git a/sys/contrib/dev/acpica/components/resources/rsaddr.c b/sys/contrib/dev/acpica/components/resources/rsaddr.c index a8fa79d..f05c4fc 100644 --- a/sys/contrib/dev/acpica/components/resources/rsaddr.c +++ b/sys/contrib/dev/acpica/components/resources/rsaddr.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#define __RSADDR_C__ - #include <contrib/dev/acpica/include/acpi.h> #include <contrib/dev/acpica/include/accommon.h> #include <contrib/dev/acpica/include/acresrc.h> diff --git a/sys/contrib/dev/acpica/components/resources/rscalc.c b/sys/contrib/dev/acpica/components/resources/rscalc.c index 7fadb41..38db8c1 100644 --- a/sys/contrib/dev/acpica/components/resources/rscalc.c +++ b/sys/contrib/dev/acpica/components/resources/rscalc.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#define __RSCALC_C__ - #include <contrib/dev/acpica/include/acpi.h> #include <contrib/dev/acpica/include/accommon.h> #include <contrib/dev/acpica/include/acresrc.h> @@ -197,6 +195,7 @@ AcpiRsStreamOptionLength ( * FUNCTION: AcpiRsGetAmlLength * * PARAMETERS: Resource - Pointer to the resource linked list + * ResourceListSize - Size of the resource linked list * SizeNeeded - Where the required size is returned * * RETURN: Status @@ -210,9 +209,11 @@ AcpiRsStreamOptionLength ( ACPI_STATUS AcpiRsGetAmlLength ( ACPI_RESOURCE *Resource, + ACPI_SIZE ResourceListSize, ACPI_SIZE *SizeNeeded) { ACPI_SIZE AmlSizeNeeded = 0; + ACPI_RESOURCE *ResourceEnd; ACPI_RS_LENGTH TotalSize; @@ -221,7 +222,8 @@ AcpiRsGetAmlLength ( /* Traverse entire list of internal resource descriptors */ - while (Resource) + ResourceEnd = ACPI_ADD_PTR (ACPI_RESOURCE, Resource, ResourceListSize); + while (Resource < ResourceEnd) { /* Validate the descriptor type */ @@ -655,7 +657,7 @@ AcpiRsGetPciRoutingTableLength ( for (Index = 0; Index < NumberOfElements; Index++) { - /* Dereference the sub-package */ + /* Dereference the subpackage */ PackageElement = *TopObjectList; diff --git a/sys/contrib/dev/acpica/components/resources/rscreate.c b/sys/contrib/dev/acpica/components/resources/rscreate.c index b599666..c646129 100644 --- a/sys/contrib/dev/acpica/components/resources/rscreate.c +++ b/sys/contrib/dev/acpica/components/resources/rscreate.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#define __RSCREATE_C__ - #include <contrib/dev/acpica/include/acpi.h> #include <contrib/dev/acpica/include/accommon.h> #include <contrib/dev/acpica/include/acresrc.h> @@ -77,6 +75,10 @@ AcpiBufferToResource ( void *Resource; void *CurrentResourcePtr; + + ACPI_FUNCTION_TRACE (AcpiBufferToResource); + + /* * Note: we allow AE_AML_NO_RESOURCE_END_TAG, since an end tag * is not required here. @@ -92,7 +94,7 @@ AcpiBufferToResource ( } if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } /* Allocate a buffer for the converted resource */ @@ -101,7 +103,7 @@ AcpiBufferToResource ( CurrentResourcePtr = Resource; if (!Resource) { - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_NO_MEMORY); } /* Perform the AML-to-Resource conversion */ @@ -121,9 +123,11 @@ AcpiBufferToResource ( *ResourcePtr = Resource; } - return (Status); + return_ACPI_STATUS (Status); } +ACPI_EXPORT_SYMBOL (AcpiBufferToResource) + /******************************************************************************* * @@ -297,7 +301,7 @@ AcpiRsCreatePciRoutingTable ( */ UserPrt->Length = (sizeof (ACPI_PCI_ROUTING_TABLE) - 4); - /* Each sub-package must be of length 4 */ + /* Each subpackage must be of length 4 */ if ((*TopObjectList)->Package.Count != 4) { @@ -308,7 +312,7 @@ AcpiRsCreatePciRoutingTable ( } /* - * Dereference the sub-package. + * Dereference the subpackage. * The SubObjectList will now point to an array of the four IRQ * elements: [Address, Pin, Source, SourceIndex] */ @@ -317,7 +321,7 @@ AcpiRsCreatePciRoutingTable ( /* 1) First subobject: Dereference the PRT.Address */ ObjDesc = SubObjectList[0]; - if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER) + if (!ObjDesc || ObjDesc->Common.Type != ACPI_TYPE_INTEGER) { ACPI_ERROR ((AE_INFO, "(PRT[%u].Address) Need Integer, found %s", Index, AcpiUtGetObjectTypeName (ObjDesc))); @@ -329,7 +333,7 @@ AcpiRsCreatePciRoutingTable ( /* 2) Second subobject: Dereference the PRT.Pin */ ObjDesc = SubObjectList[1]; - if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER) + if (!ObjDesc || ObjDesc->Common.Type != ACPI_TYPE_INTEGER) { ACPI_ERROR ((AE_INFO, "(PRT[%u].Pin) Need Integer, found %s", Index, AcpiUtGetObjectTypeName (ObjDesc))); @@ -410,7 +414,7 @@ AcpiRsCreatePciRoutingTable ( /* 4) Fourth subobject: Dereference the PRT.SourceIndex */ ObjDesc = SubObjectList[3]; - if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER) + if (!ObjDesc || ObjDesc->Common.Type != ACPI_TYPE_INTEGER) { ACPI_ERROR ((AE_INFO, "(PRT[%u].SourceIndex) Need Integer, found %s", @@ -435,23 +439,22 @@ AcpiRsCreatePciRoutingTable ( * * FUNCTION: AcpiRsCreateAmlResources * - * PARAMETERS: LinkedListBuffer - Pointer to the resource linked list - * OutputBuffer - Pointer to the user's buffer + * PARAMETERS: ResourceList - Pointer to the resource list buffer + * OutputBuffer - Where the AML buffer is returned * * RETURN: Status AE_OK if okay, else a valid ACPI_STATUS code. * If the OutputBuffer is too small, the error will be * AE_BUFFER_OVERFLOW and OutputBuffer->Length will point * to the size buffer needed. * - * DESCRIPTION: Takes the linked list of device resources and - * creates a bytestream to be used as input for the - * _SRS control method. + * DESCRIPTION: Converts a list of device resources to an AML bytestream + * to be used as input for the _SRS control method. * ******************************************************************************/ ACPI_STATUS AcpiRsCreateAmlResources ( - ACPI_RESOURCE *LinkedListBuffer, + ACPI_BUFFER *ResourceList, ACPI_BUFFER *OutputBuffer) { ACPI_STATUS Status; @@ -461,17 +464,15 @@ AcpiRsCreateAmlResources ( ACPI_FUNCTION_TRACE (RsCreateAmlResources); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "LinkedListBuffer = %p\n", - LinkedListBuffer)); + /* Params already validated, no need to re-validate here */ - /* - * Params already validated, so we don't re-validate here - * - * Pass the LinkedListBuffer into a module that calculates - * the buffer size needed for the byte stream. - */ - Status = AcpiRsGetAmlLength (LinkedListBuffer, - &AmlSizeNeeded); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ResourceList Buffer = %p\n", + ResourceList->Pointer)); + + /* Get the buffer size needed for the AML byte stream */ + + Status = AcpiRsGetAmlLength (ResourceList->Pointer, + ResourceList->Length, &AmlSizeNeeded); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n", (UINT32) AmlSizeNeeded, AcpiFormatException (Status))); @@ -490,14 +491,14 @@ AcpiRsCreateAmlResources ( /* Do the conversion */ - Status = AcpiRsConvertResourcesToAml (LinkedListBuffer, AmlSizeNeeded, - OutputBuffer->Pointer); + Status = AcpiRsConvertResourcesToAml (ResourceList->Pointer, + AmlSizeNeeded, OutputBuffer->Pointer); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "OutputBuffer %p Length %X\n", - OutputBuffer->Pointer, (UINT32) OutputBuffer->Length)); + OutputBuffer->Pointer, (UINT32) OutputBuffer->Length)); return_ACPI_STATUS (AE_OK); } diff --git a/sys/contrib/dev/acpica/components/resources/rsdump.c b/sys/contrib/dev/acpica/components/resources/rsdump.c index d729795..ddae6e0 100644 --- a/sys/contrib/dev/acpica/components/resources/rsdump.c +++ b/sys/contrib/dev/acpica/components/resources/rsdump.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,9 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - -#define __RSDUMP_C__ - #include <contrib/dev/acpica/include/acpi.h> #include <contrib/dev/acpica/include/accommon.h> #include <contrib/dev/acpica/include/acresrc.h> @@ -52,7 +49,7 @@ ACPI_MODULE_NAME ("rsdump") -#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) +#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER) /* Local prototypes */ diff --git a/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c b/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c index 865209b..aab597a 100644 --- a/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c +++ b/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,9 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - -#define __RSDUMPINFO_C__ - #include <contrib/dev/acpica/include/acpi.h> #include <contrib/dev/acpica/include/accommon.h> #include <contrib/dev/acpica/include/acresrc.h> @@ -52,7 +49,7 @@ ACPI_MODULE_NAME ("rsdumpinfo") -#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) +#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER) #define ACPI_RSD_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_RESOURCE_DATA,f) diff --git a/sys/contrib/dev/acpica/components/resources/rsinfo.c b/sys/contrib/dev/acpica/components/resources/rsinfo.c index cb72332..f34b905 100644 --- a/sys/contrib/dev/acpica/components/resources/rsinfo.c +++ b/sys/contrib/dev/acpica/components/resources/rsinfo.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#define __RSINFO_C__ - #include <contrib/dev/acpica/include/acpi.h> #include <contrib/dev/acpica/include/accommon.h> #include <contrib/dev/acpica/include/acresrc.h> @@ -141,7 +139,7 @@ ACPI_RSCONVERT_INFO *AcpiGbl_ConvertResourceSerialBusDispatch[] = }; -#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) +#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER) /* Dispatch table for resource dump functions */ diff --git a/sys/contrib/dev/acpica/components/resources/rsio.c b/sys/contrib/dev/acpica/components/resources/rsio.c index 1a41fb9..473fe36 100644 --- a/sys/contrib/dev/acpica/components/resources/rsio.c +++ b/sys/contrib/dev/acpica/components/resources/rsio.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#define __RSIO_C__ - #include <contrib/dev/acpica/include/acpi.h> #include <contrib/dev/acpica/include/accommon.h> #include <contrib/dev/acpica/include/acresrc.h> diff --git a/sys/contrib/dev/acpica/components/resources/rsirq.c b/sys/contrib/dev/acpica/components/resources/rsirq.c index b3b5ee57..cf91f3d 100644 --- a/sys/contrib/dev/acpica/components/resources/rsirq.c +++ b/sys/contrib/dev/acpica/components/resources/rsirq.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#define __RSIRQ_C__ - #include <contrib/dev/acpica/include/acpi.h> #include <contrib/dev/acpica/include/accommon.h> #include <contrib/dev/acpica/include/acresrc.h> diff --git a/sys/contrib/dev/acpica/components/resources/rslist.c b/sys/contrib/dev/acpica/components/resources/rslist.c index 81e7292..8261058 100644 --- a/sys/contrib/dev/acpica/components/resources/rslist.c +++ b/sys/contrib/dev/acpica/components/resources/rslist.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#define __RSLIST_C__ - #include <contrib/dev/acpica/include/acpi.h> #include <contrib/dev/acpica/include/accommon.h> #include <contrib/dev/acpica/include/acresrc.h> diff --git a/sys/contrib/dev/acpica/components/resources/rsmemory.c b/sys/contrib/dev/acpica/components/resources/rsmemory.c index 049a7b1..761a000 100644 --- a/sys/contrib/dev/acpica/components/resources/rsmemory.c +++ b/sys/contrib/dev/acpica/components/resources/rsmemory.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#define __RSMEMORY_C__ - #include <contrib/dev/acpica/include/acpi.h> #include <contrib/dev/acpica/include/accommon.h> #include <contrib/dev/acpica/include/acresrc.h> diff --git a/sys/contrib/dev/acpica/components/resources/rsmisc.c b/sys/contrib/dev/acpica/components/resources/rsmisc.c index e895add..bc5b803 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 - 2013, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#define __RSMISC_C__ - #include <contrib/dev/acpica/include/acpi.h> #include <contrib/dev/acpica/include/accommon.h> #include <contrib/dev/acpica/include/acresrc.h> diff --git a/sys/contrib/dev/acpica/components/resources/rsserial.c b/sys/contrib/dev/acpica/components/resources/rsserial.c index 69e2259..00e1887 100644 --- a/sys/contrib/dev/acpica/components/resources/rsserial.c +++ b/sys/contrib/dev/acpica/components/resources/rsserial.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#define __RSIRQ_C__ - #include <contrib/dev/acpica/include/acpi.h> #include <contrib/dev/acpica/include/accommon.h> #include <contrib/dev/acpica/include/acresrc.h> diff --git a/sys/contrib/dev/acpica/components/resources/rsutils.c b/sys/contrib/dev/acpica/components/resources/rsutils.c index 499efb9..c0e7b78 100644 --- a/sys/contrib/dev/acpica/components/resources/rsutils.c +++ b/sys/contrib/dev/acpica/components/resources/rsutils.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,9 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - -#define __RSUTILS_C__ - #include <contrib/dev/acpica/include/acpi.h> #include <contrib/dev/acpica/include/accommon.h> #include <contrib/dev/acpica/include/acnamesp.h> @@ -827,7 +824,7 @@ AcpiRsSetSrsMethodData ( * Convert the linked list into a byte stream */ Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiRsCreateAmlResources (InBuffer->Pointer, &Buffer); + Status = AcpiRsCreateAmlResources (InBuffer, &Buffer); if (ACPI_FAILURE (Status)) { goto Cleanup; diff --git a/sys/contrib/dev/acpica/components/resources/rsxface.c b/sys/contrib/dev/acpica/components/resources/rsxface.c index b2ff381..2fe3e6f 100644 --- a/sys/contrib/dev/acpica/components/resources/rsxface.c +++ b/sys/contrib/dev/acpica/components/resources/rsxface.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2015, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ - -#define __RSXFACE_C__ +#define EXPORT_ACPI_INTERFACES #include <contrib/dev/acpica/include/acpi.h> #include <contrib/dev/acpica/include/accommon.h> |