/drivers/devman/acpica/utilities/utalloc.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
/drivers/devman/acpica/utilities/utcache.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
/drivers/devman/acpica/utilities/utclib.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
/drivers/devman/acpica/utilities/utcopy.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
/drivers/devman/acpica/utilities/utdebug.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
279,9 → 279,8 |
if (ACPI_LV_THREADS & AcpiDbgLevel) |
{ |
AcpiOsPrintf ( |
"\n**** Context Switch from TID %p to TID %p ****\n\n", |
ACPI_CAST_PTR (void, AcpiGbl_PrevThreadId), |
ACPI_CAST_PTR (void, ThreadId)); |
"\n**** Context Switch from TID %u to TID %u ****\n\n", |
(UINT32) AcpiGbl_PrevThreadId, (UINT32) ThreadId); |
} |
AcpiGbl_PrevThreadId = ThreadId; |
295,7 → 294,7 |
if (ACPI_LV_THREADS & AcpiDbgLevel) |
{ |
AcpiOsPrintf ("[%p] ", ACPI_CAST_PTR (void, ThreadId)); |
AcpiOsPrintf ("[%u] ", (UINT32) ThreadId); |
} |
AcpiOsPrintf ("[%02ld] %-22.22s: ", |
/drivers/devman/acpica/utilities/utdecode.c |
---|
0,0 → 1,702 |
/****************************************************************************** |
* |
* Module Name: utdecode - Utility decoding routines (value-to-string) |
* |
*****************************************************************************/ |
/****************************************************************************** |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
* |
* 2.1. This is your license from Intel Corp. under its intellectual property |
* rights. You may have additional license terms from the party that provided |
* you this software, covering your right to use that party's intellectual |
* property rights. |
* |
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a |
* copy of the source code appearing in this file ("Covered Code") an |
* irrevocable, perpetual, worldwide license under Intel's copyrights in the |
* base code distributed originally by Intel ("Original Intel Code") to copy, |
* make derivatives, distribute, use and display any portion of the Covered |
* Code in any form, with the right to sublicense such rights; and |
* |
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent |
* license (with the right to sublicense), under only those claims of Intel |
* patents that are infringed by the Original Intel Code, to make, use, sell, |
* offer to sell, and import the Covered Code and derivative works thereof |
* solely to the minimum extent necessary to exercise the above copyright |
* license, and in no event shall the patent license extend to any additions |
* to or modifications of the Original Intel Code. No other license or right |
* is granted directly or by implication, estoppel or otherwise; |
* |
* The above copyright and patent license is granted only if the following |
* conditions are met: |
* |
* 3. Conditions |
* |
* 3.1. Redistribution of Source with Rights to Further Distribute Source. |
* Redistribution of source code of any substantial portion of the Covered |
* Code or modification with rights to further distribute source must include |
* the above Copyright Notice, the above License, this list of Conditions, |
* and the following Disclaimer and Export Compliance provision. In addition, |
* Licensee must cause all Covered Code to which Licensee contributes to |
* contain a file documenting the changes Licensee made to create that Covered |
* Code and the date of any change. Licensee must include in that file the |
* documentation of any changes made by any predecessor Licensee. Licensee |
* must include a prominent statement that the modification is derived, |
* directly or indirectly, from Original Intel Code. |
* |
* 3.2. Redistribution of Source with no Rights to Further Distribute Source. |
* Redistribution of source code of any substantial portion of the Covered |
* Code or modification without rights to further distribute source must |
* include the following Disclaimer and Export Compliance provision in the |
* documentation and/or other materials provided with distribution. In |
* addition, Licensee may not authorize further sublicense of source of any |
* portion of the Covered Code, and must include terms to the effect that the |
* license from Licensee to its licensee is limited to the intellectual |
* property embodied in the software Licensee provides to its licensee, and |
* not to intellectual property embodied in modifications its licensee may |
* make. |
* |
* 3.3. Redistribution of Executable. Redistribution in executable form of any |
* substantial portion of the Covered Code or modification must reproduce the |
* above Copyright Notice, and the following Disclaimer and Export Compliance |
* provision in the documentation and/or other materials provided with the |
* distribution. |
* |
* 3.4. Intel retains all right, title, and interest in and to the Original |
* Intel Code. |
* |
* 3.5. Neither the name Intel nor any other trademark owned or controlled by |
* Intel shall be used in advertising or otherwise to promote the sale, use or |
* other dealings in products derived from or relating to the Covered Code |
* without prior written authorization from Intel. |
* |
* 4. Disclaimer and Export Compliance |
* |
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED |
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE |
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, |
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY |
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY |
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A |
* PARTICULAR PURPOSE. |
* |
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES |
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR |
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, |
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY |
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL |
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS |
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY |
* LIMITED REMEDY. |
* |
* 4.3. Licensee shall not export, either directly or indirectly, any of this |
* software or system incorporating such software without first obtaining any |
* required license or other approval from the U. S. Department of Commerce or |
* any other agency or department of the United States Government. In the |
* event Licensee exports any such software from the United States or |
* re-exports any such software from a foreign destination, Licensee shall |
* ensure that the distribution and export/re-export of the software is in |
* compliance with all laws, regulations, orders, or other restrictions of the |
* U.S. Export Administration Regulations. Licensee agrees that neither it nor |
* any of its subsidiaries will export/re-export any technical data, process, |
* software, or service, directly or indirectly, to any country for which the |
* United States government or any agency thereof requires an export license, |
* other governmental approval, or letter of assurance, without first obtaining |
* such license, approval or letter. |
* |
*****************************************************************************/ |
#define __UTDECODE_C__ |
#include "acpi.h" |
#include "accommon.h" |
#include "acnamesp.h" |
#define _COMPONENT ACPI_UTILITIES |
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 |
*/ |
const UINT8 AcpiGbl_NsProperties[ACPI_NUM_NS_TYPES] = |
{ |
ACPI_NS_NORMAL, /* 00 Any */ |
ACPI_NS_NORMAL, /* 01 Number */ |
ACPI_NS_NORMAL, /* 02 String */ |
ACPI_NS_NORMAL, /* 03 Buffer */ |
ACPI_NS_NORMAL, /* 04 Package */ |
ACPI_NS_NORMAL, /* 05 FieldUnit */ |
ACPI_NS_NEWSCOPE, /* 06 Device */ |
ACPI_NS_NORMAL, /* 07 Event */ |
ACPI_NS_NEWSCOPE, /* 08 Method */ |
ACPI_NS_NORMAL, /* 09 Mutex */ |
ACPI_NS_NORMAL, /* 10 Region */ |
ACPI_NS_NEWSCOPE, /* 11 Power */ |
ACPI_NS_NEWSCOPE, /* 12 Processor */ |
ACPI_NS_NEWSCOPE, /* 13 Thermal */ |
ACPI_NS_NORMAL, /* 14 BufferField */ |
ACPI_NS_NORMAL, /* 15 DdbHandle */ |
ACPI_NS_NORMAL, /* 16 Debug Object */ |
ACPI_NS_NORMAL, /* 17 DefField */ |
ACPI_NS_NORMAL, /* 18 BankField */ |
ACPI_NS_NORMAL, /* 19 IndexField */ |
ACPI_NS_NORMAL, /* 20 Reference */ |
ACPI_NS_NORMAL, /* 21 Alias */ |
ACPI_NS_NORMAL, /* 22 MethodAlias */ |
ACPI_NS_NORMAL, /* 23 Notify */ |
ACPI_NS_NORMAL, /* 24 Address Handler */ |
ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 25 Resource Desc */ |
ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 26 Resource Field */ |
ACPI_NS_NEWSCOPE, /* 27 Scope */ |
ACPI_NS_NORMAL, /* 28 Extra */ |
ACPI_NS_NORMAL, /* 29 Data */ |
ACPI_NS_NORMAL /* 30 Invalid */ |
}; |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtHexToAsciiChar |
* |
* PARAMETERS: Integer - Contains the hex digit |
* Position - bit position of the digit within the |
* integer (multiple of 4) |
* |
* RETURN: The converted Ascii character |
* |
* DESCRIPTION: Convert a hex digit to an Ascii character |
* |
******************************************************************************/ |
/* Hex to ASCII conversion table */ |
static const char AcpiGbl_HexToAscii[] = |
{ |
'0','1','2','3','4','5','6','7', |
'8','9','A','B','C','D','E','F' |
}; |
char |
AcpiUtHexToAsciiChar ( |
UINT64 Integer, |
UINT32 Position) |
{ |
return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetRegionName |
* |
* PARAMETERS: Space ID - ID for the region |
* |
* RETURN: Decoded region SpaceId name |
* |
* DESCRIPTION: Translate a Space ID into a name string (Debug only) |
* |
******************************************************************************/ |
/* Region type decoding */ |
const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] = |
{ |
"SystemMemory", |
"SystemIO", |
"PCI_Config", |
"EmbeddedControl", |
"SMBus", |
"SystemCMOS", |
"PCIBARTarget", |
"IPMI" |
}; |
char * |
AcpiUtGetRegionName ( |
UINT8 SpaceId) |
{ |
if (SpaceId >= ACPI_USER_REGION_BEGIN) |
{ |
return ("UserDefinedRegion"); |
} |
else if (SpaceId == ACPI_ADR_SPACE_DATA_TABLE) |
{ |
return ("DataTable"); |
} |
else if (SpaceId == ACPI_ADR_SPACE_FIXED_HARDWARE) |
{ |
return ("FunctionalFixedHW"); |
} |
else if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS) |
{ |
return ("InvalidSpaceId"); |
} |
return (ACPI_CAST_PTR (char, AcpiGbl_RegionTypes[SpaceId])); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetEventName |
* |
* PARAMETERS: EventId - Fixed event ID |
* |
* RETURN: Decoded event ID name |
* |
* DESCRIPTION: Translate a Event ID into a name string (Debug only) |
* |
******************************************************************************/ |
/* Event type decoding */ |
static const char *AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS] = |
{ |
"PM_Timer", |
"GlobalLock", |
"PowerButton", |
"SleepButton", |
"RealTimeClock", |
}; |
char * |
AcpiUtGetEventName ( |
UINT32 EventId) |
{ |
if (EventId > ACPI_EVENT_MAX) |
{ |
return ("InvalidEventID"); |
} |
return (ACPI_CAST_PTR (char, AcpiGbl_EventTypes[EventId])); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetTypeName |
* |
* PARAMETERS: Type - An ACPI object type |
* |
* RETURN: Decoded ACPI object type name |
* |
* DESCRIPTION: Translate a Type ID into a name string (Debug only) |
* |
******************************************************************************/ |
/* |
* Elements of AcpiGbl_NsTypeNames below must match |
* one-to-one with values of ACPI_OBJECT_TYPE |
* |
* The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; |
* when stored in a table it really means that we have thus far seen no |
* evidence to indicate what type is actually going to be stored for this entry. |
*/ |
static const char AcpiGbl_BadType[] = "UNDEFINED"; |
/* Printable names of the ACPI object types */ |
static const char *AcpiGbl_NsTypeNames[] = |
{ |
/* 00 */ "Untyped", |
/* 01 */ "Integer", |
/* 02 */ "String", |
/* 03 */ "Buffer", |
/* 04 */ "Package", |
/* 05 */ "FieldUnit", |
/* 06 */ "Device", |
/* 07 */ "Event", |
/* 08 */ "Method", |
/* 09 */ "Mutex", |
/* 10 */ "Region", |
/* 11 */ "Power", |
/* 12 */ "Processor", |
/* 13 */ "Thermal", |
/* 14 */ "BufferField", |
/* 15 */ "DdbHandle", |
/* 16 */ "DebugObject", |
/* 17 */ "RegionField", |
/* 18 */ "BankField", |
/* 19 */ "IndexField", |
/* 20 */ "Reference", |
/* 21 */ "Alias", |
/* 22 */ "MethodAlias", |
/* 23 */ "Notify", |
/* 24 */ "AddrHandler", |
/* 25 */ "ResourceDesc", |
/* 26 */ "ResourceFld", |
/* 27 */ "Scope", |
/* 28 */ "Extra", |
/* 29 */ "Data", |
/* 30 */ "Invalid" |
}; |
char * |
AcpiUtGetTypeName ( |
ACPI_OBJECT_TYPE Type) |
{ |
if (Type > ACPI_TYPE_INVALID) |
{ |
return (ACPI_CAST_PTR (char, AcpiGbl_BadType)); |
} |
return (ACPI_CAST_PTR (char, AcpiGbl_NsTypeNames[Type])); |
} |
char * |
AcpiUtGetObjectTypeName ( |
ACPI_OPERAND_OBJECT *ObjDesc) |
{ |
if (!ObjDesc) |
{ |
return ("[NULL Object Descriptor]"); |
} |
return (AcpiUtGetTypeName (ObjDesc->Common.Type)); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetNodeName |
* |
* PARAMETERS: Object - A namespace node |
* |
* RETURN: ASCII name of the node |
* |
* DESCRIPTION: Validate the node and return the node's ACPI name. |
* |
******************************************************************************/ |
char * |
AcpiUtGetNodeName ( |
void *Object) |
{ |
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) Object; |
/* Must return a string of exactly 4 characters == ACPI_NAME_SIZE */ |
if (!Object) |
{ |
return ("NULL"); |
} |
/* Check for Root node */ |
if ((Object == ACPI_ROOT_OBJECT) || |
(Object == AcpiGbl_RootNode)) |
{ |
return ("\"\\\" "); |
} |
/* Descriptor must be a namespace node */ |
if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED) |
{ |
return ("####"); |
} |
/* |
* Ensure name is valid. The name was validated/repaired when the node |
* was created, but make sure it has not been corrupted. |
*/ |
AcpiUtRepairName (Node->Name.Ascii); |
/* Return the name */ |
return (Node->Name.Ascii); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetDescriptorName |
* |
* PARAMETERS: Object - An ACPI object |
* |
* RETURN: Decoded name of the descriptor type |
* |
* DESCRIPTION: Validate object and return the descriptor type |
* |
******************************************************************************/ |
/* Printable names of object descriptor types */ |
static const char *AcpiGbl_DescTypeNames[] = |
{ |
/* 00 */ "Not a Descriptor", |
/* 01 */ "Cached", |
/* 02 */ "State-Generic", |
/* 03 */ "State-Update", |
/* 04 */ "State-Package", |
/* 05 */ "State-Control", |
/* 06 */ "State-RootParseScope", |
/* 07 */ "State-ParseScope", |
/* 08 */ "State-WalkScope", |
/* 09 */ "State-Result", |
/* 10 */ "State-Notify", |
/* 11 */ "State-Thread", |
/* 12 */ "Walk", |
/* 13 */ "Parser", |
/* 14 */ "Operand", |
/* 15 */ "Node" |
}; |
char * |
AcpiUtGetDescriptorName ( |
void *Object) |
{ |
if (!Object) |
{ |
return ("NULL OBJECT"); |
} |
if (ACPI_GET_DESCRIPTOR_TYPE (Object) > ACPI_DESC_TYPE_MAX) |
{ |
return ("Not a Descriptor"); |
} |
return (ACPI_CAST_PTR (char, |
AcpiGbl_DescTypeNames[ACPI_GET_DESCRIPTOR_TYPE (Object)])); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetReferenceName |
* |
* PARAMETERS: Object - An ACPI reference object |
* |
* RETURN: Decoded name of the type of reference |
* |
* DESCRIPTION: Decode a reference object sub-type to a string. |
* |
******************************************************************************/ |
/* Printable names of reference object sub-types */ |
static const char *AcpiGbl_RefClassNames[] = |
{ |
/* 00 */ "Local", |
/* 01 */ "Argument", |
/* 02 */ "RefOf", |
/* 03 */ "Index", |
/* 04 */ "DdbHandle", |
/* 05 */ "Named Object", |
/* 06 */ "Debug" |
}; |
const char * |
AcpiUtGetReferenceName ( |
ACPI_OPERAND_OBJECT *Object) |
{ |
if (!Object) |
{ |
return ("NULL Object"); |
} |
if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND) |
{ |
return ("Not an Operand object"); |
} |
if (Object->Common.Type != ACPI_TYPE_LOCAL_REFERENCE) |
{ |
return ("Not a Reference object"); |
} |
if (Object->Reference.Class > ACPI_REFCLASS_MAX) |
{ |
return ("Unknown Reference class"); |
} |
return (AcpiGbl_RefClassNames[Object->Reference.Class]); |
} |
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) |
/* |
* Strings and procedures used for debug only |
*/ |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetMutexName |
* |
* PARAMETERS: MutexId - The predefined ID for this mutex. |
* |
* RETURN: Decoded name of the internal mutex |
* |
* DESCRIPTION: Translate a mutex ID into a name string (Debug only) |
* |
******************************************************************************/ |
/* Names for internal mutex objects, used for debug output */ |
static char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] = |
{ |
"ACPI_MTX_Interpreter", |
"ACPI_MTX_Namespace", |
"ACPI_MTX_Tables", |
"ACPI_MTX_Events", |
"ACPI_MTX_Caches", |
"ACPI_MTX_Memory", |
"ACPI_MTX_CommandComplete", |
"ACPI_MTX_CommandReady" |
}; |
char * |
AcpiUtGetMutexName ( |
UINT32 MutexId) |
{ |
if (MutexId > ACPI_MAX_MUTEX) |
{ |
return ("Invalid Mutex ID"); |
} |
return (AcpiGbl_MutexNames[MutexId]); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetNotifyName |
* |
* PARAMETERS: NotifyValue - Value from the Notify() request |
* |
* RETURN: Decoded name for the notify value |
* |
* DESCRIPTION: Translate a Notify Value to a notify namestring. |
* |
******************************************************************************/ |
/* Names for Notify() values, used for debug output */ |
static const char *AcpiGbl_NotifyValueNames[] = |
{ |
"Bus Check", |
"Device Check", |
"Device Wake", |
"Eject Request", |
"Device Check Light", |
"Frequency Mismatch", |
"Bus Mode Mismatch", |
"Power Fault", |
"Capabilities Check", |
"Device PLD Check", |
"Reserved", |
"System Locality Update" |
}; |
const char * |
AcpiUtGetNotifyName ( |
UINT32 NotifyValue) |
{ |
if (NotifyValue <= ACPI_NOTIFY_MAX) |
{ |
return (AcpiGbl_NotifyValueNames[NotifyValue]); |
} |
else if (NotifyValue <= ACPI_MAX_SYS_NOTIFY) |
{ |
return ("Reserved"); |
} |
else /* Greater or equal to 0x80 */ |
{ |
return ("**Device Specific**"); |
} |
} |
#endif |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtValidObjectType |
* |
* PARAMETERS: Type - Object type to be validated |
* |
* RETURN: TRUE if valid object type, FALSE otherwise |
* |
* DESCRIPTION: Validate an object type |
* |
******************************************************************************/ |
BOOLEAN |
AcpiUtValidObjectType ( |
ACPI_OBJECT_TYPE Type) |
{ |
if (Type > ACPI_TYPE_LOCAL_MAX) |
{ |
/* Note: Assumes all TYPEs are contiguous (external/local) */ |
return (FALSE); |
} |
return (TRUE); |
} |
/drivers/devman/acpica/utilities/utdelete.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
/drivers/devman/acpica/utilities/uteval.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
124,141 → 124,8 |
ACPI_MODULE_NAME ("uteval") |
/* |
* Strings supported by the _OSI predefined (internal) method. |
* |
* March 2009: Removed "Linux" as this host no longer wants to respond true |
* for this string. Basically, the only safe OS strings are windows-related |
* and in many or most cases represent the only test path within the |
* BIOS-provided ASL code. |
* |
* The second element of each entry is used to track the newest version of |
* Windows that the BIOS has requested. |
*/ |
static const ACPI_INTERFACE_INFO AcpiInterfacesSupported[] = |
{ |
/* Operating System Vendor Strings */ |
{"Windows 2000", ACPI_OSI_WIN_2000}, /* Windows 2000 */ |
{"Windows 2001", ACPI_OSI_WIN_XP}, /* Windows XP */ |
{"Windows 2001 SP1", ACPI_OSI_WIN_XP_SP1}, /* Windows XP SP1 */ |
{"Windows 2001.1", ACPI_OSI_WINSRV_2003}, /* Windows Server 2003 */ |
{"Windows 2001 SP2", ACPI_OSI_WIN_XP_SP2}, /* Windows XP SP2 */ |
{"Windows 2001.1 SP1", ACPI_OSI_WINSRV_2003_SP1}, /* Windows Server 2003 SP1 - Added 03/2006 */ |
{"Windows 2006", ACPI_OSI_WIN_VISTA}, /* Windows Vista - Added 03/2006 */ |
{"Windows 2006.1", ACPI_OSI_WINSRV_2008}, /* Windows Server 2008 - Added 09/2009 */ |
{"Windows 2006 SP1", ACPI_OSI_WIN_VISTA_SP1}, /* Windows Vista SP1 - Added 09/2009 */ |
{"Windows 2009", ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */ |
/* Feature Group Strings */ |
{"Extended Address Space Descriptor", 0} |
/* |
* All "optional" feature group strings (features that are implemented |
* by the host) should be implemented in the host version of |
* AcpiOsValidateInterface and should not be added here. |
*/ |
}; |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtOsiImplementation |
* |
* PARAMETERS: WalkState - Current walk state |
* |
* RETURN: Status |
* |
* DESCRIPTION: Implementation of the _OSI predefined control method |
* |
******************************************************************************/ |
ACPI_STATUS |
AcpiUtOsiImplementation ( |
ACPI_WALK_STATE *WalkState) |
{ |
ACPI_STATUS Status; |
ACPI_OPERAND_OBJECT *StringDesc; |
ACPI_OPERAND_OBJECT *ReturnDesc; |
UINT32 ReturnValue; |
UINT32 i; |
ACPI_FUNCTION_TRACE (UtOsiImplementation); |
/* Validate the string input argument */ |
StringDesc = WalkState->Arguments[0].Object; |
if (!StringDesc || (StringDesc->Common.Type != ACPI_TYPE_STRING)) |
{ |
return_ACPI_STATUS (AE_TYPE); |
} |
/* Create a return object */ |
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); |
if (!ReturnDesc) |
{ |
return_ACPI_STATUS (AE_NO_MEMORY); |
} |
/* Default return value is 0, NOT SUPPORTED */ |
ReturnValue = 0; |
/* Compare input string to static table of supported interfaces */ |
for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiInterfacesSupported); i++) |
{ |
if (!ACPI_STRCMP (StringDesc->String.Pointer, |
AcpiInterfacesSupported[i].Name)) |
{ |
/* |
* The interface is supported. |
* Update the OsiData if necessary. We keep track of the latest |
* version of Windows that has been requested by the BIOS. |
*/ |
if (AcpiInterfacesSupported[i].Value > AcpiGbl_OsiData) |
{ |
AcpiGbl_OsiData = AcpiInterfacesSupported[i].Value; |
} |
ReturnValue = ACPI_UINT32_MAX; |
goto Exit; |
} |
} |
/* |
* Did not match the string in the static table, call the host OSL to |
* check for a match with one of the optional strings (such as |
* "Module Device", "3.0 Thermal Model", etc.) |
*/ |
Status = AcpiOsValidateInterface (StringDesc->String.Pointer); |
if (ACPI_SUCCESS (Status)) |
{ |
/* The interface is supported */ |
ReturnValue = ACPI_UINT32_MAX; |
} |
Exit: |
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, |
"ACPI: BIOS _OSI(%s) is %ssupported\n", |
StringDesc->String.Pointer, ReturnValue == 0 ? "not " : "")); |
/* Complete the return value */ |
ReturnDesc->Integer.Value = ReturnValue; |
WalkState->ReturnDesc = ReturnDesc; |
return_ACPI_STATUS (AE_OK); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtEvaluateObject |
* |
* PARAMETERS: PrefixNode - Starting node |
/drivers/devman/acpica/utilities/utglobal.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
118,7 → 118,6 |
#include "acpi.h" |
#include "accommon.h" |
#include "acnamesp.h" |
#define _COMPONENT ACPI_UTILITIES |
ACPI_MODULE_NAME ("utglobal") |
192,47 → 191,6 |
/******************************************************************************* |
* |
* 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) |
/******************************************************************************* |
* |
* Namespace globals |
* |
******************************************************************************/ |
244,7 → 202,9 |
* 1) _SB_ is defined to be a device to allow \_SB_._INI to be run |
* during the initialization sequence. |
* 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to |
* perform a Notify() operation on it. |
* perform a Notify() operation on it. 09/2010: Changed to type Device. |
* This still allows notifies, but does not confuse host code that |
* searches for valid ThermalZone objects. |
*/ |
const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] = |
{ |
252,7 → 212,7 |
{"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL}, |
{"_SB_", ACPI_TYPE_DEVICE, NULL}, |
{"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL}, |
{"_TZ_", ACPI_TYPE_THERMAL, NULL}, |
{"_TZ_", ACPI_TYPE_DEVICE, NULL}, |
{"_REV", ACPI_TYPE_INTEGER, (char *) ACPI_CA_SUPPORT_LEVEL}, |
{"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, |
{"_GL_", ACPI_TYPE_MUTEX, (char *) 1}, |
266,79 → 226,7 |
{NULL, ACPI_TYPE_ANY, NULL} |
}; |
/* |
* Properties of the ACPI Object Types, both internal and external. |
* The table is indexed by values of ACPI_OBJECT_TYPE |
*/ |
const UINT8 AcpiGbl_NsProperties[ACPI_NUM_NS_TYPES] = |
{ |
ACPI_NS_NORMAL, /* 00 Any */ |
ACPI_NS_NORMAL, /* 01 Number */ |
ACPI_NS_NORMAL, /* 02 String */ |
ACPI_NS_NORMAL, /* 03 Buffer */ |
ACPI_NS_NORMAL, /* 04 Package */ |
ACPI_NS_NORMAL, /* 05 FieldUnit */ |
ACPI_NS_NEWSCOPE, /* 06 Device */ |
ACPI_NS_NORMAL, /* 07 Event */ |
ACPI_NS_NEWSCOPE, /* 08 Method */ |
ACPI_NS_NORMAL, /* 09 Mutex */ |
ACPI_NS_NORMAL, /* 10 Region */ |
ACPI_NS_NEWSCOPE, /* 11 Power */ |
ACPI_NS_NEWSCOPE, /* 12 Processor */ |
ACPI_NS_NEWSCOPE, /* 13 Thermal */ |
ACPI_NS_NORMAL, /* 14 BufferField */ |
ACPI_NS_NORMAL, /* 15 DdbHandle */ |
ACPI_NS_NORMAL, /* 16 Debug Object */ |
ACPI_NS_NORMAL, /* 17 DefField */ |
ACPI_NS_NORMAL, /* 18 BankField */ |
ACPI_NS_NORMAL, /* 19 IndexField */ |
ACPI_NS_NORMAL, /* 20 Reference */ |
ACPI_NS_NORMAL, /* 21 Alias */ |
ACPI_NS_NORMAL, /* 22 MethodAlias */ |
ACPI_NS_NORMAL, /* 23 Notify */ |
ACPI_NS_NORMAL, /* 24 Address Handler */ |
ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 25 Resource Desc */ |
ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 26 Resource Field */ |
ACPI_NS_NEWSCOPE, /* 27 Scope */ |
ACPI_NS_NORMAL, /* 28 Extra */ |
ACPI_NS_NORMAL, /* 29 Data */ |
ACPI_NS_NORMAL /* 30 Invalid */ |
}; |
/* Hex to ASCII conversion table */ |
static const char AcpiGbl_HexToAscii[] = |
{ |
'0','1','2','3','4','5','6','7', |
'8','9','A','B','C','D','E','F' |
}; |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtHexToAsciiChar |
* |
* PARAMETERS: Integer - Contains the hex digit |
* Position - bit position of the digit within the |
* integer (multiple of 4) |
* |
* RETURN: The converted Ascii character |
* |
* DESCRIPTION: Convert a hex digit to an Ascii character |
* |
******************************************************************************/ |
char |
AcpiUtHexToAsciiChar ( |
UINT64 Integer, |
UINT32 Position) |
{ |
return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]); |
} |
/****************************************************************************** |
* |
* Event and Hardware globals |
384,454 → 272,9 |
/* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE}, |
}; |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetRegionName |
* |
* PARAMETERS: None. |
* |
* RETURN: Status |
* |
* DESCRIPTION: Translate a Space ID into a name string (Debug only) |
* |
******************************************************************************/ |
/* Region type decoding */ |
const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] = |
{ |
"SystemMemory", |
"SystemIO", |
"PCI_Config", |
"EmbeddedControl", |
"SMBus", |
"SystemCMOS", |
"PCIBARTarget", |
"IPMI", |
"DataTable" |
}; |
char * |
AcpiUtGetRegionName ( |
UINT8 SpaceId) |
{ |
if (SpaceId >= ACPI_USER_REGION_BEGIN) |
{ |
return ("UserDefinedRegion"); |
} |
else if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS) |
{ |
return ("InvalidSpaceId"); |
} |
return (ACPI_CAST_PTR (char, AcpiGbl_RegionTypes[SpaceId])); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetEventName |
* |
* PARAMETERS: None. |
* |
* RETURN: Status |
* |
* DESCRIPTION: Translate a Event ID into a name string (Debug only) |
* |
******************************************************************************/ |
/* Event type decoding */ |
static const char *AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS] = |
{ |
"PM_Timer", |
"GlobalLock", |
"PowerButton", |
"SleepButton", |
"RealTimeClock", |
}; |
char * |
AcpiUtGetEventName ( |
UINT32 EventId) |
{ |
if (EventId > ACPI_EVENT_MAX) |
{ |
return ("InvalidEventID"); |
} |
return (ACPI_CAST_PTR (char, AcpiGbl_EventTypes[EventId])); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetTypeName |
* |
* PARAMETERS: None. |
* |
* RETURN: Status |
* |
* DESCRIPTION: Translate a Type ID into a name string (Debug only) |
* |
******************************************************************************/ |
/* |
* Elements of AcpiGbl_NsTypeNames below must match |
* one-to-one with values of ACPI_OBJECT_TYPE |
* |
* The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; |
* when stored in a table it really means that we have thus far seen no |
* evidence to indicate what type is actually going to be stored for this entry. |
*/ |
static const char AcpiGbl_BadType[] = "UNDEFINED"; |
/* Printable names of the ACPI object types */ |
static const char *AcpiGbl_NsTypeNames[] = |
{ |
/* 00 */ "Untyped", |
/* 01 */ "Integer", |
/* 02 */ "String", |
/* 03 */ "Buffer", |
/* 04 */ "Package", |
/* 05 */ "FieldUnit", |
/* 06 */ "Device", |
/* 07 */ "Event", |
/* 08 */ "Method", |
/* 09 */ "Mutex", |
/* 10 */ "Region", |
/* 11 */ "Power", |
/* 12 */ "Processor", |
/* 13 */ "Thermal", |
/* 14 */ "BufferField", |
/* 15 */ "DdbHandle", |
/* 16 */ "DebugObject", |
/* 17 */ "RegionField", |
/* 18 */ "BankField", |
/* 19 */ "IndexField", |
/* 20 */ "Reference", |
/* 21 */ "Alias", |
/* 22 */ "MethodAlias", |
/* 23 */ "Notify", |
/* 24 */ "AddrHandler", |
/* 25 */ "ResourceDesc", |
/* 26 */ "ResourceFld", |
/* 27 */ "Scope", |
/* 28 */ "Extra", |
/* 29 */ "Data", |
/* 30 */ "Invalid" |
}; |
char * |
AcpiUtGetTypeName ( |
ACPI_OBJECT_TYPE Type) |
{ |
if (Type > ACPI_TYPE_INVALID) |
{ |
return (ACPI_CAST_PTR (char, AcpiGbl_BadType)); |
} |
return (ACPI_CAST_PTR (char, AcpiGbl_NsTypeNames[Type])); |
} |
char * |
AcpiUtGetObjectTypeName ( |
ACPI_OPERAND_OBJECT *ObjDesc) |
{ |
if (!ObjDesc) |
{ |
return ("[NULL Object Descriptor]"); |
} |
return (AcpiUtGetTypeName (ObjDesc->Common.Type)); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetNodeName |
* |
* PARAMETERS: Object - A namespace node |
* |
* RETURN: Pointer to a string |
* |
* DESCRIPTION: Validate the node and return the node's ACPI name. |
* |
******************************************************************************/ |
char * |
AcpiUtGetNodeName ( |
void *Object) |
{ |
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) Object; |
/* Must return a string of exactly 4 characters == ACPI_NAME_SIZE */ |
if (!Object) |
{ |
return ("NULL"); |
} |
/* Check for Root node */ |
if ((Object == ACPI_ROOT_OBJECT) || |
(Object == AcpiGbl_RootNode)) |
{ |
return ("\"\\\" "); |
} |
/* Descriptor must be a namespace node */ |
if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED) |
{ |
return ("####"); |
} |
/* |
* Ensure name is valid. The name was validated/repaired when the node |
* was created, but make sure it has not been corrupted. |
*/ |
AcpiUtRepairName (Node->Name.Ascii); |
/* Return the name */ |
return (Node->Name.Ascii); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetDescriptorName |
* |
* PARAMETERS: Object - An ACPI object |
* |
* RETURN: Pointer to a string |
* |
* DESCRIPTION: Validate object and return the descriptor type |
* |
******************************************************************************/ |
/* Printable names of object descriptor types */ |
static const char *AcpiGbl_DescTypeNames[] = |
{ |
/* 00 */ "Not a Descriptor", |
/* 01 */ "Cached", |
/* 02 */ "State-Generic", |
/* 03 */ "State-Update", |
/* 04 */ "State-Package", |
/* 05 */ "State-Control", |
/* 06 */ "State-RootParseScope", |
/* 07 */ "State-ParseScope", |
/* 08 */ "State-WalkScope", |
/* 09 */ "State-Result", |
/* 10 */ "State-Notify", |
/* 11 */ "State-Thread", |
/* 12 */ "Walk", |
/* 13 */ "Parser", |
/* 14 */ "Operand", |
/* 15 */ "Node" |
}; |
char * |
AcpiUtGetDescriptorName ( |
void *Object) |
{ |
if (!Object) |
{ |
return ("NULL OBJECT"); |
} |
if (ACPI_GET_DESCRIPTOR_TYPE (Object) > ACPI_DESC_TYPE_MAX) |
{ |
return ("Not a Descriptor"); |
} |
return (ACPI_CAST_PTR (char, |
AcpiGbl_DescTypeNames[ACPI_GET_DESCRIPTOR_TYPE (Object)])); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetReferenceName |
* |
* PARAMETERS: Object - An ACPI reference object |
* |
* RETURN: Pointer to a string |
* |
* DESCRIPTION: Decode a reference object sub-type to a string. |
* |
******************************************************************************/ |
/* Printable names of reference object sub-types */ |
static const char *AcpiGbl_RefClassNames[] = |
{ |
/* 00 */ "Local", |
/* 01 */ "Argument", |
/* 02 */ "RefOf", |
/* 03 */ "Index", |
/* 04 */ "DdbHandle", |
/* 05 */ "Named Object", |
/* 06 */ "Debug" |
}; |
const char * |
AcpiUtGetReferenceName ( |
ACPI_OPERAND_OBJECT *Object) |
{ |
if (!Object) |
{ |
return ("NULL Object"); |
} |
if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND) |
{ |
return ("Not an Operand object"); |
} |
if (Object->Common.Type != ACPI_TYPE_LOCAL_REFERENCE) |
{ |
return ("Not a Reference object"); |
} |
if (Object->Reference.Class > ACPI_REFCLASS_MAX) |
{ |
return ("Unknown Reference class"); |
} |
return (AcpiGbl_RefClassNames[Object->Reference.Class]); |
} |
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) |
/* |
* Strings and procedures used for debug only |
*/ |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetMutexName |
* |
* PARAMETERS: MutexId - The predefined ID for this mutex. |
* |
* RETURN: String containing the name of the mutex. Always returns a valid |
* pointer. |
* |
* DESCRIPTION: Translate a mutex ID into a name string (Debug only) |
* |
******************************************************************************/ |
char * |
AcpiUtGetMutexName ( |
UINT32 MutexId) |
{ |
if (MutexId > ACPI_MAX_MUTEX) |
{ |
return ("Invalid Mutex ID"); |
} |
return (AcpiGbl_MutexNames[MutexId]); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetNotifyName |
* |
* PARAMETERS: NotifyValue - Value from the Notify() request |
* |
* RETURN: String corresponding to the Notify Value. |
* |
* DESCRIPTION: Translate a Notify Value to a notify namestring. |
* |
******************************************************************************/ |
/* Names for Notify() values, used for debug output */ |
static const char *AcpiGbl_NotifyValueNames[] = |
{ |
"Bus Check", |
"Device Check", |
"Device Wake", |
"Eject Request", |
"Device Check Light", |
"Frequency Mismatch", |
"Bus Mode Mismatch", |
"Power Fault", |
"Capabilities Check", |
"Device PLD Check", |
"Reserved", |
"System Locality Update" |
}; |
const char * |
AcpiUtGetNotifyName ( |
UINT32 NotifyValue) |
{ |
if (NotifyValue <= ACPI_NOTIFY_MAX) |
{ |
return (AcpiGbl_NotifyValueNames[NotifyValue]); |
} |
else if (NotifyValue <= ACPI_MAX_SYS_NOTIFY) |
{ |
return ("Reserved"); |
} |
else /* Greater or equal to 0x80 */ |
{ |
return ("**Device Specific**"); |
} |
} |
#endif |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtValidObjectType |
* |
* PARAMETERS: Type - Object type to be validated |
* |
* RETURN: TRUE if valid object type, FALSE otherwise |
* |
* DESCRIPTION: Validate an object type |
* |
******************************************************************************/ |
BOOLEAN |
AcpiUtValidObjectType ( |
ACPI_OBJECT_TYPE Type) |
{ |
if (Type > ACPI_TYPE_LOCAL_MAX) |
{ |
/* Note: Assumes all TYPEs are contiguous (external/local) */ |
return (FALSE); |
} |
return (TRUE); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtInitGlobals |
* |
* PARAMETERS: None |
838,7 → 281,7 |
* |
* RETURN: Status |
* |
* DESCRIPTION: Init library globals. All globals that require specific |
* DESCRIPTION: Init ACPICA globals. All globals that require specific |
* initialization should be initialized here! |
* |
******************************************************************************/ |
893,6 → 336,7 |
/* GPE support */ |
AcpiGbl_AllGpesInitialized = FALSE; |
AcpiGbl_GpeXruptListHead = NULL; |
AcpiGbl_GpeFadtBlocks[0] = NULL; |
AcpiGbl_GpeFadtBlocks[1] = NULL; |
905,6 → 349,8 |
AcpiGbl_ExceptionHandler = NULL; |
AcpiGbl_InitHandler = NULL; |
AcpiGbl_TableHandler = NULL; |
AcpiGbl_InterfaceHandler = NULL; |
AcpiGbl_GlobalEventHandler = NULL; |
/* Global Lock support */ |
931,6 → 377,8 |
AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING; |
AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT; |
AcpiGbl_OsiData = 0; |
AcpiGbl_OsiMutex = NULL; |
AcpiGbl_RegMethodsExecuted = FALSE; |
/* Hardware oriented */ |
973,5 → 421,3 |
ACPI_EXPORT_SYMBOL (AcpiDbgLayer) |
ACPI_EXPORT_SYMBOL (AcpiGpeCount) |
ACPI_EXPORT_SYMBOL (AcpiCurrentGpeCount) |
/drivers/devman/acpica/utilities/utids.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
123,54 → 123,9 |
#define _COMPONENT ACPI_UTILITIES |
ACPI_MODULE_NAME ("utids") |
/* Local prototypes */ |
static void |
AcpiUtCopyIdString ( |
char *Destination, |
char *Source); |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtCopyIdString |
* |
* PARAMETERS: Destination - Where to copy the string |
* Source - Source string |
* |
* RETURN: None |
* |
* DESCRIPTION: Copies an ID string for the _HID, _CID, and _UID methods. |
* Performs removal of a leading asterisk if present -- workaround |
* for a known issue on a bunch of machines. |
* |
******************************************************************************/ |
static void |
AcpiUtCopyIdString ( |
char *Destination, |
char *Source) |
{ |
/* |
* Workaround for ID strings that have a leading asterisk. This construct |
* is not allowed by the ACPI specification (ID strings must be |
* alphanumeric), but enough existing machines have this embedded in their |
* ID strings that the following code is useful. |
*/ |
if (*Source == '*') |
{ |
Source++; |
} |
/* Do the actual copy */ |
ACPI_STRCPY (Destination, Source); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtExecute_HID |
* |
* PARAMETERS: DeviceNode - Node for the device |
240,7 → 195,7 |
} |
else |
{ |
AcpiUtCopyIdString (Hid->String, ObjDesc->String.Pointer); |
ACPI_STRCPY (Hid->String, ObjDesc->String.Pointer); |
} |
Hid->Length = Length; |
327,7 → 282,7 |
} |
else |
{ |
AcpiUtCopyIdString (Uid->String, ObjDesc->String.Pointer); |
ACPI_STRCPY (Uid->String, ObjDesc->String.Pointer); |
} |
Uid->Length = Length; |
471,7 → 426,7 |
{ |
/* Copy the String CID from the returned object */ |
AcpiUtCopyIdString (NextIdString, CidObjects[i]->String.Pointer); |
ACPI_STRCPY (NextIdString, CidObjects[i]->String.Pointer); |
Length = CidObjects[i]->String.Length + 1; |
} |
/drivers/devman/acpica/utilities/utinit.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
205,6 → 205,10 |
/* Close the AcpiEvent Handling */ |
AcpiEvTerminate (); |
/* Delete any dynamic _OSI interfaces */ |
AcpiUtInterfaceTerminate (); |
#endif |
/* Close the Namespace */ |
/drivers/devman/acpica/utilities/utlock.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
/drivers/devman/acpica/utilities/utmath.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
124,12 → 124,32 |
ACPI_MODULE_NAME ("utmath") |
/* |
* Support for double-precision integer divide. This code is included here |
* in order to support kernel environments where the double-precision math |
* library is not available. |
* Optional support for 64-bit double-precision integer divide. This code |
* is configurable and is implemented in order to support 32-bit kernel |
* environments where a 64-bit double-precision math library is not available. |
* |
* Support for a more normal 64-bit divide/modulo (with check for a divide- |
* by-zero) appears after this optional section of code. |
*/ |
#ifndef ACPI_USE_NATIVE_DIVIDE |
#ifndef ACPI_USE_NATIVE_DIVIDE |
/* Structures used only for 64-bit divide */ |
typedef struct uint64_struct |
{ |
UINT32 Lo; |
UINT32 Hi; |
} UINT64_STRUCT; |
typedef union uint64_overlay |
{ |
UINT64 Full; |
UINT64_STRUCT Part; |
} UINT64_OVERLAY; |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtShortDivide |
/drivers/devman/acpica/utilities/utmisc.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
124,13 → 124,7 |
#define _COMPONENT ACPI_UTILITIES |
ACPI_MODULE_NAME ("utmisc") |
/* |
* Common suffix for messages |
*/ |
#define ACPI_COMMON_MSG_SUFFIX \ |
AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber) |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtValidateException |
505,8 → 499,50 |
} |
#ifdef ACPI_ASL_COMPILER |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtStrlwr (strlwr) |
* |
* PARAMETERS: SrcString - The source string to convert |
* |
* RETURN: None |
* |
* DESCRIPTION: Convert string to lowercase |
* |
* NOTE: This is not a POSIX function, so it appears here, not in utclib.c |
* |
******************************************************************************/ |
void |
AcpiUtStrlwr ( |
char *SrcString) |
{ |
char *String; |
ACPI_FUNCTION_ENTRY (); |
if (!SrcString) |
{ |
return; |
} |
/* Walk entire string, lowercasing the letters */ |
for (String = SrcString; *String; String++) |
{ |
*String = (char) ACPI_TOLOWER (*String); |
} |
return; |
} |
#endif |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtPrintString |
* |
* PARAMETERS: String - Null terminated ASCII string |
1295,191 → 1331,3 |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiError, AcpiException, AcpiWarning, AcpiInfo |
* |
* 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 message with module/line/version info |
* |
******************************************************************************/ |
void ACPI_INTERNAL_VAR_XFACE |
AcpiError ( |
const char *ModuleName, |
UINT32 LineNumber, |
const char *Format, |
...) |
{ |
va_list args; |
AcpiOsPrintf ("ACPI Error: "); |
va_start (args, Format); |
AcpiOsVprintf (Format, args); |
ACPI_COMMON_MSG_SUFFIX; |
va_end (args); |
} |
void ACPI_INTERNAL_VAR_XFACE |
AcpiException ( |
const char *ModuleName, |
UINT32 LineNumber, |
ACPI_STATUS Status, |
const char *Format, |
...) |
{ |
va_list args; |
AcpiOsPrintf ("ACPI Exception: %s, ", AcpiFormatException (Status)); |
va_start (args, Format); |
AcpiOsVprintf (Format, args); |
ACPI_COMMON_MSG_SUFFIX; |
va_end (args); |
} |
void ACPI_INTERNAL_VAR_XFACE |
AcpiWarning ( |
const char *ModuleName, |
UINT32 LineNumber, |
const char *Format, |
...) |
{ |
va_list args; |
AcpiOsPrintf ("ACPI Warning: "); |
va_start (args, Format); |
AcpiOsVprintf (Format, args); |
ACPI_COMMON_MSG_SUFFIX; |
va_end (args); |
} |
void ACPI_INTERNAL_VAR_XFACE |
AcpiInfo ( |
const char *ModuleName, |
UINT32 LineNumber, |
const char *Format, |
...) |
{ |
va_list args; |
AcpiOsPrintf ("ACPI: "); |
va_start (args, Format); |
AcpiOsVprintf (Format, args); |
AcpiOsPrintf ("\n"); |
va_end (args); |
} |
ACPI_EXPORT_SYMBOL (AcpiError) |
ACPI_EXPORT_SYMBOL (AcpiException) |
ACPI_EXPORT_SYMBOL (AcpiWarning) |
ACPI_EXPORT_SYMBOL (AcpiInfo) |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtPredefinedWarning |
* |
* PARAMETERS: ModuleName - Caller's module name (for error output) |
* LineNumber - Caller's line number (for error output) |
* Pathname - Full pathname to the node |
* NodeFlags - From Namespace node for the method/object |
* Format - Printf format string + additional args |
* |
* RETURN: None |
* |
* DESCRIPTION: Warnings for the predefined validation module. Messages are |
* only emitted the first time a problem with a particular |
* method/object is detected. This prevents a flood of error |
* messages for methods that are repeatedly evaluated. |
* |
******************************************************************************/ |
void ACPI_INTERNAL_VAR_XFACE |
AcpiUtPredefinedWarning ( |
const char *ModuleName, |
UINT32 LineNumber, |
char *Pathname, |
UINT8 NodeFlags, |
const char *Format, |
...) |
{ |
va_list args; |
/* |
* Warning messages for this method/object will be disabled after the |
* first time a validation fails or an object is successfully repaired. |
*/ |
if (NodeFlags & ANOBJ_EVALUATED) |
{ |
return; |
} |
AcpiOsPrintf ("ACPI Warning for %s: ", Pathname); |
va_start (args, Format); |
AcpiOsVprintf (Format, args); |
ACPI_COMMON_MSG_SUFFIX; |
va_end (args); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtPredefinedInfo |
* |
* PARAMETERS: ModuleName - Caller's module name (for error output) |
* LineNumber - Caller's line number (for error output) |
* Pathname - Full pathname to the node |
* NodeFlags - From Namespace node for the method/object |
* Format - Printf format string + additional args |
* |
* RETURN: None |
* |
* DESCRIPTION: Info messages for the predefined validation module. Messages |
* are only emitted the first time a problem with a particular |
* method/object is detected. This prevents a flood of |
* messages for methods that are repeatedly evaluated. |
* |
******************************************************************************/ |
void ACPI_INTERNAL_VAR_XFACE |
AcpiUtPredefinedInfo ( |
const char *ModuleName, |
UINT32 LineNumber, |
char *Pathname, |
UINT8 NodeFlags, |
const char *Format, |
...) |
{ |
va_list args; |
/* |
* Warning messages for this method/object will be disabled after the |
* first time a validation fails or an object is successfully repaired. |
*/ |
if (NodeFlags & ANOBJ_EVALUATED) |
{ |
return; |
} |
AcpiOsPrintf ("ACPI Info for %s: ", Pathname); |
va_start (args, Format); |
AcpiOsVprintf (Format, args); |
ACPI_COMMON_MSG_SUFFIX; |
va_end (args); |
} |
/drivers/devman/acpica/utilities/utmutex.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
182,6 → 182,13 |
return_ACPI_STATUS (Status); |
} |
/* Mutex for _OSI support */ |
Status = AcpiOsCreateMutex (&AcpiGbl_OsiMutex); |
if (ACPI_FAILURE (Status)) |
{ |
return_ACPI_STATUS (Status); |
} |
/* Create the reader/writer lock for namespace access */ |
Status = AcpiUtCreateRwLock (&AcpiGbl_NamespaceRwLock); |
219,6 → 226,8 |
AcpiUtDeleteMutex (i); |
} |
AcpiOsDeleteMutex (AcpiGbl_OsiMutex); |
/* Delete the spinlocks */ |
AcpiOsDeleteLock (AcpiGbl_GpeLock); |
339,16 → 348,16 |
if (i == MutexId) |
{ |
ACPI_ERROR ((AE_INFO, |
"Mutex [%s] already acquired by this thread [%p]", |
"Mutex [%s] already acquired by this thread [%u]", |
AcpiUtGetMutexName (MutexId), |
ACPI_CAST_PTR (void, ThisThreadId))); |
(UINT32) ThisThreadId)); |
return (AE_ALREADY_ACQUIRED); |
} |
ACPI_ERROR ((AE_INFO, |
"Invalid acquire order: Thread %p owns [%s], wants [%s]", |
ACPI_CAST_PTR (void, ThisThreadId), AcpiUtGetMutexName (i), |
"Invalid acquire order: Thread %u owns [%s], wants [%s]", |
(UINT32) ThisThreadId, AcpiUtGetMutexName (i), |
AcpiUtGetMutexName (MutexId))); |
return (AE_ACQUIRE_DEADLOCK); |
358,15 → 367,15 |
#endif |
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, |
"Thread %p attempting to acquire Mutex [%s]\n", |
ACPI_CAST_PTR (void, ThisThreadId), AcpiUtGetMutexName (MutexId))); |
"Thread %u attempting to acquire Mutex [%s]\n", |
(UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId))); |
Status = AcpiOsAcquireMutex (AcpiGbl_MutexInfo[MutexId].Mutex, |
ACPI_WAIT_FOREVER); |
if (ACPI_SUCCESS (Status)) |
{ |
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %p acquired Mutex [%s]\n", |
ACPI_CAST_PTR (void, ThisThreadId), AcpiUtGetMutexName (MutexId))); |
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %u acquired Mutex [%s]\n", |
(UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId))); |
AcpiGbl_MutexInfo[MutexId].UseCount++; |
AcpiGbl_MutexInfo[MutexId].ThreadId = ThisThreadId; |
374,8 → 383,8 |
else |
{ |
ACPI_EXCEPTION ((AE_INFO, Status, |
"Thread %p could not acquire Mutex [0x%X]", |
ACPI_CAST_PTR (void, ThisThreadId), MutexId)); |
"Thread %u could not acquire Mutex [0x%X]", |
(UINT32) ThisThreadId, MutexId)); |
} |
return (Status); |
405,8 → 414,8 |
ThisThreadId = AcpiOsGetThreadId (); |
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %p releasing Mutex [%s]\n", |
ACPI_CAST_PTR (void, ThisThreadId), AcpiUtGetMutexName (MutexId))); |
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %u releasing Mutex [%s]\n", |
(UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId))); |
if (MutexId > ACPI_MAX_MUTEX) |
{ |
/drivers/devman/acpica/utilities/utobject.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
/drivers/devman/acpica/utilities/utosi.c |
---|
0,0 → 1,494 |
/****************************************************************************** |
* |
* Module Name: utosi - Support for the _OSI predefined control method |
* |
*****************************************************************************/ |
/****************************************************************************** |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
* |
* 2.1. This is your license from Intel Corp. under its intellectual property |
* rights. You may have additional license terms from the party that provided |
* you this software, covering your right to use that party's intellectual |
* property rights. |
* |
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a |
* copy of the source code appearing in this file ("Covered Code") an |
* irrevocable, perpetual, worldwide license under Intel's copyrights in the |
* base code distributed originally by Intel ("Original Intel Code") to copy, |
* make derivatives, distribute, use and display any portion of the Covered |
* Code in any form, with the right to sublicense such rights; and |
* |
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent |
* license (with the right to sublicense), under only those claims of Intel |
* patents that are infringed by the Original Intel Code, to make, use, sell, |
* offer to sell, and import the Covered Code and derivative works thereof |
* solely to the minimum extent necessary to exercise the above copyright |
* license, and in no event shall the patent license extend to any additions |
* to or modifications of the Original Intel Code. No other license or right |
* is granted directly or by implication, estoppel or otherwise; |
* |
* The above copyright and patent license is granted only if the following |
* conditions are met: |
* |
* 3. Conditions |
* |
* 3.1. Redistribution of Source with Rights to Further Distribute Source. |
* Redistribution of source code of any substantial portion of the Covered |
* Code or modification with rights to further distribute source must include |
* the above Copyright Notice, the above License, this list of Conditions, |
* and the following Disclaimer and Export Compliance provision. In addition, |
* Licensee must cause all Covered Code to which Licensee contributes to |
* contain a file documenting the changes Licensee made to create that Covered |
* Code and the date of any change. Licensee must include in that file the |
* documentation of any changes made by any predecessor Licensee. Licensee |
* must include a prominent statement that the modification is derived, |
* directly or indirectly, from Original Intel Code. |
* |
* 3.2. Redistribution of Source with no Rights to Further Distribute Source. |
* Redistribution of source code of any substantial portion of the Covered |
* Code or modification without rights to further distribute source must |
* include the following Disclaimer and Export Compliance provision in the |
* documentation and/or other materials provided with distribution. In |
* addition, Licensee may not authorize further sublicense of source of any |
* portion of the Covered Code, and must include terms to the effect that the |
* license from Licensee to its licensee is limited to the intellectual |
* property embodied in the software Licensee provides to its licensee, and |
* not to intellectual property embodied in modifications its licensee may |
* make. |
* |
* 3.3. Redistribution of Executable. Redistribution in executable form of any |
* substantial portion of the Covered Code or modification must reproduce the |
* above Copyright Notice, and the following Disclaimer and Export Compliance |
* provision in the documentation and/or other materials provided with the |
* distribution. |
* |
* 3.4. Intel retains all right, title, and interest in and to the Original |
* Intel Code. |
* |
* 3.5. Neither the name Intel nor any other trademark owned or controlled by |
* Intel shall be used in advertising or otherwise to promote the sale, use or |
* other dealings in products derived from or relating to the Covered Code |
* without prior written authorization from Intel. |
* |
* 4. Disclaimer and Export Compliance |
* |
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED |
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE |
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, |
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY |
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY |
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A |
* PARTICULAR PURPOSE. |
* |
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES |
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR |
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, |
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY |
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL |
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS |
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY |
* LIMITED REMEDY. |
* |
* 4.3. Licensee shall not export, either directly or indirectly, any of this |
* software or system incorporating such software without first obtaining any |
* required license or other approval from the U. S. Department of Commerce or |
* any other agency or department of the United States Government. In the |
* event Licensee exports any such software from the United States or |
* re-exports any such software from a foreign destination, Licensee shall |
* ensure that the distribution and export/re-export of the software is in |
* compliance with all laws, regulations, orders, or other restrictions of the |
* U.S. Export Administration Regulations. Licensee agrees that neither it nor |
* any of its subsidiaries will export/re-export any technical data, process, |
* software, or service, directly or indirectly, to any country for which the |
* United States government or any agency thereof requires an export license, |
* other governmental approval, or letter of assurance, without first obtaining |
* such license, approval or letter. |
* |
*****************************************************************************/ |
#define __UTOSI_C__ |
#include "acpi.h" |
#include "accommon.h" |
#define _COMPONENT ACPI_UTILITIES |
ACPI_MODULE_NAME ("utosi") |
/* |
* Strings supported by the _OSI predefined control method (which is |
* implemented internally within this module.) |
* |
* March 2009: Removed "Linux" as this host no longer wants to respond true |
* for this string. Basically, the only safe OS strings are windows-related |
* and in many or most cases represent the only test path within the |
* BIOS-provided ASL code. |
* |
* The last element of each entry is used to track the newest version of |
* Windows that the BIOS has requested. |
*/ |
static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] = |
{ |
/* Operating System Vendor Strings */ |
{"Windows 2000", NULL, 0, ACPI_OSI_WIN_2000}, /* Windows 2000 */ |
{"Windows 2001", NULL, 0, ACPI_OSI_WIN_XP}, /* Windows XP */ |
{"Windows 2001 SP1", NULL, 0, ACPI_OSI_WIN_XP_SP1}, /* Windows XP SP1 */ |
{"Windows 2001.1", NULL, 0, ACPI_OSI_WINSRV_2003}, /* Windows Server 2003 */ |
{"Windows 2001 SP2", NULL, 0, ACPI_OSI_WIN_XP_SP2}, /* Windows XP SP2 */ |
{"Windows 2001.1 SP1", NULL, 0, ACPI_OSI_WINSRV_2003_SP1}, /* Windows Server 2003 SP1 - Added 03/2006 */ |
{"Windows 2006", NULL, 0, ACPI_OSI_WIN_VISTA}, /* Windows Vista - Added 03/2006 */ |
{"Windows 2006.1", NULL, 0, ACPI_OSI_WINSRV_2008}, /* Windows Server 2008 - Added 09/2009 */ |
{"Windows 2006 SP1", NULL, 0, ACPI_OSI_WIN_VISTA_SP1}, /* Windows Vista SP1 - Added 09/2009 */ |
{"Windows 2006 SP2", NULL, 0, ACPI_OSI_WIN_VISTA_SP2}, /* Windows Vista SP2 - Added 09/2010 */ |
{"Windows 2009", NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */ |
/* Feature Group Strings */ |
{"Extended Address Space Descriptor", NULL, 0, 0} |
/* |
* All "optional" feature group strings (features that are implemented |
* by the host) should be dynamically added by the host via |
* AcpiInstallInterface and should not be manually added here. |
* |
* Examples of optional feature group strings: |
* |
* "Module Device" |
* "Processor Device" |
* "3.0 Thermal Model" |
* "3.0 _SCP Extensions" |
* "Processor Aggregator Device" |
*/ |
}; |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtInitializeInterfaces |
* |
* PARAMETERS: None |
* |
* RETURN: Status |
* |
* DESCRIPTION: Initialize the global _OSI supported interfaces list |
* |
******************************************************************************/ |
ACPI_STATUS |
AcpiUtInitializeInterfaces ( |
void) |
{ |
UINT32 i; |
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); |
AcpiGbl_SupportedInterfaces = AcpiDefaultSupportedInterfaces; |
/* Link the static list of supported interfaces */ |
for (i = 0; i < (ACPI_ARRAY_LENGTH (AcpiDefaultSupportedInterfaces) - 1); i++) |
{ |
AcpiDefaultSupportedInterfaces[i].Next = |
&AcpiDefaultSupportedInterfaces[(ACPI_SIZE) i + 1]; |
} |
AcpiOsReleaseMutex (AcpiGbl_OsiMutex); |
return (AE_OK); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtInterfaceTerminate |
* |
* PARAMETERS: None |
* |
* RETURN: None |
* |
* DESCRIPTION: Delete all interfaces in the global list. Sets |
* AcpiGbl_SupportedInterfaces to NULL. |
* |
******************************************************************************/ |
void |
AcpiUtInterfaceTerminate ( |
void) |
{ |
ACPI_INTERFACE_INFO *NextInterface; |
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); |
NextInterface = AcpiGbl_SupportedInterfaces; |
while (NextInterface) |
{ |
AcpiGbl_SupportedInterfaces = NextInterface->Next; |
/* Only interfaces added at runtime can be freed */ |
if (NextInterface->Flags & ACPI_OSI_DYNAMIC) |
{ |
ACPI_FREE (NextInterface->Name); |
ACPI_FREE (NextInterface); |
} |
NextInterface = AcpiGbl_SupportedInterfaces; |
} |
AcpiOsReleaseMutex (AcpiGbl_OsiMutex); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtInstallInterface |
* |
* PARAMETERS: InterfaceName - The interface to install |
* |
* RETURN: Status |
* |
* DESCRIPTION: Install the interface into the global interface list. |
* Caller MUST hold AcpiGbl_OsiMutex |
* |
******************************************************************************/ |
ACPI_STATUS |
AcpiUtInstallInterface ( |
ACPI_STRING InterfaceName) |
{ |
ACPI_INTERFACE_INFO *InterfaceInfo; |
/* Allocate info block and space for the name string */ |
InterfaceInfo = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_INTERFACE_INFO)); |
if (!InterfaceInfo) |
{ |
return (AE_NO_MEMORY); |
} |
InterfaceInfo->Name = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (InterfaceName) + 1); |
if (!InterfaceInfo->Name) |
{ |
ACPI_FREE (InterfaceInfo); |
return (AE_NO_MEMORY); |
} |
/* Initialize new info and insert at the head of the global list */ |
ACPI_STRCPY (InterfaceInfo->Name, InterfaceName); |
InterfaceInfo->Flags = ACPI_OSI_DYNAMIC; |
InterfaceInfo->Next = AcpiGbl_SupportedInterfaces; |
AcpiGbl_SupportedInterfaces = InterfaceInfo; |
return (AE_OK); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtRemoveInterface |
* |
* PARAMETERS: InterfaceName - The interface to remove |
* |
* RETURN: Status |
* |
* DESCRIPTION: Remove the interface from the global interface list. |
* Caller MUST hold AcpiGbl_OsiMutex |
* |
******************************************************************************/ |
ACPI_STATUS |
AcpiUtRemoveInterface ( |
ACPI_STRING InterfaceName) |
{ |
ACPI_INTERFACE_INFO *PreviousInterface; |
ACPI_INTERFACE_INFO *NextInterface; |
PreviousInterface = NextInterface = AcpiGbl_SupportedInterfaces; |
while (NextInterface) |
{ |
if (!ACPI_STRCMP (InterfaceName, NextInterface->Name)) |
{ |
/* Found: name is in either the static list or was added at runtime */ |
if (NextInterface->Flags & ACPI_OSI_DYNAMIC) |
{ |
/* Interface was added dynamically, remove and free it */ |
if (PreviousInterface == NextInterface) |
{ |
AcpiGbl_SupportedInterfaces = NextInterface->Next; |
} |
else |
{ |
PreviousInterface->Next = NextInterface->Next; |
} |
ACPI_FREE (NextInterface->Name); |
ACPI_FREE (NextInterface); |
} |
else |
{ |
/* |
* Interface is in static list. If marked invalid, then it |
* does not actually exist. Else, mark it invalid. |
*/ |
if (NextInterface->Flags & ACPI_OSI_INVALID) |
{ |
return (AE_NOT_EXIST); |
} |
NextInterface->Flags |= ACPI_OSI_INVALID; |
} |
return (AE_OK); |
} |
PreviousInterface = NextInterface; |
NextInterface = NextInterface->Next; |
} |
/* Interface was not found */ |
return (AE_NOT_EXIST); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtGetInterface |
* |
* PARAMETERS: InterfaceName - The interface to find |
* |
* RETURN: ACPI_INTERFACE_INFO if found. NULL if not found. |
* |
* DESCRIPTION: Search for the specified interface name in the global list. |
* Caller MUST hold AcpiGbl_OsiMutex |
* |
******************************************************************************/ |
ACPI_INTERFACE_INFO * |
AcpiUtGetInterface ( |
ACPI_STRING InterfaceName) |
{ |
ACPI_INTERFACE_INFO *NextInterface; |
NextInterface = AcpiGbl_SupportedInterfaces; |
while (NextInterface) |
{ |
if (!ACPI_STRCMP (InterfaceName, NextInterface->Name)) |
{ |
return (NextInterface); |
} |
NextInterface = NextInterface->Next; |
} |
return (NULL); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtOsiImplementation |
* |
* PARAMETERS: WalkState - Current walk state |
* |
* RETURN: Status |
* |
* DESCRIPTION: Implementation of the _OSI predefined control method. When |
* an invocation of _OSI is encountered in the system AML, |
* control is transferred to this function. |
* |
******************************************************************************/ |
ACPI_STATUS |
AcpiUtOsiImplementation ( |
ACPI_WALK_STATE *WalkState) |
{ |
ACPI_OPERAND_OBJECT *StringDesc; |
ACPI_OPERAND_OBJECT *ReturnDesc; |
ACPI_INTERFACE_INFO *InterfaceInfo; |
ACPI_INTERFACE_HANDLER InterfaceHandler; |
UINT32 ReturnValue; |
ACPI_FUNCTION_TRACE (UtOsiImplementation); |
/* Validate the string input argument (from the AML caller) */ |
StringDesc = WalkState->Arguments[0].Object; |
if (!StringDesc || |
(StringDesc->Common.Type != ACPI_TYPE_STRING)) |
{ |
return_ACPI_STATUS (AE_TYPE); |
} |
/* Create a return object */ |
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); |
if (!ReturnDesc) |
{ |
return_ACPI_STATUS (AE_NO_MEMORY); |
} |
/* Default return value is 0, NOT SUPPORTED */ |
ReturnValue = 0; |
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); |
/* Lookup the interface in the global _OSI list */ |
InterfaceInfo = AcpiUtGetInterface (StringDesc->String.Pointer); |
if (InterfaceInfo && |
!(InterfaceInfo->Flags & ACPI_OSI_INVALID)) |
{ |
/* |
* The interface is supported. |
* Update the OsiData if necessary. We keep track of the latest |
* version of Windows that has been requested by the BIOS. |
*/ |
if (InterfaceInfo->Value > AcpiGbl_OsiData) |
{ |
AcpiGbl_OsiData = InterfaceInfo->Value; |
} |
ReturnValue = ACPI_UINT32_MAX; |
} |
AcpiOsReleaseMutex (AcpiGbl_OsiMutex); |
/* |
* Invoke an optional _OSI interface handler. The host OS may wish |
* to do some interface-specific handling. For example, warn about |
* certain interfaces or override the true/false support value. |
*/ |
InterfaceHandler = AcpiGbl_InterfaceHandler; |
if (InterfaceHandler) |
{ |
ReturnValue = InterfaceHandler ( |
StringDesc->String.Pointer, ReturnValue); |
} |
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, |
"ACPI: BIOS _OSI(\"%s\") is %ssupported\n", |
StringDesc->String.Pointer, ReturnValue == 0 ? "not " : "")); |
/* Complete the return object */ |
ReturnDesc->Integer.Value = ReturnValue; |
WalkState->ReturnDesc = ReturnDesc; |
return_ACPI_STATUS (AE_OK); |
} |
/drivers/devman/acpica/utilities/utresrc.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
/drivers/devman/acpica/utilities/utstate.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
/drivers/devman/acpica/utilities/uttrack.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
/drivers/devman/acpica/utilities/utxface.c |
---|
8,7 → 8,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
193,6 → 193,15 |
return_ACPI_STATUS (Status); |
} |
/* Initialize the global OSI interfaces list with the static names */ |
Status = AcpiUtInitializeInterfaces (); |
if (ACPI_FAILURE (Status)) |
{ |
ACPI_EXCEPTION ((AE_INFO, Status, "During OSI interfaces initialization")); |
return_ACPI_STATUS (Status); |
} |
/* If configured, initialize the AML debugger */ |
ACPI_DEBUGGER_EXEC (Status = AcpiDbInitialize ()); |
403,27 → 412,6 |
} |
/* |
* Initialize the GPE blocks defined in the FADT (GPE block 0 and 1). |
* The runtime GPEs are enabled here. |
* |
* This is where the _PRW methods are executed for the GPEs. These |
* methods can only be executed after the SCI and Global Lock handlers are |
* installed and initialized. |
* |
* GPEs can only be enabled after the _REG, _STA, and _INI methods have |
* been run. This ensures that all Operation Regions and all Devices have |
* been initialized and are ready. |
*/ |
if (!(Flags & ACPI_NO_EVENT_INIT)) |
{ |
Status = AcpiEvInstallFadtGpes (); |
if (ACPI_FAILURE (Status)) |
{ |
return (Status); |
} |
} |
/* |
* Empty the caches (delete the cached objects) on the assumption that |
* the table load filled them up more than they will be at runtime -- |
* thus wasting non-paged memory. |
730,5 → 718,144 |
ACPI_EXPORT_SYMBOL (AcpiPurgeCachedObjects) |
#endif /* ACPI_ASL_COMPILER */ |
/***************************************************************************** |
* |
* FUNCTION: AcpiInstallInterface |
* |
* PARAMETERS: InterfaceName - The interface to install |
* |
* RETURN: Status |
* |
* DESCRIPTION: Install an _OSI interface to the global list |
* |
****************************************************************************/ |
ACPI_STATUS |
AcpiInstallInterface ( |
ACPI_STRING InterfaceName) |
{ |
ACPI_STATUS Status; |
ACPI_INTERFACE_INFO *InterfaceInfo; |
/* Parameter validation */ |
if (!InterfaceName || (ACPI_STRLEN (InterfaceName) == 0)) |
{ |
return (AE_BAD_PARAMETER); |
} |
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); |
/* Check if the interface name is already in the global list */ |
InterfaceInfo = AcpiUtGetInterface (InterfaceName); |
if (InterfaceInfo) |
{ |
/* |
* The interface already exists in the list. This is OK if the |
* interface has been marked invalid -- just clear the bit. |
*/ |
if (InterfaceInfo->Flags & ACPI_OSI_INVALID) |
{ |
InterfaceInfo->Flags &= ~ACPI_OSI_INVALID; |
Status = AE_OK; |
} |
else |
{ |
Status = AE_ALREADY_EXISTS; |
} |
} |
else |
{ |
/* New interface name, install into the global list */ |
Status = AcpiUtInstallInterface (InterfaceName); |
} |
AcpiOsReleaseMutex (AcpiGbl_OsiMutex); |
return (Status); |
} |
ACPI_EXPORT_SYMBOL (AcpiInstallInterface) |
/***************************************************************************** |
* |
* FUNCTION: AcpiRemoveInterface |
* |
* PARAMETERS: InterfaceName - The interface to remove |
* |
* RETURN: Status |
* |
* DESCRIPTION: Remove an _OSI interface from the global list |
* |
****************************************************************************/ |
ACPI_STATUS |
AcpiRemoveInterface ( |
ACPI_STRING InterfaceName) |
{ |
ACPI_STATUS Status; |
/* Parameter validation */ |
if (!InterfaceName || (ACPI_STRLEN (InterfaceName) == 0)) |
{ |
return (AE_BAD_PARAMETER); |
} |
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); |
Status = AcpiUtRemoveInterface (InterfaceName); |
AcpiOsReleaseMutex (AcpiGbl_OsiMutex); |
return (Status); |
} |
ACPI_EXPORT_SYMBOL (AcpiRemoveInterface) |
/***************************************************************************** |
* |
* FUNCTION: AcpiInstallInterfaceHandler |
* |
* PARAMETERS: Handler - The _OSI interface handler to install |
* NULL means "remove existing handler" |
* |
* RETURN: Status |
* |
* DESCRIPTION: Install a handler for the predefined _OSI ACPI method. |
* invoked during execution of the internal implementation of |
* _OSI. A NULL handler simply removes any existing handler. |
* |
****************************************************************************/ |
ACPI_STATUS |
AcpiInstallInterfaceHandler ( |
ACPI_INTERFACE_HANDLER Handler) |
{ |
ACPI_STATUS Status = AE_OK; |
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); |
if (Handler && AcpiGbl_InterfaceHandler) |
{ |
Status = AE_ALREADY_EXISTS; |
} |
else |
{ |
AcpiGbl_InterfaceHandler = Handler; |
} |
AcpiOsReleaseMutex (AcpiGbl_OsiMutex); |
return (Status); |
} |
ACPI_EXPORT_SYMBOL (AcpiInstallInterfaceHandler) |
#endif /* !ACPI_ASL_COMPILER */ |
/drivers/devman/acpica/utilities/utxferror.c |
---|
0,0 → 1,550 |
/******************************************************************************* |
* |
* Module Name: utxferror - Various error/warning output functions |
* |
******************************************************************************/ |
/****************************************************************************** |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
* |
* 2.1. This is your license from Intel Corp. under its intellectual property |
* rights. You may have additional license terms from the party that provided |
* you this software, covering your right to use that party's intellectual |
* property rights. |
* |
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a |
* copy of the source code appearing in this file ("Covered Code") an |
* irrevocable, perpetual, worldwide license under Intel's copyrights in the |
* base code distributed originally by Intel ("Original Intel Code") to copy, |
* make derivatives, distribute, use and display any portion of the Covered |
* Code in any form, with the right to sublicense such rights; and |
* |
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent |
* license (with the right to sublicense), under only those claims of Intel |
* patents that are infringed by the Original Intel Code, to make, use, sell, |
* offer to sell, and import the Covered Code and derivative works thereof |
* solely to the minimum extent necessary to exercise the above copyright |
* license, and in no event shall the patent license extend to any additions |
* to or modifications of the Original Intel Code. No other license or right |
* is granted directly or by implication, estoppel or otherwise; |
* |
* The above copyright and patent license is granted only if the following |
* conditions are met: |
* |
* 3. Conditions |
* |
* 3.1. Redistribution of Source with Rights to Further Distribute Source. |
* Redistribution of source code of any substantial portion of the Covered |
* Code or modification with rights to further distribute source must include |
* the above Copyright Notice, the above License, this list of Conditions, |
* and the following Disclaimer and Export Compliance provision. In addition, |
* Licensee must cause all Covered Code to which Licensee contributes to |
* contain a file documenting the changes Licensee made to create that Covered |
* Code and the date of any change. Licensee must include in that file the |
* documentation of any changes made by any predecessor Licensee. Licensee |
* must include a prominent statement that the modification is derived, |
* directly or indirectly, from Original Intel Code. |
* |
* 3.2. Redistribution of Source with no Rights to Further Distribute Source. |
* Redistribution of source code of any substantial portion of the Covered |
* Code or modification without rights to further distribute source must |
* include the following Disclaimer and Export Compliance provision in the |
* documentation and/or other materials provided with distribution. In |
* addition, Licensee may not authorize further sublicense of source of any |
* portion of the Covered Code, and must include terms to the effect that the |
* license from Licensee to its licensee is limited to the intellectual |
* property embodied in the software Licensee provides to its licensee, and |
* not to intellectual property embodied in modifications its licensee may |
* make. |
* |
* 3.3. Redistribution of Executable. Redistribution in executable form of any |
* substantial portion of the Covered Code or modification must reproduce the |
* above Copyright Notice, and the following Disclaimer and Export Compliance |
* provision in the documentation and/or other materials provided with the |
* distribution. |
* |
* 3.4. Intel retains all right, title, and interest in and to the Original |
* Intel Code. |
* |
* 3.5. Neither the name Intel nor any other trademark owned or controlled by |
* Intel shall be used in advertising or otherwise to promote the sale, use or |
* other dealings in products derived from or relating to the Covered Code |
* without prior written authorization from Intel. |
* |
* 4. Disclaimer and Export Compliance |
* |
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED |
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE |
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, |
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY |
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY |
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A |
* PARTICULAR PURPOSE. |
* |
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES |
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR |
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, |
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY |
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL |
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS |
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY |
* LIMITED REMEDY. |
* |
* 4.3. Licensee shall not export, either directly or indirectly, any of this |
* software or system incorporating such software without first obtaining any |
* required license or other approval from the U. S. Department of Commerce or |
* any other agency or department of the United States Government. In the |
* event Licensee exports any such software from the United States or |
* re-exports any such software from a foreign destination, Licensee shall |
* ensure that the distribution and export/re-export of the software is in |
* compliance with all laws, regulations, orders, or other restrictions of the |
* U.S. Export Administration Regulations. Licensee agrees that neither it nor |
* any of its subsidiaries will export/re-export any technical data, process, |
* software, or service, directly or indirectly, to any country for which the |
* United States government or any agency thereof requires an export license, |
* other governmental approval, or letter of assurance, without first obtaining |
* such license, approval or letter. |
* |
*****************************************************************************/ |
#define __UTXFERROR_C__ |
#include "acpi.h" |
#include "accommon.h" |
#include "acnamesp.h" |
#define _COMPONENT ACPI_UTILITIES |
ACPI_MODULE_NAME ("utxferror") |
/* |
* This module is used for the in-kernel ACPICA as well as the ACPICA |
* tools/applications. |
* |
* For the iASL compiler case, the output is redirected to stderr so that |
* any of the various ACPI errors and warnings do not appear in the output |
* files, for either the compiler or disassembler portions of the tool. |
*/ |
#ifdef ACPI_ASL_COMPILER |
#include <stdio.h> |
extern FILE *AcpiGbl_OutputFile; |
#define ACPI_MSG_REDIRECT_BEGIN \ |
FILE *OutputFile = AcpiGbl_OutputFile; \ |
AcpiOsRedirectOutput (stderr); |
#define ACPI_MSG_REDIRECT_END \ |
AcpiOsRedirectOutput (OutputFile); |
#else |
/* |
* non-iASL case - no redirection, nothing to do |
*/ |
#define ACPI_MSG_REDIRECT_BEGIN |
#define ACPI_MSG_REDIRECT_END |
#endif |
/* |
* Common message prefixes |
*/ |
#define ACPI_MSG_ERROR "ACPI Error: " |
#define ACPI_MSG_EXCEPTION "ACPI Exception: " |
#define ACPI_MSG_WARNING "ACPI Warning: " |
#define ACPI_MSG_INFO "ACPI: " |
/* |
* Common message suffix |
*/ |
#define ACPI_MSG_SUFFIX \ |
AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber) |
/******************************************************************************* |
* |
* FUNCTION: AcpiError |
* |
* 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 Error" message with module/line/version info |
* |
******************************************************************************/ |
void ACPI_INTERNAL_VAR_XFACE |
AcpiError ( |
const char *ModuleName, |
UINT32 LineNumber, |
const char *Format, |
...) |
{ |
va_list ArgList; |
ACPI_MSG_REDIRECT_BEGIN; |
AcpiOsPrintf (ACPI_MSG_ERROR); |
va_start (ArgList, Format); |
AcpiOsVprintf (Format, ArgList); |
ACPI_MSG_SUFFIX; |
va_end (ArgList); |
ACPI_MSG_REDIRECT_END; |
} |
ACPI_EXPORT_SYMBOL (AcpiError) |
/******************************************************************************* |
* |
* FUNCTION: AcpiException |
* |
* PARAMETERS: ModuleName - Caller's module name (for error output) |
* LineNumber - Caller's line number (for error output) |
* Status - Status to be formatted |
* Format - Printf format string + additional args |
* |
* RETURN: None |
* |
* DESCRIPTION: Print "ACPI Exception" message with module/line/version info |
* and decoded ACPI_STATUS. |
* |
******************************************************************************/ |
void ACPI_INTERNAL_VAR_XFACE |
AcpiException ( |
const char *ModuleName, |
UINT32 LineNumber, |
ACPI_STATUS Status, |
const char *Format, |
...) |
{ |
va_list ArgList; |
ACPI_MSG_REDIRECT_BEGIN; |
AcpiOsPrintf (ACPI_MSG_EXCEPTION "%s, ", AcpiFormatException (Status)); |
va_start (ArgList, Format); |
AcpiOsVprintf (Format, ArgList); |
ACPI_MSG_SUFFIX; |
va_end (ArgList); |
ACPI_MSG_REDIRECT_END; |
} |
ACPI_EXPORT_SYMBOL (AcpiException) |
/******************************************************************************* |
* |
* FUNCTION: AcpiWarning |
* |
* 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 Warning" message with module/line/version info |
* |
******************************************************************************/ |
void ACPI_INTERNAL_VAR_XFACE |
AcpiWarning ( |
const char *ModuleName, |
UINT32 LineNumber, |
const char *Format, |
...) |
{ |
va_list ArgList; |
ACPI_MSG_REDIRECT_BEGIN; |
AcpiOsPrintf (ACPI_MSG_WARNING); |
va_start (ArgList, Format); |
AcpiOsVprintf (Format, ArgList); |
ACPI_MSG_SUFFIX; |
va_end (ArgList); |
ACPI_MSG_REDIRECT_END; |
} |
ACPI_EXPORT_SYMBOL (AcpiWarning) |
/******************************************************************************* |
* |
* FUNCTION: AcpiInfo |
* |
* 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 generic "ACPI:" information message. There is no |
* module/line/version info in order to keep the message simple. |
* |
* TBD: ModuleName and LineNumber args are not needed, should be removed. |
* |
******************************************************************************/ |
void ACPI_INTERNAL_VAR_XFACE |
AcpiInfo ( |
const char *ModuleName, |
UINT32 LineNumber, |
const char *Format, |
...) |
{ |
va_list ArgList; |
ACPI_MSG_REDIRECT_BEGIN; |
AcpiOsPrintf (ACPI_MSG_INFO); |
va_start (ArgList, Format); |
AcpiOsVprintf (Format, ArgList); |
AcpiOsPrintf ("\n"); |
va_end (ArgList); |
ACPI_MSG_REDIRECT_END; |
} |
ACPI_EXPORT_SYMBOL (AcpiInfo) |
/* |
* The remainder of this module contains internal error functions that may |
* be configured out. |
*/ |
#if !defined (ACPI_NO_ERROR_MESSAGES) && !defined (ACPI_BIN_APP) |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtPredefinedWarning |
* |
* PARAMETERS: ModuleName - Caller's module name (for error output) |
* LineNumber - Caller's line number (for error output) |
* Pathname - Full pathname to the node |
* NodeFlags - From Namespace node for the method/object |
* Format - Printf format string + additional args |
* |
* RETURN: None |
* |
* DESCRIPTION: Warnings for the predefined validation module. Messages are |
* only emitted the first time a problem with a particular |
* method/object is detected. This prevents a flood of error |
* messages for methods that are repeatedly evaluated. |
* |
******************************************************************************/ |
void ACPI_INTERNAL_VAR_XFACE |
AcpiUtPredefinedWarning ( |
const char *ModuleName, |
UINT32 LineNumber, |
char *Pathname, |
UINT8 NodeFlags, |
const char *Format, |
...) |
{ |
va_list ArgList; |
/* |
* Warning messages for this method/object will be disabled after the |
* first time a validation fails or an object is successfully repaired. |
*/ |
if (NodeFlags & ANOBJ_EVALUATED) |
{ |
return; |
} |
AcpiOsPrintf (ACPI_MSG_WARNING "For %s: ", Pathname); |
va_start (ArgList, Format); |
AcpiOsVprintf (Format, ArgList); |
ACPI_MSG_SUFFIX; |
va_end (ArgList); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtPredefinedInfo |
* |
* PARAMETERS: ModuleName - Caller's module name (for error output) |
* LineNumber - Caller's line number (for error output) |
* Pathname - Full pathname to the node |
* NodeFlags - From Namespace node for the method/object |
* Format - Printf format string + additional args |
* |
* RETURN: None |
* |
* DESCRIPTION: Info messages for the predefined validation module. Messages |
* are only emitted the first time a problem with a particular |
* method/object is detected. This prevents a flood of |
* messages for methods that are repeatedly evaluated. |
* |
******************************************************************************/ |
void ACPI_INTERNAL_VAR_XFACE |
AcpiUtPredefinedInfo ( |
const char *ModuleName, |
UINT32 LineNumber, |
char *Pathname, |
UINT8 NodeFlags, |
const char *Format, |
...) |
{ |
va_list ArgList; |
/* |
* Warning messages for this method/object will be disabled after the |
* first time a validation fails or an object is successfully repaired. |
*/ |
if (NodeFlags & ANOBJ_EVALUATED) |
{ |
return; |
} |
AcpiOsPrintf (ACPI_MSG_INFO "For %s: ", Pathname); |
va_start (ArgList, Format); |
AcpiOsVprintf (Format, ArgList); |
ACPI_MSG_SUFFIX; |
va_end (ArgList); |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtNamespaceError |
* |
* PARAMETERS: ModuleName - Caller's module name (for error output) |
* LineNumber - Caller's line number (for error output) |
* InternalName - Name or path of the namespace node |
* LookupStatus - Exception code from NS lookup |
* |
* RETURN: None |
* |
* DESCRIPTION: Print error message with the full pathname for the NS node. |
* |
******************************************************************************/ |
void |
AcpiUtNamespaceError ( |
const char *ModuleName, |
UINT32 LineNumber, |
const char *InternalName, |
ACPI_STATUS LookupStatus) |
{ |
ACPI_STATUS Status; |
UINT32 BadName; |
char *Name = NULL; |
ACPI_MSG_REDIRECT_BEGIN; |
AcpiOsPrintf (ACPI_MSG_ERROR); |
if (LookupStatus == AE_BAD_CHARACTER) |
{ |
/* There is a non-ascii character in the name */ |
ACPI_MOVE_32_TO_32 (&BadName, ACPI_CAST_PTR (UINT32, InternalName)); |
AcpiOsPrintf ("[0x%4.4X] (NON-ASCII)", BadName); |
} |
else |
{ |
/* Convert path to external format */ |
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, |
InternalName, NULL, &Name); |
/* Print target name */ |
if (ACPI_SUCCESS (Status)) |
{ |
AcpiOsPrintf ("[%s]", Name); |
} |
else |
{ |
AcpiOsPrintf ("[COULD NOT EXTERNALIZE NAME]"); |
} |
if (Name) |
{ |
ACPI_FREE (Name); |
} |
} |
AcpiOsPrintf (" Namespace lookup failure, %s", |
AcpiFormatException (LookupStatus)); |
ACPI_MSG_SUFFIX; |
ACPI_MSG_REDIRECT_END; |
} |
/******************************************************************************* |
* |
* FUNCTION: AcpiUtMethodError |
* |
* PARAMETERS: ModuleName - Caller's module name (for error output) |
* LineNumber - Caller's line number (for error output) |
* Message - Error message to use on failure |
* PrefixNode - Prefix relative to the path |
* Path - Path to the node (optional) |
* MethodStatus - Execution status |
* |
* RETURN: None |
* |
* DESCRIPTION: Print error message with the full pathname for the method. |
* |
******************************************************************************/ |
void |
AcpiUtMethodError ( |
const char *ModuleName, |
UINT32 LineNumber, |
const char *Message, |
ACPI_NAMESPACE_NODE *PrefixNode, |
const char *Path, |
ACPI_STATUS MethodStatus) |
{ |
ACPI_STATUS Status; |
ACPI_NAMESPACE_NODE *Node = PrefixNode; |
ACPI_MSG_REDIRECT_BEGIN; |
AcpiOsPrintf (ACPI_MSG_ERROR); |
if (Path) |
{ |
Status = AcpiNsGetNode (PrefixNode, Path, ACPI_NS_NO_UPSEARCH, |
&Node); |
if (ACPI_FAILURE (Status)) |
{ |
AcpiOsPrintf ("[Could not get node by pathname]"); |
} |
} |
AcpiNsPrintNodePathname (Node, Message); |
AcpiOsPrintf (", %s", AcpiFormatException (MethodStatus)); |
ACPI_MSG_SUFFIX; |
ACPI_MSG_REDIRECT_END; |
} |
#endif /* ACPI_NO_ERROR_MESSAGES */ |