Print this page
update to acpica-unix2-20140114
acpica-unix2-20130823
PANKOVs restructure
*** 3,13 ****
* Module Name: dmresrc.c - Resource Descriptor disassembly
*
******************************************************************************/
/*
! * Copyright (C) 2000 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
--- 3,13 ----
* Module Name: dmresrc.c - Resource Descriptor disassembly
*
******************************************************************************/
/*
! * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*** 53,68 ****
ACPI_MODULE_NAME ("dbresrc")
/* Dispatch tables for Resource disassembly functions */
- typedef
- void (*ACPI_RESOURCE_HANDLER) (
- AML_RESOURCE *Resource,
- UINT32 Length,
- UINT32 Level);
-
static ACPI_RESOURCE_HANDLER AcpiGbl_DmResourceDispatch [] =
{
/* Small descriptors */
NULL, /* 0x00, Reserved */
--- 53,62 ----
*** 73,83 ****
AcpiDmDmaDescriptor, /* 0x05, ACPI_RESOURCE_NAME_DMA_FORMAT */
AcpiDmStartDependentDescriptor, /* 0x06, ACPI_RESOURCE_NAME_START_DEPENDENT */
AcpiDmEndDependentDescriptor, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */
AcpiDmIoDescriptor, /* 0x08, ACPI_RESOURCE_NAME_IO_PORT */
AcpiDmFixedIoDescriptor, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO_PORT */
! NULL, /* 0x0A, Reserved */
NULL, /* 0x0B, Reserved */
NULL, /* 0x0C, Reserved */
NULL, /* 0x0D, Reserved */
AcpiDmVendorSmallDescriptor, /* 0x0E, ACPI_RESOURCE_NAME_SMALL_VENDOR */
NULL, /* 0x0F, ACPI_RESOURCE_NAME_END_TAG (not used) */
--- 67,77 ----
AcpiDmDmaDescriptor, /* 0x05, ACPI_RESOURCE_NAME_DMA_FORMAT */
AcpiDmStartDependentDescriptor, /* 0x06, ACPI_RESOURCE_NAME_START_DEPENDENT */
AcpiDmEndDependentDescriptor, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */
AcpiDmIoDescriptor, /* 0x08, ACPI_RESOURCE_NAME_IO_PORT */
AcpiDmFixedIoDescriptor, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO_PORT */
! AcpiDmFixedDmaDescriptor, /* 0x0A, ACPI_RESOURCE_NAME_FIXED_DMA */
NULL, /* 0x0B, Reserved */
NULL, /* 0x0C, Reserved */
NULL, /* 0x0D, Reserved */
AcpiDmVendorSmallDescriptor, /* 0x0E, ACPI_RESOURCE_NAME_SMALL_VENDOR */
NULL, /* 0x0F, ACPI_RESOURCE_NAME_END_TAG (not used) */
*** 93,103 ****
AcpiDmFixedMemory32Descriptor, /* 0x06, ACPI_RESOURCE_NAME_FIXED_MEMORY_32 */
AcpiDmDwordDescriptor, /* 0x07, ACPI_RESOURCE_NAME_DWORD_ADDRESS_SPACE */
AcpiDmWordDescriptor, /* 0x08, ACPI_RESOURCE_NAME_WORD_ADDRESS_SPACE */
AcpiDmInterruptDescriptor, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_XRUPT */
AcpiDmQwordDescriptor, /* 0x0A, ACPI_RESOURCE_NAME_QWORD_ADDRESS_SPACE */
! AcpiDmExtendedDescriptor /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS_SPACE */
};
/* Only used for single-threaded applications */
/* TBD: remove when name is passed as parameter to the dump functions */
--- 87,100 ----
AcpiDmFixedMemory32Descriptor, /* 0x06, ACPI_RESOURCE_NAME_FIXED_MEMORY_32 */
AcpiDmDwordDescriptor, /* 0x07, ACPI_RESOURCE_NAME_DWORD_ADDRESS_SPACE */
AcpiDmWordDescriptor, /* 0x08, ACPI_RESOURCE_NAME_WORD_ADDRESS_SPACE */
AcpiDmInterruptDescriptor, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_XRUPT */
AcpiDmQwordDescriptor, /* 0x0A, ACPI_RESOURCE_NAME_QWORD_ADDRESS_SPACE */
! AcpiDmExtendedDescriptor, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS_SPACE */
! AcpiDmGpioDescriptor, /* 0x0C, ACPI_RESOURCE_NAME_GPIO */
! NULL, /* 0x0D, Reserved */
! AcpiDmSerialBusDescriptor /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS */
};
/* Only used for single-threaded applications */
/* TBD: remove when name is passed as parameter to the dump functions */
*** 280,290 ****
ResourceType = AcpiUtGetResourceType (Aml);
ResourceLength = AcpiUtGetResourceLength (Aml);
/* Validate the Resource Type and Resource Length */
! Status = AcpiUtValidateResource (Aml, &ResourceIndex);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("/*** Could not validate Resource, type (%X) %s***/\n",
ResourceType, AcpiFormatException (Status));
return;
--- 277,287 ----
ResourceType = AcpiUtGetResourceType (Aml);
ResourceLength = AcpiUtGetResourceLength (Aml);
/* Validate the Resource Type and Resource Length */
! Status = AcpiUtValidateResource (NULL, Aml, &ResourceIndex);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("/*** Could not validate Resource, type (%X) %s***/\n",
ResourceType, AcpiFormatException (Status));
return;
*** 338,347 ****
--- 335,345 ----
"/*** Disassembler: inserted missing EndDependentFn () ***/\n");
}
return;
default:
+
break;
}
/* Disassemble the resource structure */
*** 367,377 ****
/*******************************************************************************
*
* FUNCTION: AcpiDmIsResourceTemplate
*
! * PARAMETERS: Op - Buffer Op to be examined
*
* RETURN: Status. AE_OK if valid template
*
* DESCRIPTION: Walk a byte list to determine if it consists of a valid set
* of resource descriptors. Nothing is output.
--- 365,376 ----
/*******************************************************************************
*
* FUNCTION: AcpiDmIsResourceTemplate
*
! * PARAMETERS: WalkState - Current walk info
! * Op - Buffer Op to be examined
*
* RETURN: Status. AE_OK if valid template
*
* DESCRIPTION: Walk a byte list to determine if it consists of a valid set
* of resource descriptors. Nothing is output.
*** 378,387 ****
--- 377,387 ----
*
******************************************************************************/
ACPI_STATUS
AcpiDmIsResourceTemplate (
+ ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op)
{
ACPI_STATUS Status;
ACPI_PARSE_OBJECT *NextOp;
UINT8 *Aml;
*** 397,406 ****
--- 397,412 ----
}
/* Get the ByteData list and length */
NextOp = Op->Common.Value.Arg;
+ if (!NextOp)
+ {
+ AcpiOsPrintf ("NULL byte list in buffer\n");
+ return (AE_TYPE);
+ }
+
NextOp = NextOp->Common.Next;
if (!NextOp)
{
return (AE_TYPE);
}
*** 408,418 ****
Aml = NextOp->Named.Data;
Length = (ACPI_SIZE) NextOp->Common.Value.Integer;
/* Walk the byte list, abort on any invalid descriptor type or length */
! Status = AcpiUtWalkAmlResources (Aml, Length, NULL, &EndAml);
if (ACPI_FAILURE (Status))
{
return (AE_TYPE);
}
--- 414,425 ----
Aml = NextOp->Named.Data;
Length = (ACPI_SIZE) NextOp->Common.Value.Integer;
/* Walk the byte list, abort on any invalid descriptor type or length */
! Status = AcpiUtWalkAmlResources (WalkState, Aml, Length,
! NULL, ACPI_CAST_INDIRECT_PTR (void, &EndAml));
if (ACPI_FAILURE (Status))
{
return (AE_TYPE);
}