summaryrefslogtreecommitdiff
path: root/source/components/utilities
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/utilities')
-rw-r--r--source/components/utilities/utcache.c2
-rw-r--r--source/components/utilities/utdecode.c29
-rw-r--r--source/components/utilities/utnonansi.c305
-rw-r--r--source/components/utilities/uttrack.c2
-rw-r--r--source/components/utilities/utxferror.c2
-rw-r--r--source/components/utilities/utxfinit.c72
6 files changed, 290 insertions, 122 deletions
diff --git a/source/components/utilities/utcache.c b/source/components/utilities/utcache.c
index 66fa8680619ad..049dae8e98a01 100644
--- a/source/components/utilities/utcache.c
+++ b/source/components/utilities/utcache.c
@@ -279,7 +279,7 @@ AcpiOsAcquireObject (
void *Object;
- ACPI_FUNCTION_NAME (OsAcquireObject);
+ ACPI_FUNCTION_TRACE (OsAcquireObject);
if (!Cache)
diff --git a/source/components/utilities/utdecode.c b/source/components/utilities/utdecode.c
index 06817ab3b0d17..648cc5c5c973d 100644
--- a/source/components/utilities/utdecode.c
+++ b/source/components/utilities/utdecode.c
@@ -506,7 +506,7 @@ AcpiUtGetMutexName (
/* Names for Notify() values, used for debug output */
-static const char *AcpiGbl_GenericNotify[ACPI_NOTIFY_MAX + 1] =
+static const char *AcpiGbl_GenericNotify[ACPI_GENERIC_NOTIFY_MAX + 1] =
{
/* 00 */ "Bus Check",
/* 01 */ "Device Check",
@@ -520,32 +520,35 @@ static const char *AcpiGbl_GenericNotify[ACPI_NOTIFY_MAX + 1] =
/* 09 */ "Device PLD Check",
/* 0A */ "Reserved",
/* 0B */ "System Locality Update",
- /* 0C */ "Shutdown Request",
+ /* 0C */ "Shutdown Request", /* Reserved in ACPI 6.0 */
/* 0D */ "System Resource Affinity Update"
};
-static const char *AcpiGbl_DeviceNotify[4] =
+static const char *AcpiGbl_DeviceNotify[5] =
{
/* 80 */ "Status Change",
/* 81 */ "Information Change",
/* 82 */ "Device-Specific Change",
- /* 83 */ "Device-Specific Change"
+ /* 83 */ "Device-Specific Change",
+ /* 84 */ "Reserved"
};
-static const char *AcpiGbl_ProcessorNotify[4] =
+static const char *AcpiGbl_ProcessorNotify[5] =
{
/* 80 */ "Performance Capability Change",
/* 81 */ "C-State Change",
/* 82 */ "Throttling Capability Change",
- /* 83 */ "Device-Specific Change"
+ /* 83 */ "Guaranteed Change",
+ /* 84 */ "Minimum Excursion"
};
-static const char *AcpiGbl_ThermalNotify[4] =
+static const char *AcpiGbl_ThermalNotify[5] =
{
/* 80 */ "Thermal Status Change",
/* 81 */ "Thermal Trip Point Change",
/* 82 */ "Thermal Device List Change",
- /* 83 */ "Thermal Relationship Change"
+ /* 83 */ "Thermal Relationship Change",
+ /* 84 */ "Reserved"
};
@@ -555,23 +558,23 @@ AcpiUtGetNotifyName (
ACPI_OBJECT_TYPE Type)
{
- /* 00 - 0D are common to all object types */
+ /* 00 - 0D are "common to all object types" (from ACPI Spec) */
- if (NotifyValue <= ACPI_NOTIFY_MAX)
+ if (NotifyValue <= ACPI_GENERIC_NOTIFY_MAX)
{
return (AcpiGbl_GenericNotify[NotifyValue]);
}
- /* 0D - 7F are reserved */
+ /* 0E - 7F are reserved */
if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
{
return ("Reserved");
}
- /* 80 - 83 are per-object-type */
+ /* 80 - 84 are per-object-type */
- if (NotifyValue <= 0x83)
+ if (NotifyValue <= ACPI_SPECIFIC_NOTIFY_MAX)
{
switch (Type)
{
diff --git a/source/components/utilities/utnonansi.c b/source/components/utilities/utnonansi.c
index 5f45aaa1ff73d..572d24a6b6c3c 100644
--- a/source/components/utilities/utnonansi.c
+++ b/source/components/utilities/utnonansi.c
@@ -164,6 +164,82 @@ AcpiUtStricmp (
}
+#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtSafeStrcpy, AcpiUtSafeStrcat, AcpiUtSafeStrncat
+ *
+ * PARAMETERS: Adds a "DestSize" parameter to each of the standard string
+ * functions. This is the size of the Destination buffer.
+ *
+ * RETURN: TRUE if the operation would overflow the destination buffer.
+ *
+ * DESCRIPTION: Safe versions of standard Clib string functions. Ensure that
+ * the result of the operation will not overflow the output string
+ * buffer.
+ *
+ * NOTE: These functions are typically only helpful for processing
+ * user input and command lines. For most ACPICA code, the
+ * required buffer length is precisely calculated before buffer
+ * allocation, so the use of these functions is unnecessary.
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AcpiUtSafeStrcpy (
+ char *Dest,
+ ACPI_SIZE DestSize,
+ char *Source)
+{
+
+ if (strlen (Source) >= DestSize)
+ {
+ return (TRUE);
+ }
+
+ strcpy (Dest, Source);
+ return (FALSE);
+}
+
+BOOLEAN
+AcpiUtSafeStrcat (
+ char *Dest,
+ ACPI_SIZE DestSize,
+ char *Source)
+{
+
+ if ((strlen (Dest) + strlen (Source)) >= DestSize)
+ {
+ return (TRUE);
+ }
+
+ strcat (Dest, Source);
+ return (FALSE);
+}
+
+BOOLEAN
+AcpiUtSafeStrncat (
+ char *Dest,
+ ACPI_SIZE DestSize,
+ char *Source,
+ ACPI_SIZE MaxTransferLength)
+{
+ ACPI_SIZE ActualTransferLength;
+
+
+ ActualTransferLength = ACPI_MIN (MaxTransferLength, strlen (Source));
+
+ if ((strlen (Dest) + ActualTransferLength) >= DestSize)
+ {
+ return (TRUE);
+ }
+
+ strncat (Dest, Source, MaxTransferLength);
+ return (FALSE);
+}
+#endif
+
+
/*******************************************************************************
*
* FUNCTION: AcpiUtStrtoul64
@@ -179,7 +255,15 @@ AcpiUtStricmp (
* 32-bit or 64-bit conversion, depending on the current mode
* of the interpreter.
*
- * NOTE: Does not support Octal strings, not needed.
+ * NOTES: AcpiGbl_IntegerByteWidth should be set to the proper width.
+ * For the core ACPICA code, this width depends on the DSDT
+ * version. For iASL, the default byte width is always 8.
+ *
+ * Does not support Octal strings, not needed at this time.
+ *
+ * There is an earlier version of the function after this one,
+ * below. It is slightly different than this one, and the two
+ * may eventually may need to be merged. (01/2016).
*
******************************************************************************/
@@ -200,7 +284,7 @@ AcpiUtStrtoul64 (
UINT8 Term = 0;
- ACPI_FUNCTION_TRACE_STR (UtStroul64, String);
+ ACPI_FUNCTION_TRACE_STR (UtStrtoul64, String);
switch (Base)
@@ -376,78 +460,201 @@ ErrorExit:
}
}
+#ifdef _OBSOLETE_FUNCTIONS
+/* TBD: use version in ACPICA main code base? */
+/* DONE: 01/2016 */
-#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
/*******************************************************************************
*
- * FUNCTION: AcpiUtSafeStrcpy, AcpiUtSafeStrcat, AcpiUtSafeStrncat
+ * FUNCTION: strtoul64
*
- * PARAMETERS: Adds a "DestSize" parameter to each of the standard string
- * functions. This is the size of the Destination buffer.
+ * PARAMETERS: String - Null terminated string
+ * Terminater - Where a pointer to the terminating byte
+ * is returned
+ * Base - Radix of the string
*
- * RETURN: TRUE if the operation would overflow the destination buffer.
- *
- * DESCRIPTION: Safe versions of standard Clib string functions. Ensure that
- * the result of the operation will not overflow the output string
- * buffer.
+ * RETURN: Converted value
*
- * NOTE: These functions are typically only helpful for processing
- * user input and command lines. For most ACPICA code, the
- * required buffer length is precisely calculated before buffer
- * allocation, so the use of these functions is unnecessary.
+ * DESCRIPTION: Convert a string into an unsigned value.
*
******************************************************************************/
-BOOLEAN
-AcpiUtSafeStrcpy (
- char *Dest,
- ACPI_SIZE DestSize,
- char *Source)
+ACPI_STATUS
+strtoul64 (
+ char *String,
+ UINT32 Base,
+ UINT64 *RetInteger)
{
+ UINT32 Index;
+ UINT32 Sign;
+ UINT64 ReturnValue = 0;
+ ACPI_STATUS Status = AE_OK;
- if (strlen (Source) >= DestSize)
+
+ *RetInteger = 0;
+
+ switch (Base)
{
- return (TRUE);
+ case 0:
+ case 8:
+ case 10:
+ case 16:
+
+ break;
+
+ default:
+ /*
+ * The specified Base parameter is not in the domain of
+ * this function:
+ */
+ return (AE_BAD_PARAMETER);
}
- strcpy (Dest, Source);
- return (FALSE);
-}
+ /* Skip over any white space in the buffer: */
-BOOLEAN
-AcpiUtSafeStrcat (
- char *Dest,
- ACPI_SIZE DestSize,
- char *Source)
-{
+ while (isspace ((int) *String) || *String == '\t')
+ {
+ ++String;
+ }
- if ((strlen (Dest) + strlen (Source)) >= DestSize)
+ /*
+ * The buffer may contain an optional plus or minus sign.
+ * If it does, then skip over it but remember what is was:
+ */
+ if (*String == '-')
{
- return (TRUE);
+ Sign = ACPI_SIGN_NEGATIVE;
+ ++String;
+ }
+ else if (*String == '+')
+ {
+ ++String;
+ Sign = ACPI_SIGN_POSITIVE;
+ }
+ else
+ {
+ Sign = ACPI_SIGN_POSITIVE;
}
- strcat (Dest, Source);
- return (FALSE);
-}
+ /*
+ * If the input parameter Base is zero, then we need to
+ * determine if it is octal, decimal, or hexadecimal:
+ */
+ if (Base == 0)
+ {
+ if (*String == '0')
+ {
+ if (tolower ((int) *(++String)) == 'x')
+ {
+ Base = 16;
+ ++String;
+ }
+ else
+ {
+ Base = 8;
+ }
+ }
+ else
+ {
+ Base = 10;
+ }
+ }
-BOOLEAN
-AcpiUtSafeStrncat (
- char *Dest,
- ACPI_SIZE DestSize,
- char *Source,
- ACPI_SIZE MaxTransferLength)
-{
- ACPI_SIZE ActualTransferLength;
+ /*
+ * For octal and hexadecimal bases, skip over the leading
+ * 0 or 0x, if they are present.
+ */
+ if (Base == 8 && *String == '0')
+ {
+ String++;
+ }
+ if (Base == 16 &&
+ *String == '0' &&
+ tolower ((int) *(++String)) == 'x')
+ {
+ String++;
+ }
- ActualTransferLength = ACPI_MIN (MaxTransferLength, strlen (Source));
+ /* Main loop: convert the string to an unsigned long */
- if ((strlen (Dest) + ActualTransferLength) >= DestSize)
+ while (*String)
{
- return (TRUE);
+ if (isdigit ((int) *String))
+ {
+ Index = ((UINT8) *String) - '0';
+ }
+ else
+ {
+ Index = (UINT8) toupper ((int) *String);
+ if (isupper ((int) Index))
+ {
+ Index = Index - 'A' + 10;
+ }
+ else
+ {
+ goto ErrorExit;
+ }
+ }
+
+ if (Index >= Base)
+ {
+ goto ErrorExit;
+ }
+
+ /* Check to see if value is out of range: */
+
+ if (ReturnValue > ((ACPI_UINT64_MAX - (UINT64) Index) /
+ (UINT64) Base))
+ {
+ goto ErrorExit;
+ }
+ else
+ {
+ ReturnValue *= Base;
+ ReturnValue += Index;
+ }
+
+ ++String;
}
- strncat (Dest, Source, MaxTransferLength);
- return (FALSE);
+
+ /* If a minus sign was present, then "the conversion is negated": */
+
+ if (Sign == ACPI_SIGN_NEGATIVE)
+ {
+ ReturnValue = (ACPI_UINT32_MAX - ReturnValue) + 1;
+ }
+
+ *RetInteger = ReturnValue;
+ return (Status);
+
+
+ErrorExit:
+ switch (Base)
+ {
+ case 8:
+
+ Status = AE_BAD_OCTAL_CONSTANT;
+ break;
+
+ case 10:
+
+ Status = AE_BAD_DECIMAL_CONSTANT;
+ break;
+
+ case 16:
+
+ Status = AE_BAD_HEX_CONSTANT;
+ break;
+
+ default:
+
+ /* Base validated above */
+
+ break;
+ }
+
+ return (Status);
}
#endif
diff --git a/source/components/utilities/uttrack.c b/source/components/utilities/uttrack.c
index b5383c8c383f2..b6d6a33639bc6 100644
--- a/source/components/utilities/uttrack.c
+++ b/source/components/utilities/uttrack.c
@@ -775,7 +775,7 @@ AcpiUtDumpAllocations (
if (!NumOutstanding)
{
- ACPI_INFO ((AE_INFO, "No outstanding allocations"));
+ ACPI_INFO (("No outstanding allocations"));
}
else
{
diff --git a/source/components/utilities/utxferror.c b/source/components/utilities/utxferror.c
index 35efd522b023d..e79ffc94f3017 100644
--- a/source/components/utilities/utxferror.c
+++ b/source/components/utilities/utxferror.c
@@ -205,8 +205,6 @@ ACPI_EXPORT_SYMBOL (AcpiWarning)
void ACPI_INTERNAL_VAR_XFACE
AcpiInfo (
- const char *ModuleName,
- UINT32 LineNumber,
const char *Format,
...)
{
diff --git a/source/components/utilities/utxfinit.c b/source/components/utilities/utxfinit.c
index 898a75cf314e8..a8ea3fdf49f45 100644
--- a/source/components/utilities/utxfinit.c
+++ b/source/components/utilities/utxfinit.c
@@ -132,25 +132,6 @@ AcpiInitializeSubsystem (
return_ACPI_STATUS (Status);
}
- if (!AcpiGbl_OverrideDefaultRegionHandlers)
- {
- /*
- * Install the default operation region handlers. These are the
- * handlers that are defined by the ACPI specification to be
- * "always accessible" -- namely, SystemMemory, SystemIO, and
- * PCI_Config. This also means that no _REG methods need to be
- * run for these address spaces. We need to have these handlers
- * installed before any AML code can be executed, especially any
- * module-level code (11/2015).
- */
- Status = AcpiEvInstallRegionHandlers ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "During Region initialization"));
- return_ACPI_STATUS (Status);
- }
- }
-
return_ACPI_STATUS (AE_OK);
}
@@ -187,17 +168,17 @@ AcpiEnableSubsystem (
*/
AcpiGbl_EarlyInitialization = FALSE;
- if (AcpiGbl_OverrideDefaultRegionHandlers)
+ /*
+ * Install the default operation region handlers. These are the
+ * handlers that are defined by the ACPI specification to be
+ * "always accessible" -- namely, SystemMemory, SystemIO, and
+ * PCI_Config. This also means that no _REG methods need to be
+ * run for these address spaces. We need to have these handlers
+ * installed before any AML code can be executed, especially any
+ * module-level code (11/2015).
+ */
+ if (!AcpiGbl_GroupModuleLevelCode)
{
- /*
- * Install the default operation region handlers. These are the
- * handlers that are defined by the ACPI specification to be
- * "always accessible" -- namely, SystemMemory, SystemIO, and
- * PCI_Config. This also means that no _REG methods need to be
- * run for these address spaces. We need to have these handlers
- * installed before any AML code can be executed, especially any
- * module-level code (11/2015).
- */
Status = AcpiEvInstallRegionHandlers ();
if (ACPI_FAILURE (Status))
{
@@ -206,7 +187,6 @@ AcpiEnableSubsystem (
}
}
-
#if (!ACPI_REDUCED_HARDWARE)
/* Enable ACPI mode */
@@ -312,25 +292,6 @@ AcpiInitializeObjects (
ACPI_FUNCTION_TRACE (AcpiInitializeObjects);
- /*
- * Run all _REG methods
- *
- * Note: Any objects accessed by the _REG methods will be automatically
- * initialized, even if they contain executable AML (see the call to
- * AcpiNsInitializeObjects below).
- */
- if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT))
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "[Init] Executing _REG OpRegion methods\n"));
-
- Status = AcpiEvInitializeOpRegions ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- }
-
#ifdef ACPI_EXEC_APP
/*
* This call implements the "initialization file" option for AcpiExec.
@@ -373,16 +334,15 @@ AcpiInitializeObjects (
}
}
+ AcpiGbl_NamespaceInitialized = TRUE;
+
/*
- * Initialize all device objects in the namespace. This runs the device
- * _STA and _INI methods.
+ * Initialize all device/region objects in the namespace. This runs
+ * the device _STA and _INI methods and region _REG methods.
*/
- if (!(Flags & ACPI_NO_DEVICE_INIT))
+ if (!(Flags & (ACPI_NO_DEVICE_INIT | ACPI_NO_ADDRESS_SPACE_INIT)))
{
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "[Init] Initializing ACPI Devices\n"));
-
- Status = AcpiNsInitializeDevices ();
+ Status = AcpiNsInitializeDevices (Flags);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);