Print this page
acpica-unix2-20130823
PANKOVs restructure
*** 3,13 ****
* Module Name: exconvrt - Object conversion routines
*
*****************************************************************************/
/*
! * 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: exconvrt - Object conversion routines
*
*****************************************************************************/
/*
! * Copyright (C) 2000 - 2013, 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:
*** 112,121 ****
--- 112,122 ----
Pointer = ObjDesc->Buffer.Pointer;
Count = ObjDesc->Buffer.Length;
break;
default:
+
return_ACPI_STATUS (AE_TYPE);
}
/*
* Convert the buffer/string to an integer. Note that both buffers and
*** 131,141 ****
/* String conversion is different than Buffer conversion */
switch (ObjDesc->Common.Type)
{
case ACPI_TYPE_STRING:
-
/*
* Convert string to an integer - for most cases, the string must be
* hexadecimal as per the ACPI specification. The only exception (as
* of ACPI 3.0) is that the ToInteger() operator allows both decimal
* and hexadecimal strings (hex prefixed with "0x").
--- 132,141 ----
*** 145,155 ****
{
return_ACPI_STATUS (Status);
}
break;
-
case ACPI_TYPE_BUFFER:
/* Check for zero-length buffer */
if (!Count)
--- 145,154 ----
*** 177,190 ****
*/
Result |= (((UINT64) Pointer[i]) << (i * 8));
}
break;
-
default:
/* No other types can get here */
break;
}
/* Create a new integer */
--- 176,189 ----
*/
Result |= (((UINT64) Pointer[i]) << (i * 8));
}
break;
default:
/* No other types can get here */
+
break;
}
/* Create a new integer */
*** 197,207 ****
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Converted value: %8.8X%8.8X\n",
ACPI_FORMAT_UINT64 (Result)));
/* Save the Result */
! AcpiExTruncateFor32bitTable (ReturnDesc);
*ResultDesc = ReturnDesc;
return_ACPI_STATUS (AE_OK);
}
--- 196,206 ----
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Converted value: %8.8X%8.8X\n",
ACPI_FORMAT_UINT64 (Result)));
/* Save the Result */
! (void) AcpiExTruncateFor32bitTable (ReturnDesc);
*ResultDesc = ReturnDesc;
return_ACPI_STATUS (AE_OK);
}
*** 240,250 ****
*ResultDesc = ObjDesc;
return_ACPI_STATUS (AE_OK);
case ACPI_TYPE_INTEGER:
-
/*
* Create a new Buffer object.
* Need enough space for one integer
*/
ReturnDesc = AcpiUtCreateBufferObject (AcpiGbl_IntegerByteWidth);
--- 239,248 ----
*** 259,271 ****
ACPI_MEMCPY (NewBuf,
&ObjDesc->Integer.Value,
AcpiGbl_IntegerByteWidth);
break;
-
case ACPI_TYPE_STRING:
-
/*
* Create a new Buffer object
* Size will be the string length
*
* NOTE: Add one to the string length to include the null terminator.
--- 257,267 ----
*** 285,296 ****
NewBuf = ReturnDesc->Buffer.Pointer;
ACPI_STRNCPY ((char *) NewBuf, (char *) ObjDesc->String.Pointer,
ObjDesc->String.Length);
break;
-
default:
return_ACPI_STATUS (AE_TYPE);
}
/* Mark buffer initialized */
--- 281,292 ----
NewBuf = ReturnDesc->Buffer.Pointer;
ACPI_STRNCPY ((char *) NewBuf, (char *) ObjDesc->String.Pointer,
ObjDesc->String.Length);
break;
default:
+
return_ACPI_STATUS (AE_TYPE);
}
/* Mark buffer initialized */
*** 342,360 ****
--- 338,359 ----
/* Setup max length for the decimal number */
switch (DataWidth)
{
case 1:
+
DecimalLength = ACPI_MAX8_DECIMAL_DIGITS;
break;
case 4:
+
DecimalLength = ACPI_MAX32_DECIMAL_DIGITS;
break;
case 8:
default:
+
DecimalLength = ACPI_MAX64_DECIMAL_DIGITS;
break;
}
SupressZeros = TRUE; /* No leading zeros */
*** 459,469 ****
/* No conversion necessary */
*ResultDesc = ObjDesc;
return_ACPI_STATUS (AE_OK);
-
case ACPI_TYPE_INTEGER:
switch (Type)
{
case ACPI_EXPLICIT_CONVERT_DECIMAL:
--- 458,467 ----
*** 503,513 ****
ReturnDesc->String.Length = StringLength;
NewBuf [StringLength] = 0;
break;
-
case ACPI_TYPE_BUFFER:
/* Setup string length, base, and separator */
switch (Type)
--- 501,510 ----
*** 602,611 ****
--- 599,609 ----
}
*NewBuf = 0;
break;
default:
+
return_ACPI_STATUS (AE_TYPE);
}
*ResultDesc = ReturnDesc;
return_ACPI_STATUS (AE_OK);
*** 661,670 ****
--- 659,669 ----
* Named field can always handle conversions
*/
break;
default:
+
/* No conversion allowed for these types */
if (DestinationType != SourceDesc->Common.Type)
{
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
*** 674,684 ****
Status = AE_TYPE;
}
}
break;
-
case ARGI_TARGETREF:
switch (DestinationType)
{
case ACPI_TYPE_INTEGER:
--- 673,682 ----
*** 691,737 ****
*/
Status = AcpiExConvertToInteger (SourceDesc, ResultDesc,
16);
break;
-
case ACPI_TYPE_STRING:
/*
* The operand must be a String. We can convert an
* Integer or Buffer if necessary
*/
Status = AcpiExConvertToString (SourceDesc, ResultDesc,
ACPI_IMPLICIT_CONVERT_HEX);
break;
-
case ACPI_TYPE_BUFFER:
/*
* The operand must be a Buffer. We can convert an
* Integer or String if necessary
*/
Status = AcpiExConvertToBuffer (SourceDesc, ResultDesc);
break;
-
default:
ACPI_ERROR ((AE_INFO, "Bad destination type during conversion: 0x%X",
DestinationType));
Status = AE_AML_INTERNAL;
break;
}
break;
-
case ARGI_REFERENCE:
/*
* CreateXxxxField cases - we are storing the field object into the name
*/
break;
-
default:
ACPI_ERROR ((AE_INFO,
"Unknown Target type ID 0x%X AmlOpcode 0x%X DestType %s",
GET_CURRENT_ARG_TYPE (WalkState->OpInfo->RuntimeArgs),
WalkState->Opcode, AcpiUtGetTypeName (DestinationType)));
Status = AE_AML_INTERNAL;
--- 689,732 ----
*/
Status = AcpiExConvertToInteger (SourceDesc, ResultDesc,
16);
break;
case ACPI_TYPE_STRING:
/*
* The operand must be a String. We can convert an
* Integer or Buffer if necessary
*/
Status = AcpiExConvertToString (SourceDesc, ResultDesc,
ACPI_IMPLICIT_CONVERT_HEX);
break;
case ACPI_TYPE_BUFFER:
/*
* The operand must be a Buffer. We can convert an
* Integer or String if necessary
*/
Status = AcpiExConvertToBuffer (SourceDesc, ResultDesc);
break;
default:
+
ACPI_ERROR ((AE_INFO, "Bad destination type during conversion: 0x%X",
DestinationType));
Status = AE_AML_INTERNAL;
break;
}
break;
case ARGI_REFERENCE:
/*
* CreateXxxxField cases - we are storing the field object into the name
*/
break;
default:
+
ACPI_ERROR ((AE_INFO,
"Unknown Target type ID 0x%X AmlOpcode 0x%X DestType %s",
GET_CURRENT_ARG_TYPE (WalkState->OpInfo->RuntimeArgs),
WalkState->Opcode, AcpiUtGetTypeName (DestinationType)));
Status = AE_AML_INTERNAL;
*** 748,754 ****
Status = AE_OK;
}
return_ACPI_STATUS (Status);
}
-
-
--- 743,747 ----