Deployed new UtGetObjectTypeName function. Fully deployed use of

ACPI_GET_OBJECT_TYPE macro for consistency.


date	2002.06.07.21.28.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 17:24:50 +00:00
parent 9d22c6065f
commit 448e98f9be
4 changed files with 111 additions and 109 deletions

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exdump - Interpreter debug output routines
* $Revision: 1.154 $
* $Revision: 1.155 $
*
*****************************************************************************/
@ -193,7 +193,7 @@ AcpiExDumpOperand (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", ObjDesc));
switch (ObjDesc->Common.Type)
switch (ACPI_GET_OBJECT_TYPE (ObjDesc))
{
case INTERNAL_TYPE_REFERENCE:
@ -225,7 +225,7 @@ AcpiExDumpOperand (
AcpiOsPrintf ("Reference: Arg%d",
ObjDesc->Reference.Offset);
if (ACPI_TYPE_INTEGER == ObjDesc->Common.Type)
if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_INTEGER)
{
/* Value is a Number */
@ -243,7 +243,7 @@ AcpiExDumpOperand (
AcpiOsPrintf ("Reference: Local%d",
ObjDesc->Reference.Offset);
if (ACPI_TYPE_INTEGER == ObjDesc->Common.Type)
if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_INTEGER)
{
/* Value is a Number */
@ -425,8 +425,7 @@ AcpiExDumpOperand (
{
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL* \n"));
}
else if (ACPI_TYPE_BUFFER !=
ObjDesc->BufferField.BufferObj->Common.Type)
else if (ACPI_GET_OBJECT_TYPE (ObjDesc->BufferField.BufferObj) != ACPI_TYPE_BUFFER)
{
AcpiOsPrintf ("*not a Buffer* \n");
}
@ -484,9 +483,9 @@ AcpiExDumpOperand (
default:
/* Unknown ObjDesc->Common.Type value */
/* Unknown Type */
AcpiOsPrintf ("Unknown Type %X\n", ObjDesc->Common.Type);
AcpiOsPrintf ("Unknown Type %X\n", ACPI_GET_OBJECT_TYPE (ObjDesc));
break;
}
@ -688,13 +687,13 @@ AcpiExDumpObjectDescriptor (
/* Common Fields */
AcpiExOutString ("Type", AcpiUtGetTypeName (ObjDesc->Common.Type));
AcpiExOutString ("Type", AcpiUtGetObjectTypeName (ObjDesc));
AcpiExOutInteger ("Reference Count", ObjDesc->Common.ReferenceCount);
AcpiExOutInteger ("Flags", ObjDesc->Common.Flags);
/* Object-specific Fields */
switch (ObjDesc->Common.Type)
switch (ACPI_GET_OBJECT_TYPE (ObjDesc))
{
case ACPI_TYPE_INTEGER:
@ -734,7 +733,7 @@ AcpiExDumpObjectDescriptor (
AcpiOsPrintf ("[%.3d] %p", i, ObjDesc->Package.Elements[i]);
if (ObjDesc->Package.Elements[i])
{
AcpiOsPrintf (" %s", AcpiUtGetTypeName ((ObjDesc->Package.Elements[i])->Common.Type));
AcpiOsPrintf (" %s", AcpiUtGetObjectTypeName (ObjDesc->Package.Elements[i]));
}
AcpiOsPrintf ("\n");
}
@ -830,7 +829,7 @@ AcpiExDumpObjectDescriptor (
AcpiExOutInteger ("EndBufValidBits", ObjDesc->CommonField.EndBufferValidBits);
AcpiExOutPointer ("ParentNode", ObjDesc->CommonField.Node);
switch (ObjDesc->Common.Type)
switch (ACPI_GET_OBJECT_TYPE (ObjDesc))
{
case ACPI_TYPE_BUFFER_FIELD:
AcpiExOutPointer ("BufferObj", ObjDesc->BufferField.BufferObj);
@ -898,15 +897,10 @@ AcpiExDumpObjectDescriptor (
case INTERNAL_TYPE_DEF_ANY:
case INTERNAL_TYPE_EXTRA:
case INTERNAL_TYPE_DATA:
AcpiOsPrintf ("ExDumpObjectDescriptor: Display not implemented for object type %X\n",
ObjDesc->Common.Type);
break;
default:
AcpiOsPrintf ("ExDumpObjectDescriptor: Unknown object type %X\n", ObjDesc->Common.Type);
AcpiOsPrintf ("ExDumpObjectDescriptor: Display not implemented for object type %s\n",
AcpiUtGetObjectTypeName (ObjDesc));
break;
}

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exfield - ACPI AML (p-code) execution - field manipulation
* $Revision: 1.106 $
* $Revision: 1.112 $
*
*****************************************************************************/
@ -120,10 +120,6 @@
#include "acpi.h"
#include "acdispat.h"
#include "acinterp.h"
#include "amlcode.h"
#include "acnamesp.h"
#include "achware.h"
#include "acevents.h"
#define _COMPONENT ACPI_EXECUTER
@ -134,7 +130,8 @@
*
* FUNCTION: AcpiExReadDataFromField
*
* PARAMETERS: ObjDesc - The named field
* PARAMETERS: WalkState - Current execution state
* ObjDesc - The named field
* RetBufferDesc - Where the return data object is stored
*
* RETURN: Status
@ -146,6 +143,7 @@
ACPI_STATUS
AcpiExReadDataFromField (
ACPI_WALK_STATE *WalkState,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **RetBufferDesc)
{
@ -166,7 +164,7 @@ AcpiExReadDataFromField (
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
if (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD)
if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_BUFFER_FIELD)
{
/*
* If the BufferField arguments have not been previously evaluated,
@ -193,8 +191,7 @@ AcpiExReadDataFromField (
* Note: Field.length is in bits.
*/
Length = ACPI_ROUND_BITS_UP_TO_BYTES (ObjDesc->Field.BitLength);
if (Length > sizeof (ACPI_INTEGER))
if (Length > AcpiGbl_IntegerByteWidth)
{
/* Field is too large for an Integer, create a Buffer instead */
@ -213,6 +210,8 @@ AcpiExReadDataFromField (
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Complete the buffer object initialization */
BufferDesc->Common.Flags = AOPOBJ_DATA_VALID;
BufferDesc->Buffer.Length = Length;
Buffer = BufferDesc->Buffer.Pointer;
@ -227,14 +226,15 @@ AcpiExReadDataFromField (
return_ACPI_STATUS (AE_NO_MEMORY);
}
Length = sizeof (BufferDesc->Integer.Value);
Length = AcpiGbl_IntegerByteWidth;
BufferDesc->Integer.Value = 0;
Buffer = &BufferDesc->Integer.Value;
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Obj=%p Type=%X Buf=%p Len=%X\n",
ObjDesc, ObjDesc->Common.Type, Buffer, Length));
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ObjDesc, ACPI_GET_OBJECT_TYPE (ObjDesc), Buffer, Length));
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"FieldWrite: BitLen=%X BitOff=%X ByteOff=%X\n",
ObjDesc->CommonField.BitLength,
ObjDesc->CommonField.StartFieldBitOffset,
@ -300,7 +300,7 @@ AcpiExWriteDataToField (
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
if (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD)
if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_BUFFER_FIELD)
{
/*
* If the BufferField arguments have not been previously evaluated,
@ -319,7 +319,7 @@ AcpiExWriteDataToField (
/*
* Get a pointer to the data to be written
*/
switch (SourceDesc->Common.Type)
switch (ACPI_GET_OBJECT_TYPE (SourceDesc))
{
case ACPI_TYPE_INTEGER:
Buffer = &SourceDesc->Integer.Value;
@ -369,10 +369,10 @@ AcpiExWriteDataToField (
Length = RequiredLength;
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Obj=%p Type=%X Buf=%p Len=%X\n",
ObjDesc, ObjDesc->Common.Type, Buffer, Length));
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ObjDesc, ACPI_GET_OBJECT_TYPE (ObjDesc), Buffer, Length));
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"FieldRead: BitLen=%X BitOff=%X ByteOff=%X\n",
ObjDesc->CommonField.BitLength,
ObjDesc->CommonField.StartFieldBitOffset,

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exfldio - Aml Field I/O
* $Revision: 1.82 $
* $Revision: 1.87 $
*
*****************************************************************************/
@ -120,8 +120,6 @@
#include "acpi.h"
#include "acinterp.h"
#include "amlcode.h"
#include "acnamesp.h"
#include "achware.h"
#include "acevents.h"
#include "acdispat.h"
@ -159,10 +157,12 @@ AcpiExSetupRegion (
RgnDesc = ObjDesc->CommonField.RegionObj;
if (ACPI_TYPE_REGION != RgnDesc->Common.Type)
if (ACPI_GET_OBJECT_TYPE (RgnDesc) != ACPI_TYPE_REGION)
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed Region, found type %x %s\n",
RgnDesc->Common.Type, AcpiUtGetTypeName (RgnDesc->Common.Type)));
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed Region, found type %X (%s)\n",
ACPI_GET_OBJECT_TYPE (RgnDesc),
AcpiUtGetObjectTypeName (RgnDesc)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
@ -197,8 +197,8 @@ AcpiExSetupRegion (
*/
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Field [%4.4s] access width (%d bytes) too large for region [%4.4s] (length %X)\n",
(char *) &ObjDesc->CommonField.Node->Name, ObjDesc->CommonField.AccessByteWidth,
(char *) &RgnDesc->Region.Node->Name, RgnDesc->Region.Length));
ObjDesc->CommonField.Node->Name.Ascii, ObjDesc->CommonField.AccessByteWidth,
RgnDesc->Region.Node->Name.Ascii, RgnDesc->Region.Length));
}
/*
@ -207,9 +207,9 @@ AcpiExSetupRegion (
*/
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Field [%4.4s] Base+Offset+Width %X+%X+%X is beyond end of region [%4.4s] (length %X)\n",
(char *) &ObjDesc->CommonField.Node->Name, ObjDesc->CommonField.BaseByteOffset,
ObjDesc->CommonField.Node->Name.Ascii, ObjDesc->CommonField.BaseByteOffset,
FieldDatumByteOffset, ObjDesc->CommonField.AccessByteWidth,
(char *) &RgnDesc->Region.Node->Name, RgnDesc->Region.Length));
RgnDesc->Region.Node->Name.Ascii, RgnDesc->Region.Length));
return_ACPI_STATUS (AE_AML_REGION_LIMIT);
}
@ -246,7 +246,7 @@ AcpiExAccessRegion (
ACPI_PHYSICAL_ADDRESS Address;
ACPI_FUNCTION_TRACE ("AcpiExAccessRegion");
ACPI_FUNCTION_TRACE ("ExAccessRegion");
/*
@ -339,7 +339,7 @@ AcpiExRegisterOverflow (
return (FALSE);
}
if (Value >= (ACPI_INTEGER) (1 << ObjDesc->CommonField.BitLength))
if (Value >= ((ACPI_INTEGER) 1 << ObjDesc->CommonField.BitLength))
{
/*
* The Value is larger than the maximum value that can fit into
@ -407,7 +407,7 @@ AcpiExFieldDatumIo (
* BankFields - Write to a Bank Register, then read/write from/to an OpRegion
* IndexFields - Write to an Index Register, then read/write from/to a Data Register
*/
switch (ObjDesc->Common.Type)
switch (ACPI_GET_OBJECT_TYPE (ObjDesc))
{
case ACPI_TYPE_BUFFER_FIELD:
/*
@ -455,7 +455,7 @@ AcpiExFieldDatumIo (
/* Ensure that the BankValue is not beyond the capacity of the register */
if (AcpiExRegisterOverflow (ObjDesc->BankField.BankObj,
ObjDesc->BankField.Value))
(ACPI_INTEGER) ObjDesc->BankField.Value))
{
return_ACPI_STATUS (AE_AML_REGISTER_LIMIT);
}
@ -477,7 +477,7 @@ AcpiExFieldDatumIo (
* RegionField case and write the datum to the Operation Region
*/
/* No break; ! */
/*lint -fallthrough */
case INTERNAL_TYPE_REGION_FIELD:
@ -502,7 +502,7 @@ AcpiExFieldDatumIo (
/* Ensure that the IndexValue is not beyond the capacity of the register */
if (AcpiExRegisterOverflow (ObjDesc->IndexField.IndexObj,
ObjDesc->IndexField.Value))
(ACPI_INTEGER) ObjDesc->IndexField.Value))
{
return_ACPI_STATUS (AE_AML_REGISTER_LIMIT);
}
@ -537,7 +537,7 @@ AcpiExFieldDatumIo (
default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p, Wrong object type - %s\n",
ObjDesc, AcpiUtGetTypeName (ObjDesc->Common.Type)));
ObjDesc, AcpiUtGetObjectTypeName (ObjDesc)));
Status = AE_AML_INTERNAL;
break;
}
@ -594,7 +594,7 @@ AcpiExWriteWithUpdateRule (
/* If the mask is all ones, we don't need to worry about the update rule */
if (Mask != ACPI_UINT32_MAX)
if (Mask != ACPI_INTEGER_MAX)
{
/* Decode the update rule */
@ -634,7 +634,7 @@ AcpiExWriteWithUpdateRule (
default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"WriteWithUpdateRule: Unknown UpdateRule setting: %x\n",
"WriteWithUpdateRule: Unknown UpdateRule setting: %X\n",
(ObjDesc->CommonField.FieldFlags & AML_FIELD_UPDATE_RULE_MASK)));
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
}
@ -705,6 +705,10 @@ AcpiExGetBufferDatum(
ACPI_MOVE_UNALIGNED64_TO_64 (Datum, &(((UINT64 *) Buffer) [Offset]));
break;
default:
/* Should not get here */
break;
}
}
@ -758,6 +762,10 @@ AcpiExSetBufferDatum (
ACPI_MOVE_UNALIGNED64_TO_64 (&(((UINT64 *) Buffer)[Offset]), &MergedDatum);
break;
default:
/* Should not get here */
break;
}
}
@ -800,7 +808,7 @@ AcpiExExtractFromField (
ByteFieldLength = ACPI_ROUND_BITS_UP_TO_BYTES (ObjDesc->CommonField.BitLength);
if (ByteFieldLength > BufferLength)
{
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Field size %X (bytes) too large for buffer (%X)\n",
ByteFieldLength, BufferLength));
@ -812,8 +820,8 @@ AcpiExExtractFromField (
DatumCount = ACPI_ROUND_UP_TO (ByteFieldLength,
ObjDesc->CommonField.AccessByteWidth);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"ByteLen=%x, DatumLen=%x, ByteGran=%x\n",
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"ByteLen=%X, DatumLen=%X, ByteGran=%X\n",
ByteFieldLength, DatumCount,ObjDesc->CommonField.AccessByteWidth));
/*
@ -991,7 +999,7 @@ AcpiExInsertIntoField (
ByteFieldLength = ACPI_ROUND_BITS_UP_TO_BYTES (ObjDesc->CommonField.BitLength);
if (BufferLength < ByteFieldLength)
{
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Buffer length %X too small for field %X\n",
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Buffer length %X too small for field %X\n",
BufferLength, ByteFieldLength));
return_ACPI_STATUS (AE_BUFFER_OVERFLOW);
@ -1001,8 +1009,8 @@ AcpiExInsertIntoField (
DatumCount = ACPI_ROUND_UP_TO (ByteFieldLength, ObjDesc->CommonField.AccessByteWidth);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"ByteLen=%x, DatumLen=%x, ByteGran=%x\n",
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"ByteLen=%X, DatumLen=%X, ByteGran=%X\n",
ByteFieldLength, DatumCount, ObjDesc->CommonField.AccessByteWidth));
/*

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes
* $Revision: 1.100 $
* $Revision: 1.106 $
*
*****************************************************************************/
@ -119,7 +119,6 @@
#define __EXMISC_C__
#include "acpi.h"
#include "acparser.h"
#include "acinterp.h"
#include "amlcode.h"
#include "acdispat.h"
@ -157,9 +156,9 @@ AcpiExGetObjectReference (
switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
{
case ACPI_DESC_TYPE_INTERNAL:
case ACPI_DESC_TYPE_OPERAND:
if (ObjDesc->Common.Type != INTERNAL_TYPE_REFERENCE)
if (ACPI_GET_OBJECT_TYPE (ObjDesc) != INTERNAL_TYPE_REFERENCE)
{
*ReturnDesc = NULL;
Status = AE_TYPE;
@ -177,7 +176,7 @@ AcpiExGetObjectReference (
Status = AcpiDsMethodDataGetNode (ObjDesc->Reference.Opcode,
ObjDesc->Reference.Offset, WalkState,
(ACPI_NAMESPACE_NODE **) ReturnDesc);
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, ReturnDesc));
break;
default:
@ -284,15 +283,15 @@ AcpiExConcatTemplate (
ACPI_MEMCPY (NewBuf, ObjDesc1->Buffer.Pointer, Length1);
ACPI_MEMCPY (NewBuf + Length1, ObjDesc2->Buffer.Pointer, Length2);
/*
* Point the return object to the new buffer
*/
/* Complete the buffer object initialization */
ReturnDesc->Common.Flags = AOPOBJ_DATA_VALID;
ReturnDesc->Buffer.Pointer = (UINT8 *) NewBuf;
ReturnDesc->Buffer.Length = Length1 + Length2;
ReturnDesc->Buffer.Length = (UINT32) (Length1 + Length2);
/* Compute the new checksum */
NewBuf[ReturnDesc->Buffer.Length - 1] =
NewBuf[ReturnDesc->Buffer.Length - 1] = (NATIVE_CHAR)
AcpiUtGenerateChecksum (ReturnDesc->Buffer.Pointer,
(ReturnDesc->Buffer.Length - 1));
@ -336,7 +335,6 @@ AcpiExDoConcatenate (
ACPI_INTEGER ThisInteger;
ACPI_OPERAND_OBJECT *ReturnDesc;
NATIVE_CHAR *NewBuf;
UINT32 IntegerSize = sizeof (ACPI_INTEGER);
ACPI_FUNCTION_ENTRY ();
@ -344,27 +342,16 @@ AcpiExDoConcatenate (
/*
* There are three cases to handle:
* 1) Two Integers concatenated to produce a buffer
* 2) Two Strings concatenated to produce a string
* 3) Two Buffers concatenated to produce a buffer
*
* 1) Two Integers concatenated to produce a new Buffer
* 2) Two Strings concatenated to produce a new String
* 3) Two Buffers concatenated to produce a new Buffer
*/
switch (ObjDesc1->Common.Type)
switch (ACPI_GET_OBJECT_TYPE (ObjDesc1))
{
case ACPI_TYPE_INTEGER:
/* Handle both ACPI 1.0 and ACPI 2.0 Integer widths */
if (WalkState->MethodNode->Flags & ANOBJ_DATA_WIDTH_32)
{
/*
* We are running a method that exists in a 32-bit ACPI table.
* Truncate the value to 32 bits by zeroing out the upper
* 32-bit field
*/
IntegerSize = sizeof (UINT32);
}
/* Result of two integers is a buffer */
/* Result of two Integers is a Buffer */
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER);
if (!ReturnDesc)
@ -372,9 +359,9 @@ AcpiExDoConcatenate (
return (AE_NO_MEMORY);
}
/* Need enough space for two integers */
/* Need enough buffer space for two integers */
ReturnDesc->Buffer.Length = IntegerSize * 2;
ReturnDesc->Buffer.Length = AcpiGbl_IntegerByteWidth * 2;
NewBuf = ACPI_MEM_CALLOCATE (ReturnDesc->Buffer.Length);
if (!NewBuf)
{
@ -384,31 +371,35 @@ AcpiExDoConcatenate (
goto Cleanup;
}
ReturnDesc->Buffer.Pointer = (UINT8 *) NewBuf;
/* Convert the first integer */
ThisInteger = ObjDesc1->Integer.Value;
for (i = 0; i < IntegerSize; i++)
for (i = 0; i < AcpiGbl_IntegerByteWidth; i++)
{
NewBuf[i] = (UINT8) ThisInteger;
NewBuf[i] = (NATIVE_CHAR) ThisInteger;
ThisInteger >>= 8;
}
/* Convert the second integer */
ThisInteger = ObjDesc2->Integer.Value;
for (; i < (IntegerSize * 2); i++)
for (; i < (ACPI_MUL_2 (AcpiGbl_IntegerByteWidth)); i++)
{
NewBuf[i] = (UINT8) ThisInteger;
NewBuf[i] = (NATIVE_CHAR) ThisInteger;
ThisInteger >>= 8;
}
/* Complete the buffer object initialization */
ReturnDesc->Common.Flags = AOPOBJ_DATA_VALID;
ReturnDesc->Buffer.Pointer = (UINT8 *) NewBuf;
break;
case ACPI_TYPE_STRING:
/* Result of two Strings is a String */
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_STRING);
if (!ReturnDesc)
{
@ -417,8 +408,8 @@ AcpiExDoConcatenate (
/* Operand0 is string */
NewBuf = ACPI_MEM_ALLOCATE (ObjDesc1->String.Length +
ObjDesc2->String.Length + 1);
NewBuf = ACPI_MEM_ALLOCATE ((ACPI_SIZE) ObjDesc1->String.Length +
(ACPI_SIZE) ObjDesc2->String.Length + 1);
if (!NewBuf)
{
ACPI_REPORT_ERROR
@ -427,11 +418,13 @@ AcpiExDoConcatenate (
goto Cleanup;
}
/* Concatenate the strings */
ACPI_STRCPY (NewBuf, ObjDesc1->String.Pointer);
ACPI_STRCPY (NewBuf + ObjDesc1->String.Length,
ObjDesc2->String.Pointer);
/* Point the return object to the new string */
/* Complete the String object initialization */
ReturnDesc->String.Pointer = NewBuf;
ReturnDesc->String.Length = ObjDesc1->String.Length +
@ -441,7 +434,7 @@ AcpiExDoConcatenate (
case ACPI_TYPE_BUFFER:
/* Operand0 is a buffer */
/* Result of two Buffers is a Buffer */
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER);
if (!ReturnDesc)
@ -449,8 +442,8 @@ AcpiExDoConcatenate (
return (AE_NO_MEMORY);
}
NewBuf = ACPI_MEM_ALLOCATE (ObjDesc1->Buffer.Length +
ObjDesc2->Buffer.Length);
NewBuf = ACPI_MEM_ALLOCATE ((ACPI_SIZE) ObjDesc1->Buffer.Length +
(ACPI_SIZE) ObjDesc2->Buffer.Length);
if (!NewBuf)
{
ACPI_REPORT_ERROR
@ -459,22 +452,26 @@ AcpiExDoConcatenate (
goto Cleanup;
}
/* Concatenate the buffers */
ACPI_MEMCPY (NewBuf, ObjDesc1->Buffer.Pointer,
ObjDesc1->Buffer.Length);
ACPI_MEMCPY (NewBuf + ObjDesc1->Buffer.Length, ObjDesc2->Buffer.Pointer,
ObjDesc2->Buffer.Length);
/*
* Point the return object to the new buffer
*/
/* Complete the buffer object initialization */
ReturnDesc->Common.Flags = AOPOBJ_DATA_VALID;
ReturnDesc->Buffer.Pointer = (UINT8 *) NewBuf;
ReturnDesc->Buffer.Length = ObjDesc1->Buffer.Length +
ObjDesc2->Buffer.Length;
ReturnDesc->Buffer.Length = ObjDesc1->Buffer.Length +
ObjDesc2->Buffer.Length;
break;
default:
/* Invalid object type, should not happen here */
Status = AE_AML_INTERNAL;
ReturnDesc = NULL;
}
@ -647,6 +644,9 @@ AcpiExDoLogicalOp (
return (TRUE);
}
break;
default:
break;
}
return (FALSE);