utexcep.c revision 7b1019a6d29ccb7999dc76cba3dde1c627e8e609
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek/*******************************************************************************
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * Module Name: utexcep - Exception code support
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek ******************************************************************************/
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * Copyright (C) 2000 - 2016, Intel Corp.
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * All rights reserved.
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * Redistribution and use in source and binary forms, with or without
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * modification, are permitted provided that the following conditions
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * 1. Redistributions of source code must retain the above copyright
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * notice, this list of conditions, and the following disclaimer,
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * without modification.
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * 2. Redistributions in binary form must reproduce at minimum a disclaimer
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * substantially similar to the "NO WARRANTY" disclaimer below
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * ("Disclaimer") and any redistribution must be conditioned upon
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * including a substantially similar Disclaimer requirement for further
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * binary redistribution.
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * 3. Neither the names of the above-listed copyright holders nor the names
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * of any contributors may be used to endorse or promote products derived
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * from this software without specific prior written permission.
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * Alternatively, this software may be distributed under the terms of the
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * GNU General Public License ("GPL") version 2 as published by the Free
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * Software Foundation.
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * NO WARRANTY
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * POSSIBILITY OF SUCH DAMAGES.
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek/*******************************************************************************
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * FUNCTION: AcpiFormatException
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * PARAMETERS: Status - The ACPI_STATUS code to be formatted
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * RETURN: A string containing the exception text. A valid pointer is
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * always returned.
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * DESCRIPTION: This function translates an ACPI exception into an ASCII
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * string. Returns "unknown status" string for invalid codes.
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek ******************************************************************************/
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek /* Exception code was not recognized */
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek return ("UNKNOWN_STATUS_CODE");
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek/*******************************************************************************
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * FUNCTION: AcpiUtValidateException
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * PARAMETERS: Status - The ACPI_STATUS code to be formatted
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * RETURN: A string containing the exception text. NULL if exception is
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * DESCRIPTION: This function validates and translates an ACPI exception into
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * an ASCII string.
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek ******************************************************************************/
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek * Status is composed of two parts, a "type" and an actual code
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek Exception = &AcpiGbl_ExceptionNames_Env [SubStatus];
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek Exception = &AcpiGbl_ExceptionNames_Pgm [SubStatus];
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek Exception = &AcpiGbl_ExceptionNames_Tbl [SubStatus];
7b1019a6d29ccb7999dc76cba3dde1c627e8e609Jerry Jelinek Exception = &AcpiGbl_ExceptionNames_Aml [SubStatus];