summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/exconvrt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/exconvrt.c')
-rw-r--r--sys/contrib/dev/acpica/exconvrt.c43
1 files changed, 36 insertions, 7 deletions
diff --git a/sys/contrib/dev/acpica/exconvrt.c b/sys/contrib/dev/acpica/exconvrt.c
index c3c8f98..6729a27 100644
--- a/sys/contrib/dev/acpica/exconvrt.c
+++ b/sys/contrib/dev/acpica/exconvrt.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exconvrt - Object conversion routines
- * $Revision: 37 $
+ * $Revision: 39 $
*
*****************************************************************************/
@@ -273,7 +273,7 @@ AcpiExConvertToInteger (
*
* RETURN: Status
*
- * DESCRIPTION: Convert an ACPI Object to an Buffer
+ * DESCRIPTION: Convert an ACPI Object to a Buffer
*
******************************************************************************/
@@ -335,7 +335,34 @@ AcpiExConvertToBuffer (
case ACPI_TYPE_STRING:
- *ResultDesc = ObjDesc;
+ /*
+ * Create a new Buffer object
+ */
+ RetDesc = AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER);
+ if (!RetDesc)
+ {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ /* Need enough space for one integer */
+
+ NewBuf = ACPI_MEM_CALLOCATE (ObjDesc->String.Length);
+ if (!NewBuf)
+ {
+ ACPI_REPORT_ERROR
+ (("ExConvertToBuffer: Buffer allocation failure\n"));
+ AcpiUtRemoveReference (RetDesc);
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ ACPI_STRNCPY ((char *) NewBuf, (char *) ObjDesc->String.Pointer, ObjDesc->String.Length);
+ RetDesc->Buffer.Flags |= AOPOBJ_DATA_VALID;
+ RetDesc->Buffer.Pointer = NewBuf;
+ RetDesc->Buffer.Length = ObjDesc->String.Length;
+
+ /* Return the new buffer descriptor */
+
+ *ResultDesc = RetDesc;
break;
@@ -359,11 +386,13 @@ AcpiExConvertToBuffer (
*
* FUNCTION: AcpiExConvertAscii
*
- * PARAMETERS: Integer
+ * PARAMETERS: Integer - Value to be converted
+ * Base - 10 or 16
+ * String - Where the string is returned
*
* RETURN: Actual string length
*
- * DESCRIPTION: Convert an ACPI Integer to a hex string
+ * DESCRIPTION: Convert an ACPI Integer to a hex or decimal string
*
******************************************************************************/
@@ -706,8 +735,8 @@ AcpiExConvertToTargetType (
if (DestinationType != ACPI_GET_OBJECT_TYPE (SourceDesc))
{
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Target does not allow conversion of type %s to %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Explicit operator, will store (%s) over existing type (%s)\n",
AcpiUtGetObjectTypeName (SourceDesc),
AcpiUtGetTypeName (DestinationType)));
Status = AE_TYPE;
OpenPOWER on IntegriCloud