diff options
Diffstat (limited to 'sys/contrib/dev/acpica/utglobal.c')
-rw-r--r-- | sys/contrib/dev/acpica/utglobal.c | 151 |
1 files changed, 76 insertions, 75 deletions
diff --git a/sys/contrib/dev/acpica/utglobal.c b/sys/contrib/dev/acpica/utglobal.c index a9b8d0f..505f64f 100644 --- a/sys/contrib/dev/acpica/utglobal.c +++ b/sys/contrib/dev/acpica/utglobal.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utglobal - Global variables for the ACPI subsystem - * $Revision: 123 $ + * $Revision: 125 $ * *****************************************************************************/ @@ -128,6 +128,81 @@ MODULE_NAME ("utglobal") + +/****************************************************************************** + * + * FUNCTION: AcpiFormatException + * + * PARAMETERS: Status - The ACPI_STATUS code to be formatted + * + * RETURN: A string containing the exception text + * + * DESCRIPTION: This function translates an ACPI exception into an ASCII string. + * + ******************************************************************************/ + +const char * +AcpiFormatException ( + ACPI_STATUS Status) +{ + char *Exception = "UNKNOWN_STATUS_CODE"; + ACPI_STATUS SubStatus; + + + 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 -1]; + } + break; + + case AE_CODE_ACPI_TABLES: + + if (SubStatus <= AE_CODE_TBL_MAX) + { + Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus -1]; + } + break; + + case AE_CODE_AML: + + if (SubStatus <= AE_CODE_AML_MAX) + { + Exception = AcpiGbl_ExceptionNames_Aml [SubStatus -1]; + } + break; + + case AE_CODE_CONTROL: + + if (SubStatus <= AE_CODE_CTRL_MAX) + { + Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus -1]; + } + break; + + default: + break; + } + + + return ((const char *) Exception); +} + + /****************************************************************************** * * Static global variable initialization. @@ -523,80 +598,6 @@ AcpiUtValidObjectType ( } -/***************************************************************************** - * - * FUNCTION: AcpiUtFormatException - * - * PARAMETERS: Status - Acpi status to be formatted - * - * RETURN: Formatted status string - * - * DESCRIPTION: Convert an ACPI exception to a string - * - ****************************************************************************/ - -NATIVE_CHAR * -AcpiUtFormatException ( - ACPI_STATUS Status) -{ - NATIVE_CHAR *Exception = "UNKNOWN_STATUS"; - ACPI_STATUS SubStatus; - - - 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 -1]; - } - break; - - case AE_CODE_ACPI_TABLES: - - if (SubStatus <= AE_CODE_TBL_MAX) - { - Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus -1]; - } - break; - - case AE_CODE_AML: - - if (SubStatus <= AE_CODE_AML_MAX) - { - Exception = AcpiGbl_ExceptionNames_Aml [SubStatus -1]; - } - break; - - case AE_CODE_CONTROL: - - if (SubStatus <= AE_CODE_CTRL_MAX) - { - Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus -1]; - } - break; - - default: - break; - } - - - return (Exception); -} - - /**************************************************************************** * * FUNCTION: AcpiUtAllocateOwnerId |