aboutsummaryrefslogtreecommitdiff
path: root/source/components/utilities
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2012-07-11 16:51:47 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2012-07-11 16:51:47 +0000
commit8724452f676e45bfd39cfb47234f7def5551f067 (patch)
treeadad4747b5f7a0166c805c0a7a6bdd4c884aa24b /source/components/utilities
parentafea6800ce201481ac6ebace2b4266b3b1b15d6e (diff)
downloadsrc-8724452f676e45bfd39cfb47234f7def5551f067.tar.gz
src-8724452f676e45bfd39cfb47234f7def5551f067.zip
Import ACPICA 20120711.vendor/acpica/20120711
Notes
Notes: svn path=/vendor-sys/acpica/dist/; revision=238367 svn path=/vendor-sys/acpica/20120711/; revision=238368; tag=vendor/acpica/20120711
Diffstat (limited to 'source/components/utilities')
-rw-r--r--source/components/utilities/utdecode.c62
-rw-r--r--source/components/utilities/utexcep.c174
-rw-r--r--source/components/utilities/utglobal.c5
-rw-r--r--source/components/utilities/utmisc.c80
-rw-r--r--source/components/utilities/utobject.c6
-rw-r--r--source/components/utilities/utresrc.c4
-rw-r--r--source/components/utilities/utxferror.c81
7 files changed, 274 insertions, 138 deletions
diff --git a/source/components/utilities/utdecode.c b/source/components/utilities/utdecode.c
index 718d73db4e3b..afb6e6c9cc7d 100644
--- a/source/components/utilities/utdecode.c
+++ b/source/components/utilities/utdecode.c
@@ -51,47 +51,6 @@
ACPI_MODULE_NAME ("utdecode")
-/*******************************************************************************
- *
- * FUNCTION: AcpiFormatException
- *
- * PARAMETERS: Status - The ACPI_STATUS code to be formatted
- *
- * RETURN: A string containing the exception text. A valid pointer is
- * always returned.
- *
- * DESCRIPTION: This function translates an ACPI exception into an ASCII string
- * It is here instead of utxface.c so it is always present.
- *
- ******************************************************************************/
-
-const char *
-AcpiFormatException (
- ACPI_STATUS Status)
-{
- const char *Exception = NULL;
-
-
- ACPI_FUNCTION_ENTRY ();
-
-
- Exception = AcpiUtValidateException (Status);
- if (!Exception)
- {
- /* Exception code was not recognized */
-
- ACPI_ERROR ((AE_INFO,
- "Unknown exception code: 0x%8.8X", Status));
-
- Exception = "UNKNOWN_STATUS_CODE";
- }
-
- return (ACPI_CAST_PTR (const char, Exception));
-}
-
-ACPI_EXPORT_SYMBOL (AcpiFormatException)
-
-
/*
* Properties of the ACPI Object Types, both internal and external.
* The table is indexed by values of ACPI_OBJECT_TYPE
@@ -180,16 +139,17 @@ AcpiUtHexToAsciiChar (
const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] =
{
- "SystemMemory",
- "SystemIO",
- "PCI_Config",
- "EmbeddedControl",
- "SMBus",
- "SystemCMOS",
- "PCIBARTarget",
- "IPMI",
- "GeneralPurposeIo",
- "GenericSerialBus"
+ "SystemMemory", /* 0x00 */
+ "SystemIO", /* 0x01 */
+ "PCI_Config", /* 0x02 */
+ "EmbeddedControl", /* 0x03 */
+ "SMBus", /* 0x04 */
+ "SystemCMOS", /* 0x05 */
+ "PCIBARTarget", /* 0x06 */
+ "IPMI", /* 0x07 */
+ "GeneralPurposeIo", /* 0x08 */
+ "GenericSerialBus", /* 0x09 */
+ "PCC" /* 0x0A */
};
diff --git a/source/components/utilities/utexcep.c b/source/components/utilities/utexcep.c
new file mode 100644
index 000000000000..5d4e9edff5d5
--- /dev/null
+++ b/source/components/utilities/utexcep.c
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ *
+ * Module Name: utexcep - Exception code support
+ *
+ ******************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2012, 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:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+
+#define __UTEXCEP_C__
+
+#define ACPI_DEFINE_EXCEPTION_TABLE
+#include "acpi.h"
+#include "accommon.h"
+
+
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("utexcep")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiFormatException
+ *
+ * PARAMETERS: Status - The ACPI_STATUS code to be formatted
+ *
+ * RETURN: A string containing the exception text. A valid pointer is
+ * always returned.
+ *
+ * DESCRIPTION: This function translates an ACPI exception into an ASCII
+ * string. Returns "unknown status" string for invalid codes.
+ *
+ ******************************************************************************/
+
+const char *
+AcpiFormatException (
+ ACPI_STATUS Status)
+{
+ const char *Exception = NULL;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ Exception = AcpiUtValidateException (Status);
+ if (!Exception)
+ {
+ /* Exception code was not recognized */
+
+ ACPI_ERROR ((AE_INFO,
+ "Unknown exception code: 0x%8.8X", Status));
+
+ Exception = "UNKNOWN_STATUS_CODE";
+ }
+
+ return (ACPI_CAST_PTR (const char, Exception));
+}
+
+ACPI_EXPORT_SYMBOL (AcpiFormatException)
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtValidateException
+ *
+ * PARAMETERS: Status - The ACPI_STATUS code to be formatted
+ *
+ * RETURN: A string containing the exception text. NULL if exception is
+ * not valid.
+ *
+ * DESCRIPTION: This function validates and translates an ACPI exception into
+ * an ASCII string.
+ *
+ ******************************************************************************/
+
+const char *
+AcpiUtValidateException (
+ ACPI_STATUS Status)
+{
+ UINT32 SubStatus;
+ const char *Exception = NULL;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ /*
+ * Status is composed of two parts, a "type" and an actual code
+ */
+ SubStatus = (Status & ~AE_CODE_MASK);
+
+ switch (Status & AE_CODE_MASK)
+ {
+ case AE_CODE_ENVIRONMENTAL:
+
+ if (SubStatus <= AE_CODE_ENV_MAX)
+ {
+ Exception = AcpiGbl_ExceptionNames_Env [SubStatus];
+ }
+ break;
+
+ case AE_CODE_PROGRAMMER:
+
+ if (SubStatus <= AE_CODE_PGM_MAX)
+ {
+ Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus];
+ }
+ break;
+
+ case AE_CODE_ACPI_TABLES:
+
+ if (SubStatus <= AE_CODE_TBL_MAX)
+ {
+ Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus];
+ }
+ break;
+
+ case AE_CODE_AML:
+
+ if (SubStatus <= AE_CODE_AML_MAX)
+ {
+ Exception = AcpiGbl_ExceptionNames_Aml [SubStatus];
+ }
+ break;
+
+ case AE_CODE_CONTROL:
+
+ if (SubStatus <= AE_CODE_CTRL_MAX)
+ {
+ Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus];
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return (ACPI_CAST_PTR (const char, Exception));
+}
diff --git a/source/components/utilities/utglobal.c b/source/components/utilities/utglobal.c
index f913e3222858..8bb2230f391c 100644
--- a/source/components/utilities/utglobal.c
+++ b/source/components/utilities/utglobal.c
@@ -211,8 +211,9 @@ ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] =
*
* RETURN: Status
*
- * DESCRIPTION: Init ACPICA globals. All globals that require specific
- * initialization should be initialized here!
+ * DESCRIPTION: Initialize ACPICA globals. All globals that require specific
+ * initialization should be initialized here. This allows for
+ * a warm restart.
*
******************************************************************************/
diff --git a/source/components/utilities/utmisc.c b/source/components/utilities/utmisc.c
index 72662b95dd01..a92121ffa733 100644
--- a/source/components/utilities/utmisc.c
+++ b/source/components/utilities/utmisc.c
@@ -92,86 +92,6 @@ UtConvertBackslashes (
/*******************************************************************************
*
- * FUNCTION: AcpiUtValidateException
- *
- * PARAMETERS: Status - The ACPI_STATUS code to be formatted
- *
- * RETURN: A string containing the exception text. NULL if exception is
- * not valid.
- *
- * DESCRIPTION: This function validates and translates an ACPI exception into
- * an ASCII string.
- *
- ******************************************************************************/
-
-const char *
-AcpiUtValidateException (
- ACPI_STATUS Status)
-{
- UINT32 SubStatus;
- const char *Exception = NULL;
-
-
- ACPI_FUNCTION_ENTRY ();
-
-
- /*
- * Status is composed of two parts, a "type" and an actual code
- */
- SubStatus = (Status & ~AE_CODE_MASK);
-
- switch (Status & AE_CODE_MASK)
- {
- case AE_CODE_ENVIRONMENTAL:
-
- if (SubStatus <= AE_CODE_ENV_MAX)
- {
- Exception = AcpiGbl_ExceptionNames_Env [SubStatus];
- }
- break;
-
- case AE_CODE_PROGRAMMER:
-
- if (SubStatus <= AE_CODE_PGM_MAX)
- {
- Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus];
- }
- break;
-
- case AE_CODE_ACPI_TABLES:
-
- if (SubStatus <= AE_CODE_TBL_MAX)
- {
- Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus];
- }
- break;
-
- case AE_CODE_AML:
-
- if (SubStatus <= AE_CODE_AML_MAX)
- {
- Exception = AcpiGbl_ExceptionNames_Aml [SubStatus];
- }
- break;
-
- case AE_CODE_CONTROL:
-
- if (SubStatus <= AE_CODE_CTRL_MAX)
- {
- Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus];
- }
- break;
-
- default:
- break;
- }
-
- return (ACPI_CAST_PTR (const char, Exception));
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiUtIsPciRootBridge
*
* PARAMETERS: Id - The HID/CID in string format
diff --git a/source/components/utilities/utobject.c b/source/components/utilities/utobject.c
index fea140946c2c..03fa9dc1cf0e 100644
--- a/source/components/utilities/utobject.c
+++ b/source/components/utilities/utobject.c
@@ -366,7 +366,7 @@ AcpiUtCreateStringObject (
*
* RETURN: TRUE if object is valid, FALSE otherwise
*
- * DESCRIPTION: Validate a pointer to be an ACPI_OPERAND_OBJECT
+ * DESCRIPTION: Validate a pointer to be of type ACPI_OPERAND_OBJECT
*
******************************************************************************/
@@ -392,7 +392,7 @@ AcpiUtValidInternalObject (
{
case ACPI_DESC_TYPE_OPERAND:
- /* The object appears to be a valid ACPI_OPERAND_OBJECT */
+ /* The object appears to be a valid ACPI_OPERAND_OBJECT */
return (TRUE);
@@ -473,7 +473,7 @@ AcpiUtDeleteObjectDesc (
ACPI_FUNCTION_TRACE_PTR (UtDeleteObjectDesc, Object);
- /* Object must be an ACPI_OPERAND_OBJECT */
+ /* Object must be of type ACPI_OPERAND_OBJECT */
if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND)
{
diff --git a/source/components/utilities/utresrc.c b/source/components/utilities/utresrc.c
index c2c135b7d233..9855af5708a3 100644
--- a/source/components/utilities/utresrc.c
+++ b/source/components/utilities/utresrc.c
@@ -1,6 +1,6 @@
/*******************************************************************************
*
- * Module Name: utresrc - Resource managment utilities
+ * Module Name: utresrc - Resource management utilities
*
******************************************************************************/
@@ -57,7 +57,7 @@
/*
* Strings used to decode resource descriptors.
- * Used by both the disasssembler and the debugger resource dump routines
+ * Used by both the disassembler and the debugger resource dump routines
*/
const char *AcpiGbl_BmDecode[] =
{
diff --git a/source/components/utilities/utxferror.c b/source/components/utilities/utxferror.c
index 8ffb27489497..715c0f47f0f4 100644
--- a/source/components/utilities/utxferror.c
+++ b/source/components/utilities/utxferror.c
@@ -87,6 +87,9 @@ extern FILE *AcpiGbl_OutputFile;
#define ACPI_MSG_WARNING "ACPI Warning: "
#define ACPI_MSG_INFO "ACPI: "
+#define ACPI_MSG_BIOS_ERROR "ACPI Firmware Error: "
+#define ACPI_MSG_BIOS_WARNING "ACPI Firmware Warning: "
+
/*
* Common message suffix
*/
@@ -252,6 +255,84 @@ AcpiInfo (
ACPI_EXPORT_SYMBOL (AcpiInfo)
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiBiosError
+ *
+ * PARAMETERS: ModuleName - Caller's module name (for error output)
+ * LineNumber - Caller's line number (for error output)
+ * Format - Printf format string + additional args
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Print "ACPI Firmware Error" message with module/line/version
+ * info
+ *
+ ******************************************************************************/
+
+void ACPI_INTERNAL_VAR_XFACE
+AcpiBiosError (
+ const char *ModuleName,
+ UINT32 LineNumber,
+ const char *Format,
+ ...)
+{
+ va_list ArgList;
+
+
+ ACPI_MSG_REDIRECT_BEGIN;
+ AcpiOsPrintf (ACPI_MSG_BIOS_ERROR);
+
+ va_start (ArgList, Format);
+ AcpiOsVprintf (Format, ArgList);
+ ACPI_MSG_SUFFIX;
+ va_end (ArgList);
+
+ ACPI_MSG_REDIRECT_END;
+}
+
+ACPI_EXPORT_SYMBOL (AcpiBiosError)
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiBiosWarning
+ *
+ * PARAMETERS: ModuleName - Caller's module name (for error output)
+ * LineNumber - Caller's line number (for error output)
+ * Format - Printf format string + additional args
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Print "ACPI Firmware Warning" message with module/line/version
+ * info
+ *
+ ******************************************************************************/
+
+void ACPI_INTERNAL_VAR_XFACE
+AcpiBiosWarning (
+ const char *ModuleName,
+ UINT32 LineNumber,
+ const char *Format,
+ ...)
+{
+ va_list ArgList;
+
+
+ ACPI_MSG_REDIRECT_BEGIN;
+ AcpiOsPrintf (ACPI_MSG_BIOS_WARNING);
+
+ va_start (ArgList, Format);
+ AcpiOsVprintf (Format, ArgList);
+ ACPI_MSG_SUFFIX;
+ va_end (ArgList);
+
+ ACPI_MSG_REDIRECT_END;
+}
+
+ACPI_EXPORT_SYMBOL (AcpiBiosWarning)
+
+
/*
* The remainder of this module contains internal error functions that may
* be configured out.