Deleted Added
full compact
5c5
< * $Revision: 1.132 $
---
> * $Revision: 1.144 $
13c13
< * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
---
> * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp.
123a124
> #include <contrib/dev/acpica/amlresrc.h>
155c156
< ACPI_FUNCTION_TRACE_PTR ("ExGetObjectReference", ObjDesc);
---
> ACPI_FUNCTION_TRACE_PTR (ExGetObjectReference, ObjDesc);
185c186
< ACPI_REPORT_ERROR (("Unknown Reference opcode in GetReference %X\n",
---
> ACPI_ERROR ((AE_INFO, "Unknown Reference opcode %X",
203,204c204,205
< ACPI_REPORT_ERROR (("Invalid descriptor type in GetReference: %X\n",
< ACPI_GET_DESCRIPTOR_TYPE (ObjDesc)));
---
> ACPI_ERROR ((AE_INFO, "Invalid descriptor type %X",
> ACPI_GET_DESCRIPTOR_TYPE (ObjDesc)));
250a252
> ACPI_STATUS Status;
253,254c255,256
< UINT8 *EndTag1;
< UINT8 *EndTag2;
---
> UINT8 *EndTag;
> ACPI_SIZE Length0;
256c258
< ACPI_SIZE Length2;
---
> ACPI_SIZE NewLength;
259c261
< ACPI_FUNCTION_TRACE ("ExConcatTemplate");
---
> ACPI_FUNCTION_TRACE (ExConcatTemplate);
262c264,268
< /* Find the EndTags in each resource template */
---
> /*
> * Find the EndTag descriptor in each resource template.
> * Note1: returned pointers point TO the EndTag, not past it.
> * Note2: zero-length buffers are allowed; treated like one EndTag
> */
264,266c270,273
< EndTag1 = AcpiUtGetResourceEndTag (Operand0);
< EndTag2 = AcpiUtGetResourceEndTag (Operand1);
< if (!EndTag1 || !EndTag2)
---
> /* Get the length of the first resource template */
>
> Status = AcpiUtGetResourceEndTag (Operand0, &EndTag);
> if (ACPI_FAILURE (Status))
268c275
< return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
---
> return_ACPI_STATUS (Status);
271c278
< /* Compute the length of each part */
---
> Length0 = ACPI_PTR_DIFF (EndTag, Operand0->Buffer.Pointer);
273,275c280
< Length1 = ACPI_PTR_DIFF (EndTag1, Operand0->Buffer.Pointer);
< Length2 = ACPI_PTR_DIFF (EndTag2, Operand1->Buffer.Pointer) +
< 2; /* Size of END_TAG */
---
> /* Get the length of the second resource template */
277c282,286
< /* Create a new buffer object for the result */
---
> Status = AcpiUtGetResourceEndTag (Operand1, &EndTag);
> if (ACPI_FAILURE (Status))
> {
> return_ACPI_STATUS (Status);
> }
279c288,296
< ReturnDesc = AcpiUtCreateBufferObject (Length1 + Length2);
---
> Length1 = ACPI_PTR_DIFF (EndTag, Operand1->Buffer.Pointer);
>
> /* Combine both lengths, minimum size will be 2 for EndTag */
>
> NewLength = Length0 + Length1 + sizeof (AML_RESOURCE_END_TAG);
>
> /* Create a new buffer object for the result (with one EndTag) */
>
> ReturnDesc = AcpiUtCreateBufferObject (NewLength);
285,286c302,305
< /* Copy the templates to the new descriptor */
<
---
> /*
> * Copy the templates to the new buffer, 0 first, then 1 follows. One
> * EndTag descriptor is copied from Operand1.
> */
288,289c307,308
< ACPI_MEMCPY (NewBuf, Operand0->Buffer.Pointer, Length1);
< ACPI_MEMCPY (NewBuf + Length1, Operand1->Buffer.Pointer, Length2);
---
> ACPI_MEMCPY (NewBuf, Operand0->Buffer.Pointer, Length0);
> ACPI_MEMCPY (NewBuf + Length0, Operand1->Buffer.Pointer, Length1);
291c310
< /* Compute the new checksum */
---
> /* Insert EndTag and set the checksum to zero, means "ignore checksum" */
293,295c312,313
< NewBuf[ReturnDesc->Buffer.Length - 1] =
< AcpiUtGenerateChecksum (ReturnDesc->Buffer.Pointer,
< (ReturnDesc->Buffer.Length - 1));
---
> NewBuf[NewLength - 1] = 0;
> NewBuf[NewLength - 2] = ACPI_RESOURCE_NAME_END_TAG | 1;
297c315
< /* Return the completed template descriptor */
---
> /* Return the completed resource template */
330d347
< ACPI_SIZE NewLength;
333c350
< ACPI_FUNCTION_TRACE ("ExDoConcatenate");
---
> ACPI_FUNCTION_TRACE (ExDoConcatenate);
359,360c376,377
< ACPI_REPORT_ERROR (("Concat - invalid obj type: %X\n",
< ACPI_GET_OBJECT_TYPE (Operand0)));
---
> ACPI_ERROR ((AE_INFO, "Invalid object type: %X",
> ACPI_GET_OBJECT_TYPE (Operand0)));
401,402c418
< ACPI_MEMCPY (NewBuf,
< &Operand0->Integer.Value,
---
> ACPI_MEMCPY (NewBuf, &Operand0->Integer.Value,
416,424c432,434
< NewLength = (ACPI_SIZE) Operand0->String.Length +
< (ACPI_SIZE) LocalOperand1->String.Length;
< if (NewLength > ACPI_MAX_STRING_CONVERSION)
< {
< Status = AE_AML_STRING_LIMIT;
< goto Cleanup;
< }
<
< ReturnDesc = AcpiUtCreateStringObject (NewLength);
---
> ReturnDesc = AcpiUtCreateStringObject ((ACPI_SIZE)
> (Operand0->String.Length +
> LocalOperand1->String.Length));
435,436c445
< ACPI_STRCPY (NewBuf,
< Operand0->String.Pointer);
---
> ACPI_STRCPY (NewBuf, Operand0->String.Pointer);
445,447c454,456
< ReturnDesc = AcpiUtCreateBufferObject (
< (ACPI_SIZE) Operand0->Buffer.Length +
< (ACPI_SIZE) LocalOperand1->Buffer.Length);
---
> ReturnDesc = AcpiUtCreateBufferObject ((ACPI_SIZE)
> (Operand0->Buffer.Length +
> LocalOperand1->Buffer.Length));
458,459c467
< ACPI_MEMCPY (NewBuf,
< Operand0->Buffer.Pointer,
---
> ACPI_MEMCPY (NewBuf, Operand0->Buffer.Pointer,
470,471c478,479
< ACPI_REPORT_ERROR (("Concatenate - Invalid object type: %X\n",
< ACPI_GET_OBJECT_TYPE (Operand0)));
---
> ACPI_ERROR ((AE_INFO, "Invalid object type: %X",
> ACPI_GET_OBJECT_TYPE (Operand0)));
551a560,567
> /*
> * We need to check if the shiftcount is larger than the integer bit
> * width since the behavior of this is not well-defined in the C language.
> */
> if (Integer1 >= AcpiGbl_IntegerBitWidth)
> {
> return (0);
> }
556a573,580
> /*
> * We need to check if the shiftcount is larger than the integer bit
> * width since the behavior of this is not well-defined in the C language.
> */
> if (Integer1 >= AcpiGbl_IntegerBitWidth)
> {
> return (0);
> }
602c626
< ACPI_FUNCTION_TRACE ("ExDoLogicalNumericOp");
---
> ACPI_FUNCTION_TRACE (ExDoLogicalNumericOp);
678c702
< ACPI_FUNCTION_TRACE ("ExDoLogicalOp");
---
> ACPI_FUNCTION_TRACE (ExDoLogicalOp);