Fix conflicts from import of Intel ACPI-CA 20051021

This commit is contained in:
Jung-uk Kim 2005-11-01 22:28:49 +00:00
parent 775a51a92f
commit b56f6e1fd7
8 changed files with 968 additions and 497 deletions

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
* All rights reserved.
*
* 2. License
@ -126,7 +126,6 @@
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbfileio")
/*
* NOTE: this is here for lack of a better place. It is used in all
* flavors of the debugger, need LCD file
@ -138,13 +137,30 @@ FILE *AcpiGbl_DebugFile = NULL;
#ifdef ACPI_DEBUGGER
/* Local prototypes */
#ifdef ACPI_APPLICATION
static ACPI_STATUS
AcpiDbCheckTextModeCorruption (
UINT8 *Table,
UINT32 TableLength,
UINT32 FileLength);
static ACPI_STATUS
AeLocalLoadTable (
ACPI_TABLE_HEADER *TablePtr);
#endif
/*******************************************************************************
*
* FUNCTION: AcpiDbCloseDebugFile
*
* PARAMETERS: None
*
* RETURN: Status
* RETURN: None
*
* DESCRIPTION: If open, close the current debug output file
*
@ -174,7 +190,7 @@ AcpiDbCloseDebugFile (
*
* PARAMETERS: Name - Filename to open
*
* RETURN: Status
* RETURN: None
*
* DESCRIPTION: Open a file where debug output will be directed.
*
@ -206,7 +222,6 @@ AcpiDbOpenDebugFile (
#ifdef ACPI_APPLICATION
/*******************************************************************************
*
* FUNCTION: AcpiDbCheckTextModeCorruption
@ -235,8 +250,9 @@ AcpiDbCheckTextModeCorruption (
if (TableLength != FileLength)
{
ACPI_REPORT_WARNING (("File length (0x%X) is not the same as the table length (0x%X)\n",
FileLength, TableLength));
ACPI_REPORT_WARNING ((
"File length (0x%X) is not the same as the table length (0x%X)\n",
FileLength, TableLength));
}
/* Scan entire table to determine if each LF has been prefixed with a CR */
@ -247,7 +263,7 @@ AcpiDbCheckTextModeCorruption (
{
if (Table[i - 1] != 0x0D)
{
/* the LF does not have a preceeding CR, table is not corrupted */
/* The LF does not have a preceeding CR, table not corrupted */
return (AE_OK);
}
@ -303,25 +319,35 @@ AcpiDbReadTable (
fseek (fp, 0, SEEK_END);
FileSize = ftell (fp);
FileSize = (UINT32) ftell (fp);
fseek (fp, 0, SEEK_SET);
/* Read the table header */
if (fread (&TableHeader, 1, sizeof (TableHeader), fp) != sizeof (ACPI_TABLE_HEADER))
if (fread (&TableHeader, 1, sizeof (TableHeader), fp) !=
sizeof (ACPI_TABLE_HEADER))
{
AcpiOsPrintf ("Couldn't read the table header\n");
return (AE_BAD_SIGNATURE);
AcpiOsPrintf ("Could not read the table header\n");
return (AE_BAD_HEADER);
}
/* Validate the table header/length */
Status = AcpiTbValidateTableHeader (&TableHeader);
if ((ACPI_FAILURE (Status)) ||
(TableHeader.Length > 0x800000)) /* 8 Mbyte should be enough */
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Table header is invalid!\n");
return (AE_ERROR);
return (Status);
}
/* File size must be at least as long as the Header-specified length */
if (TableHeader.Length > FileSize)
{
AcpiOsPrintf (
"TableHeader length [0x%X] greater than the input file size [0x%X]\n",
TableHeader.Length, FileSize);
return (AE_BAD_HEADER);
}
/* We only support a limited number of table types */
@ -330,7 +356,8 @@ AcpiDbReadTable (
ACPI_STRNCMP ((char *) TableHeader.Signature, PSDT_SIG, 4) &&
ACPI_STRNCMP ((char *) TableHeader.Signature, SSDT_SIG, 4))
{
AcpiOsPrintf ("Table signature is invalid\n");
AcpiOsPrintf ("Table signature [%4.4s] is invalid or not supported\n",
(char *) TableHeader.Signature);
ACPI_DUMP_BUFFER (&TableHeader, sizeof (ACPI_TABLE_HEADER));
return (AE_ERROR);
}
@ -341,8 +368,9 @@ AcpiDbReadTable (
*Table = AcpiOsAllocate ((size_t) (FileSize));
if (!*Table)
{
AcpiOsPrintf ("Could not allocate memory for ACPI table %4.4s (size=%X)\n",
TableHeader.Signature, TableHeader.Length);
AcpiOsPrintf (
"Could not allocate memory for ACPI table %4.4s (size=0x%X)\n",
TableHeader.Signature, TableHeader.Length);
return (AE_NO_MEMORY);
}
@ -379,7 +407,6 @@ AcpiDbReadTable (
return (AE_ERROR);
}
#endif
/*******************************************************************************
@ -398,7 +425,7 @@ AcpiDbReadTable (
*
******************************************************************************/
ACPI_STATUS
static ACPI_STATUS
AeLocalLoadTable (
ACPI_TABLE_HEADER *Table)
{
@ -426,6 +453,13 @@ AeLocalLoadTable (
Status = AcpiTbInstallTable (&TableInfo);
if (ACPI_FAILURE (Status))
{
if (Status == AE_ALREADY_EXISTS)
{
/* Table already exists, no error */
Status = AE_OK;
}
/* Free table allocated by AcpiTbGetTable */
AcpiTbDeleteSingleTable (&TableInfo);
@ -448,7 +482,6 @@ AeLocalLoadTable (
}
#ifdef ACPI_APPLICATION
/*******************************************************************************
*
* FUNCTION: AcpiDbReadTableFromFile
@ -489,7 +522,7 @@ AcpiDbReadTableFromFile (
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Couldn't get table from the file\n");
AcpiOsPrintf ("Could not get table from the file\n");
return (Status);
}
@ -502,8 +535,8 @@ AcpiDbReadTableFromFile (
*
* FUNCTION: AcpiDbGetTableFromFile
*
* PARAMETERS: Filename - File where table is located
* Table - Where a pointer to the table is returned
* PARAMETERS: Filename - File where table is located
* ReturnTable - Where a pointer to the table is returned
*
* RETURN: Status
*

View File

@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
* All rights reserved.
*
* 2. License
@ -127,11 +127,26 @@
ACPI_MODULE_NAME ("dbxface")
/* Local prototypes */
static ACPI_STATUS
AcpiDbStartCommand (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
#ifdef ACPI_OBSOLETE_FUNCTIONS
void
AcpiDbMethodEnd (
ACPI_WALK_STATE *WalkState);
#endif
/*******************************************************************************
*
* FUNCTION: AcpiDbStartCommand
*
* PARAMETERS: WalkState - Current walk
* Op - Current executing Op, from AML interpreter
*
* RETURN: Status
*
@ -139,7 +154,7 @@
*
******************************************************************************/
ACPI_STATUS
static ACPI_STATUS
AcpiDbStartCommand (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op)
@ -147,7 +162,7 @@ AcpiDbStartCommand (
ACPI_STATUS Status;
/* TBD: [Investigate] what are the namespace locking issues here */
/* TBD: [Investigate] are there namespace locking issues here? */
/* AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); */
@ -206,40 +221,12 @@ AcpiDbStartCommand (
}
/*******************************************************************************
*
* FUNCTION: AcpiDbMethodEnd
*
* PARAMETERS: WalkState - Current walk
*
* RETURN: Status
*
* DESCRIPTION:
*
******************************************************************************/
void
AcpiDbMethodEnd (
ACPI_WALK_STATE *WalkState)
{
if (!AcpiGbl_CmSingleStep)
{
return;
}
AcpiOsPrintf ("<Method Terminating>\n");
AcpiDbStartCommand (WalkState, NULL);
}
/*******************************************************************************
*
* FUNCTION: AcpiDbSingleStep
*
* PARAMETERS: WalkState - Current walk
* Op - Current executing op
* Op - Current executing op (from aml interpreter)
* OpcodeClass - Class of the current AML Opcode
*
* RETURN: Status
@ -291,7 +278,8 @@ AcpiDbSingleStep (
else if (WalkState->UserBreakpoint &&
(WalkState->UserBreakpoint == Op->Common.AmlOffset))
{
AcpiOsPrintf ("***UserBreakpoint*** at AML offset %X\n", Op->Common.AmlOffset);
AcpiOsPrintf ("***UserBreakpoint*** at AML offset %X\n",
Op->Common.AmlOffset);
AcpiGbl_CmSingleStep = TRUE;
AcpiGbl_StepToNextCall = FALSE;
WalkState->MethodBreakpoint = 0;
@ -331,9 +319,9 @@ AcpiDbSingleStep (
}
/*
* Display this op (and only this op - zero out the NEXT field temporarily,
* and disable parser trace output for the duration of the display because
* we don't want the extraneous debug output)
* Display this op (and only this op - zero out the NEXT field
* temporarily, and disable parser trace output for the duration of
* the display because we don't want the extraneous debug output)
*/
OriginalDebugLevel = AcpiDbgLevel;
AcpiDbgLevel &= ~(ACPI_LV_PARSE | ACPI_LV_FUNCTIONS);
@ -346,7 +334,8 @@ AcpiDbSingleStep (
if (ParentOp)
{
if ((WalkState->ControlState) &&
(WalkState->ControlState->Common.State == ACPI_CONTROL_PREDICATE_EXECUTING))
(WalkState->ControlState->Common.State ==
ACPI_CONTROL_PREDICATE_EXECUTING))
{
/*
* We are executing the predicate of an IF or WHILE statement
@ -448,10 +437,14 @@ AcpiDbSingleStep (
*/
if (Op->Common.AmlOpcode == AML_INT_METHODCALL_OP)
{
AcpiGbl_CmSingleStep = FALSE; /* No more single step while executing called method */
/* Force no more single stepping while executing called method */
/* Set the breakpoint on/before the call, it will stop execution as soon as we return */
AcpiGbl_CmSingleStep = FALSE;
/*
* Set the breakpoint on/before the call, it will stop execution
* as soon as we return
*/
WalkState->MethodBreakpoint = 1; /* Must be non-zero! */
}
@ -477,7 +470,8 @@ AcpiDbSingleStep (
******************************************************************************/
ACPI_STATUS
AcpiDbInitialize (void)
AcpiDbInitialize (
void)
{
ACPI_STATUS Status;
@ -564,14 +558,15 @@ AcpiDbInitialize (void)
*
* PARAMETERS: None
*
* RETURN: Status
* RETURN: None
*
* DESCRIPTION: Stop debugger
*
******************************************************************************/
void
AcpiDbTerminate (void)
AcpiDbTerminate (
void)
{
if (AcpiGbl_DbTablePtr)
@ -585,4 +580,33 @@ AcpiDbTerminate (void)
}
#ifdef ACPI_OBSOLETE_FUNCTIONS
/*******************************************************************************
*
* FUNCTION: AcpiDbMethodEnd
*
* PARAMETERS: WalkState - Current walk
*
* RETURN: Status
*
* DESCRIPTION: Called at method termination
*
******************************************************************************/
void
AcpiDbMethodEnd (
ACPI_WALK_STATE *WalkState)
{
if (!AcpiGbl_CmSingleStep)
{
return;
}
AcpiOsPrintf ("<Method Terminating>\n");
AcpiDbStartCommand (WalkState, NULL);
}
#endif
#endif /* ACPI_DEBUGGER */

View File

@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
* All rights reserved.
*
* 2. License
@ -124,6 +124,12 @@
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dmopcode")
/* Local prototypes */
static void
AcpiDmMatchKeyword (
ACPI_PARSE_OBJECT *Op);
/*******************************************************************************
*
@ -328,7 +334,7 @@ AcpiDmMatchOp (
*
******************************************************************************/
void
static void
AcpiDmMatchKeyword (
ACPI_PARSE_OBJECT *Op)
{
@ -340,7 +346,8 @@ AcpiDmMatchKeyword (
}
else
{
AcpiOsPrintf ("%s", (char *) (uintptr_t)AcpiGbl_MatchOps[(ACPI_SIZE) Op->Common.Value.Integer]);
AcpiOsPrintf ("%s", (char *) (uintptr_t)
AcpiGbl_MatchOps[(ACPI_SIZE) Op->Common.Value.Integer]);
}
}
@ -474,7 +481,7 @@ AcpiDmDisassembleOneOp (
* types of buffers, we have to closely look at the data in the
* buffer to determine the type.
*/
if (AcpiDmIsResourceDescriptor (Op))
if (AcpiDmIsResourceTemplate (Op))
{
Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE;
AcpiOsPrintf ("ResourceTemplate");
@ -513,14 +520,14 @@ AcpiDmDisassembleOneOp (
case AML_INT_NAMEPATH_OP:
AcpiDmNamestring (Op->Common.Value.Name);
AcpiDmValidateName (Op->Common.Value.Name, Op);
break;
case AML_INT_NAMEDFIELD_OP:
Length = AcpiDmDumpName ((char *) &Op->Named.Name);
AcpiOsPrintf (",%*.s %d", (int) (5 - Length), " ", (UINT32) Op->Common.Value.Integer);
AcpiOsPrintf (",%*.s %d", (int) (5 - Length), " ",
(UINT32) Op->Common.Value.Integer);
AcpiDmCommaIfFieldMember (Op);
Info->BitOffset += (UINT32) Op->Common.Value.Integer;
@ -590,7 +597,8 @@ AcpiDmDisassembleOneOp (
(WalkState->Results->Results.NumResults))
{
AcpiDmDecodeInternalObject (
WalkState->Results->Results.ObjDesc [WalkState->Results->Results.NumResults-1]);
WalkState->Results->Results.ObjDesc [
WalkState->Results->Results.NumResults-1]);
}
#endif
break;

View File

@ -11,7 +11,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
* All rights reserved.
*
* 2. License
@ -162,8 +162,9 @@ AcpiHwClearAcpiStatus (
}
}
Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS,
ACPI_BITMASK_ALL_FIXED_STATUS);
Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK,
ACPI_REGISTER_PM1_STATUS,
ACPI_BITMASK_ALL_FIXED_STATUS);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
@ -183,7 +184,7 @@ AcpiHwClearAcpiStatus (
/* Clear the GPE Bits in all GPE registers in all GPE blocks */
Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, ACPI_ISR);
Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock);
UnlockAndExit:
if (Flags & ACPI_MTX_LOCK)
@ -217,30 +218,32 @@ AcpiGetSleepTypeData (
{
ACPI_STATUS Status = AE_OK;
ACPI_PARAMETER_INFO Info;
char *SleepStateName;
ACPI_FUNCTION_TRACE ("AcpiGetSleepTypeData");
/*
* Validate parameters
*/
/* Validate parameters */
if ((SleepState > ACPI_S_STATES_MAX) ||
!SleepTypeA || !SleepTypeB)
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/*
* Evaluate the namespace object containing the values for this state
*/
/* Evaluate the namespace object containing the values for this state */
Info.Parameters = NULL;
Status = AcpiNsEvaluateByName ((char *) (uintptr_t) AcpiGbl_SleepStateNames[SleepState],
&Info);
Info.ReturnObject = NULL;
SleepStateName = (char *) (uintptr_t) AcpiGbl_SleepStateNames[SleepState];
Status = AcpiNsEvaluateByName (SleepStateName, &Info);
if (ACPI_FAILURE (Status))
{
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s while evaluating SleepState [%s]\n",
AcpiFormatException (Status), AcpiGbl_SleepStateNames[SleepState]));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"%s while evaluating SleepState [%s]\n",
AcpiFormatException (Status), SleepStateName));
return_ACPI_STATUS (Status);
}
@ -249,7 +252,8 @@ AcpiGetSleepTypeData (
if (!Info.ReturnObject)
{
ACPI_REPORT_ERROR (("Missing Sleep State object\n"));
ACPI_REPORT_ERROR (("No Sleep State object returned from [%s]\n",
SleepStateName));
Status = AE_NOT_EXIST;
}
@ -257,42 +261,53 @@ AcpiGetSleepTypeData (
else if (ACPI_GET_OBJECT_TYPE (Info.ReturnObject) != ACPI_TYPE_PACKAGE)
{
ACPI_REPORT_ERROR (("Sleep State object not a Package\n"));
ACPI_REPORT_ERROR (("Sleep State return object is not a Package\n"));
Status = AE_AML_OPERAND_TYPE;
}
/* The package must have at least two elements */
/*
* The package must have at least two elements. NOTE (March 2005): This
* goes against the current ACPI spec which defines this object as a
* package with one encoded DWORD element. However, existing practice
* by BIOS vendors seems to be to have 2 or more elements, at least
* one per sleep type (A/B).
*/
else if (Info.ReturnObject->Package.Count < 2)
{
ACPI_REPORT_ERROR (("Sleep State package does not have at least two elements\n"));
ACPI_REPORT_ERROR ((
"Sleep State return package does not have at least two elements\n"));
Status = AE_AML_NO_OPERAND;
}
/* The first two elements must both be of type Integer */
else if ((ACPI_GET_OBJECT_TYPE (Info.ReturnObject->Package.Elements[0]) != ACPI_TYPE_INTEGER) ||
(ACPI_GET_OBJECT_TYPE (Info.ReturnObject->Package.Elements[1]) != ACPI_TYPE_INTEGER))
else if ((ACPI_GET_OBJECT_TYPE (Info.ReturnObject->Package.Elements[0])
!= ACPI_TYPE_INTEGER) ||
(ACPI_GET_OBJECT_TYPE (Info.ReturnObject->Package.Elements[1])
!= ACPI_TYPE_INTEGER))
{
ACPI_REPORT_ERROR (("Sleep State package elements are not both Integers (%s, %s)\n",
ACPI_REPORT_ERROR ((
"Sleep State return package elements are not both Integers (%s, %s)\n",
AcpiUtGetObjectTypeName (Info.ReturnObject->Package.Elements[0]),
AcpiUtGetObjectTypeName (Info.ReturnObject->Package.Elements[1])));
Status = AE_AML_OPERAND_TYPE;
}
else
{
/*
* Valid _Sx_ package size, type, and value
*/
*SleepTypeA = (UINT8) (Info.ReturnObject->Package.Elements[0])->Integer.Value;
*SleepTypeB = (UINT8) (Info.ReturnObject->Package.Elements[1])->Integer.Value;
/* Valid _Sx_ package size, type, and value */
*SleepTypeA = (UINT8)
(Info.ReturnObject->Package.Elements[0])->Integer.Value;
*SleepTypeB = (UINT8)
(Info.ReturnObject->Package.Elements[1])->Integer.Value;
}
if (ACPI_FAILURE (Status))
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"While evaluating SleepState [%s], bad Sleep object %p type %s\n",
AcpiGbl_SleepStateNames[SleepState], Info.ReturnObject,
"%s While evaluating SleepState [%s], bad Sleep object %p type %s\n",
AcpiFormatException (Status),
SleepStateName, Info.ReturnObject,
AcpiUtGetObjectTypeName (Info.ReturnObject)));
}
@ -307,9 +322,9 @@ AcpiGetSleepTypeData (
*
* PARAMETERS: RegisterId - Index of ACPI Register to access
*
* RETURN: The bit mask to be used when accessing the register
* RETURN: The bitmask to be used when accessing the register
*
* DESCRIPTION: Map RegisterId into a register bit mask.
* DESCRIPTION: Map RegisterId into a register bitmask.
*
******************************************************************************/
@ -453,7 +468,7 @@ AcpiSetRegister (
/* Always do a register read first so we can insert the new bits */
Status = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK,
BitRegInfo->ParentRegister, &RegisterValue);
BitRegInfo->ParentRegister, &RegisterValue);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
@ -493,7 +508,7 @@ AcpiSetRegister (
BitRegInfo->AccessBitMask, Value);
Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK,
ACPI_REGISTER_PM1_ENABLE, (UINT16) RegisterValue);
ACPI_REGISTER_PM1_ENABLE, (UINT16) RegisterValue);
break;
@ -510,7 +525,7 @@ AcpiSetRegister (
BitRegInfo->AccessBitMask, Value);
Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK,
ACPI_REGISTER_PM1_CONTROL, (UINT16) RegisterValue);
ACPI_REGISTER_PM1_CONTROL, (UINT16) RegisterValue);
break;
@ -525,17 +540,19 @@ AcpiSetRegister (
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM2 control: Read %X from %8.8X%8.8X\n",
RegisterValue,
ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (AcpiGbl_FADT->XPm2CntBlk.Address))));
ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (
AcpiGbl_FADT->XPm2CntBlk.Address))));
ACPI_REGISTER_INSERT_VALUE (RegisterValue, BitRegInfo->BitPosition,
BitRegInfo->AccessBitMask, Value);
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %4.4X to %8.8X%8.8X\n",
RegisterValue,
ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (AcpiGbl_FADT->XPm2CntBlk.Address))));
ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (
AcpiGbl_FADT->XPm2CntBlk.Address))));
Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK,
ACPI_REGISTER_PM2_CONTROL, (UINT8) (RegisterValue));
ACPI_REGISTER_PM2_CONTROL, (UINT8) (RegisterValue));
break;
@ -553,7 +570,9 @@ AcpiSetRegister (
/* Normalize the value that was read */
ACPI_DEBUG_EXEC (RegisterValue = ((RegisterValue & BitRegInfo->AccessBitMask) >> BitRegInfo->BitPosition));
ACPI_DEBUG_EXEC (RegisterValue =
((RegisterValue & BitRegInfo->AccessBitMask) >>
BitRegInfo->BitPosition));
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Set bits: %8.8X actual %8.8X register %X\n",
Value, RegisterValue, BitRegInfo->ParentRegister));
@ -567,7 +586,7 @@ AcpiSetRegister (
*
* PARAMETERS: UseLock - Mutex hw access
* RegisterId - RegisterID + Offset
* ReturnValue - Value that was read from the register
* ReturnValue - Where the register value is returned
*
* RETURN: Status and the value read.
*
@ -661,7 +680,8 @@ AcpiHwRegisterRead (
break;
default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Register ID: %X\n", RegisterId));
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Register ID: %X\n",
RegisterId));
Status = AE_BAD_PARAMETER;
break;
}
@ -879,10 +899,11 @@ AcpiHwLowLevelRead (
return (AE_BAD_PARAMETER);
}
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read: %8.8X width %2d from %8.8X%8.8X (%s)\n",
*Value, Width,
ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Address)),
AcpiUtGetRegionName (Reg->AddressSpaceId)));
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
"Read: %8.8X width %2d from %8.8X%8.8X (%s)\n",
*Value, Width,
ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Address)),
AcpiUtGetRegionName (Reg->AddressSpaceId)));
return (Status);
}
@ -960,10 +981,11 @@ AcpiHwLowLevelWrite (
return (AE_BAD_PARAMETER);
}
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n",
Value, Width,
ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Address)),
AcpiUtGetRegionName (Reg->AddressSpaceId)));
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
"Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n",
Value, Width,
ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Address)),
AcpiUtGetRegionName (Reg->AddressSpaceId)));
return (Status);
}

View File

@ -10,7 +10,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
* All rights reserved.
*
* 2. License
@ -121,20 +121,7 @@
ACPI_MODULE_NAME ("hwsleep")
#define METHOD_NAME__BFS "\\_BFS"
#define METHOD_NAME__GTS "\\_GTS"
#define METHOD_NAME__PTS "\\_PTS"
#define METHOD_NAME__SST "\\_SI._SST"
#define METHOD_NAME__WAK "\\_WAK"
#define ACPI_SST_INDICATOR_OFF 0
#define ACPI_SST_WORKING 1
#define ACPI_SST_WAKING 2
#define ACPI_SST_SLEEPING 3
#define ACPI_SST_SLEEP_CONTEXT 4
/******************************************************************************
/*******************************************************************************
*
* FUNCTION: AcpiSetFirmwareWakingVector
*
@ -143,7 +130,7 @@
*
* RETURN: Status
*
* DESCRIPTION: Access function for dFirmwareWakingVector field in FACS
* DESCRIPTION: Access function for the FirmwareWakingVector field in FACS
*
******************************************************************************/
@ -172,17 +159,17 @@ AcpiSetFirmwareWakingVector (
}
/******************************************************************************
/*******************************************************************************
*
* FUNCTION: AcpiGetFirmwareWakingVector
*
* PARAMETERS: *PhysicalAddress - Output buffer where contents of
* PARAMETERS: *PhysicalAddress - Where the contents of
* the FirmwareWakingVector field of
* the FACS will be stored.
* the FACS will be returned.
*
* RETURN: Status
* RETURN: Status, vector
*
* DESCRIPTION: Access function for FirmwareWakingVector field in FACS
* DESCRIPTION: Access function for the FirmwareWakingVector field in FACS
*
******************************************************************************/
@ -216,7 +203,7 @@ AcpiGetFirmwareWakingVector (
}
/******************************************************************************
/*******************************************************************************
*
* FUNCTION: AcpiEnterSleepStatePrep
*
@ -294,7 +281,7 @@ AcpiEnterSleepStatePrep (
break;
default:
Arg.Integer.Value = ACPI_SST_INDICATOR_OFF; /* Default is indicator off */
Arg.Integer.Value = ACPI_SST_INDICATOR_OFF; /* Default is off */
break;
}
@ -303,14 +290,15 @@ AcpiEnterSleepStatePrep (
Status = AcpiEvaluateObject (NULL, METHOD_NAME__SST, &ArgList, NULL);
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
{
ACPI_REPORT_ERROR (("Method _SST failed, %s\n", AcpiFormatException (Status)));
ACPI_REPORT_ERROR (("Method _SST failed, %s\n",
AcpiFormatException (Status)));
}
return_ACPI_STATUS (AE_OK);
}
/******************************************************************************
/*******************************************************************************
*
* FUNCTION: AcpiEnterSleepState
*
@ -370,7 +358,8 @@ AcpiEnterSleepState (
{
/* Disable BM arbitration */
Status = AcpiSetRegister (ACPI_BITREG_ARB_DISABLE, 1, ACPI_MTX_DO_NOT_LOCK);
Status = AcpiSetRegister (ACPI_BITREG_ARB_DISABLE,
1, ACPI_MTX_DO_NOT_LOCK);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@ -381,14 +370,14 @@ AcpiEnterSleepState (
* 1) Disable/Clear all GPEs
* 2) Enable all wakeup GPEs
*/
Status = AcpiHwDisableAllGpes (ACPI_ISR);
Status = AcpiHwDisableAllGpes ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
AcpiGbl_SystemAwakeAndRunning = FALSE;
Status = AcpiHwEnableAllWakeupGpes (ACPI_ISR);
Status = AcpiHwEnableAllWakeupGpes ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@ -396,16 +385,19 @@ AcpiEnterSleepState (
/* Get current value of PM1A control */
Status = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_CONTROL, &PM1AControl);
Status = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK,
ACPI_REGISTER_PM1_CONTROL, &PM1AControl);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "Entering sleep state [S%d]\n", SleepState));
ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
"Entering sleep state [S%d]\n", SleepState));
/* Clear SLP_EN and SLP_TYP fields */
PM1AControl &= ~(SleepTypeRegInfo->AccessBitMask | SleepEnableRegInfo->AccessBitMask);
PM1AControl &= ~(SleepTypeRegInfo->AccessBitMask |
SleepEnableRegInfo->AccessBitMask);
PM1BControl = PM1AControl;
/* Insert SLP_TYP bits */
@ -420,13 +412,15 @@ AcpiEnterSleepState (
/* Write #1: fill in SLP_TYP data */
Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1A_CONTROL, PM1AControl);
Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK,
ACPI_REGISTER_PM1A_CONTROL, PM1AControl);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1B_CONTROL, PM1BControl);
Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK,
ACPI_REGISTER_PM1B_CONTROL, PM1BControl);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@ -441,13 +435,15 @@ AcpiEnterSleepState (
ACPI_FLUSH_CPU_CACHE ();
Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1A_CONTROL, PM1AControl);
Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK,
ACPI_REGISTER_PM1A_CONTROL, PM1AControl);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1B_CONTROL, PM1BControl);
Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK,
ACPI_REGISTER_PM1B_CONTROL, PM1BControl);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@ -456,10 +452,11 @@ AcpiEnterSleepState (
if (SleepState > ACPI_STATE_S3)
{
/*
* We wanted to sleep > S3, but it didn't happen (by virtue of the fact that
* we are still executing!)
* We wanted to sleep > S3, but it didn't happen (by virtue of the
* fact that we are still executing!)
*
* Wait ten seconds, then try again. This is to get S4/S5 to work on all machines.
* Wait ten seconds, then try again. This is to get S4/S5 to work on
* all machines.
*
* We wait so long to allow chipsets that poll this reg very slowly to
* still read the right value. Ideally, this block would go
@ -467,7 +464,8 @@ AcpiEnterSleepState (
*/
AcpiOsStall (10000000);
Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_CONTROL,
Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK,
ACPI_REGISTER_PM1_CONTROL,
SleepEnableRegInfo->AccessBitMask);
if (ACPI_FAILURE (Status))
{
@ -480,7 +478,8 @@ AcpiEnterSleepState (
Retry = 1000;
do
{
Status = AcpiGetRegister (ACPI_BITREG_WAKE_STATUS, &InValue, ACPI_MTX_DO_NOT_LOCK);
Status = AcpiGetRegister (ACPI_BITREG_WAKE_STATUS, &InValue,
ACPI_MTX_DO_NOT_LOCK);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@ -503,7 +502,7 @@ AcpiEnterSleepState (
}
/******************************************************************************
/*******************************************************************************
*
* FUNCTION: AcpiEnterSleepStateS4bios
*
@ -543,14 +542,14 @@ AcpiEnterSleepStateS4bios (
* 1) Disable/Clear all GPEs
* 2) Enable all wakeup GPEs
*/
Status = AcpiHwDisableAllGpes (ACPI_ISR);
Status = AcpiHwDisableAllGpes ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
AcpiGbl_SystemAwakeAndRunning = FALSE;
Status = AcpiHwEnableAllWakeupGpes (ACPI_ISR);
Status = AcpiHwEnableAllWakeupGpes ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@ -558,11 +557,13 @@ AcpiEnterSleepStateS4bios (
ACPI_FLUSH_CPU_CACHE ();
Status = AcpiOsWritePort (AcpiGbl_FADT->SmiCmd, (UINT32) AcpiGbl_FADT->S4BiosReq, 8);
Status = AcpiOsWritePort (AcpiGbl_FADT->SmiCmd,
(UINT32) AcpiGbl_FADT->S4BiosReq, 8);
do {
AcpiOsStall(1000);
Status = AcpiGetRegister (ACPI_BITREG_WAKE_STATUS, &InValue, ACPI_MTX_DO_NOT_LOCK);
Status = AcpiGetRegister (ACPI_BITREG_WAKE_STATUS, &InValue,
ACPI_MTX_DO_NOT_LOCK);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@ -573,7 +574,7 @@ AcpiEnterSleepStateS4bios (
}
/******************************************************************************
/*******************************************************************************
*
* FUNCTION: AcpiLeaveSleepState
*
@ -656,20 +657,23 @@ AcpiLeaveSleepState (
Status = AcpiEvaluateObject (NULL, METHOD_NAME__SST, &ArgList, NULL);
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
{
ACPI_REPORT_ERROR (("Method _SST failed, %s\n", AcpiFormatException (Status)));
ACPI_REPORT_ERROR (("Method _SST failed, %s\n",
AcpiFormatException (Status)));
}
Arg.Integer.Value = SleepState;
Status = AcpiEvaluateObject (NULL, METHOD_NAME__BFS, &ArgList, NULL);
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
{
ACPI_REPORT_ERROR (("Method _BFS failed, %s\n", AcpiFormatException (Status)));
ACPI_REPORT_ERROR (("Method _BFS failed, %s\n",
AcpiFormatException (Status)));
}
Status = AcpiEvaluateObject (NULL, METHOD_NAME__WAK, &ArgList, NULL);
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
{
ACPI_REPORT_ERROR (("Method _WAK failed, %s\n", AcpiFormatException (Status)));
ACPI_REPORT_ERROR (("Method _WAK failed, %s\n",
AcpiFormatException (Status)));
}
/* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */
@ -678,14 +682,14 @@ AcpiLeaveSleepState (
* 1) Disable/Clear all GPEs
* 2) Enable all runtime GPEs
*/
Status = AcpiHwDisableAllGpes (ACPI_NOT_ISR);
Status = AcpiHwDisableAllGpes ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
AcpiGbl_SystemAwakeAndRunning = TRUE;
Status = AcpiHwEnableAllRuntimeGpes (ACPI_NOT_ISR);
Status = AcpiHwEnableAllRuntimeGpes ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@ -693,9 +697,12 @@ AcpiLeaveSleepState (
/* Enable power button */
(void) AcpiSetRegister(AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].EnableRegisterId,
(void) AcpiSetRegister(
AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].EnableRegisterId,
1, ACPI_MTX_DO_NOT_LOCK);
(void) AcpiSetRegister(AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId,
(void) AcpiSetRegister(
AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId,
1, ACPI_MTX_DO_NOT_LOCK);
/* Enable BM arbitration */
@ -710,7 +717,8 @@ AcpiLeaveSleepState (
Status = AcpiEvaluateObject (NULL, METHOD_NAME__SST, &ArgList, NULL);
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
{
ACPI_REPORT_ERROR (("Method _SST failed, %s\n", AcpiFormatException (Status)));
ACPI_REPORT_ERROR (("Method _SST failed, %s\n",
AcpiFormatException (Status)));
}
return_ACPI_STATUS (Status);

View File

@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
* All rights reserved.
*
* 2. License
@ -124,6 +124,19 @@
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("uteval")
/* Local prototypes */
static void
AcpiUtCopyIdString (
char *Destination,
char *Source,
ACPI_SIZE MaxLength);
static ACPI_STATUS
AcpiUtTranslateOneCid (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_COMPATIBLE_ID *OneCid);
/*******************************************************************************
*
@ -282,6 +295,18 @@ AcpiUtEvaluateObject (
break;
}
if ((AcpiGbl_EnableInterpreterSlack) &&
(!ExpectedReturnBtypes))
{
/*
* We received a return object, but one was not expected. This can
* happen frequently if the "implicit return" feature is enabled.
* Just delete the return object and return AE_OK.
*/
AcpiUtRemoveReference (Info.ReturnObject);
return_ACPI_STATUS (AE_OK);
}
/* Is the return object one of the expected types? */
if (!(ExpectedReturnBtypes & ReturnBtype))
@ -290,8 +315,9 @@ AcpiUtEvaluateObject (
PrefixNode, Path, AE_TYPE);
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Type returned from %s was incorrect: %X\n",
Path, ACPI_GET_OBJECT_TYPE (Info.ReturnObject)));
"Type returned from %s was incorrect: %s, expected Btypes: %X\n",
Path, AcpiUtGetObjectTypeName (Info.ReturnObject),
ExpectedReturnBtypes));
/* On error exit, we must delete the return object */
@ -310,9 +336,9 @@ AcpiUtEvaluateObject (
*
* FUNCTION: AcpiUtEvaluateNumericObject
*
* PARAMETERS: *ObjectName - Object name to be evaluated
* PARAMETERS: ObjectName - Object name to be evaluated
* DeviceNode - Node for the device
* *Address - Where the value is returned
* Address - Where the value is returned
*
* RETURN: Status
*
@ -377,7 +403,6 @@ AcpiUtCopyIdString (
ACPI_SIZE MaxLength)
{
/*
* Workaround for ID strings that have a leading asterisk. This construct
* is not allowed by the ACPI specification (ID strings must be
@ -400,7 +425,7 @@ AcpiUtCopyIdString (
* FUNCTION: AcpiUtExecute_HID
*
* PARAMETERS: DeviceNode - Node for the device
* *Hid - Where the HID is returned
* Hid - Where the HID is returned
*
* RETURN: Status
*
@ -509,7 +534,7 @@ AcpiUtTranslateOneCid (
* FUNCTION: AcpiUtExecute_CID
*
* PARAMETERS: DeviceNode - Node for the device
* *Cid - Where the CID is returned
* ReturnCidList - Where the CID list is returned
*
* RETURN: Status
*
@ -571,10 +596,10 @@ AcpiUtExecute_CID (
CidList->Size = Size;
/*
* A _CID can return either a single compatible ID or a package of compatible
* IDs. Each compatible ID can be one of the following:
* -- Number (32 bit compressed EISA ID) or
* -- String (PCI ID format, e.g. "PCI\VEN_vvvv&DEV_dddd&SUBSYS_ssssssss").
* A _CID can return either a single compatible ID or a package of
* compatible IDs. Each compatible ID can be one of the following:
* 1) Integer (32 bit compressed EISA ID) or
* 2) String (PCI ID format, e.g. "PCI\VEN_vvvv&DEV_dddd&SUBSYS_ssssssss")
*/
/* The _CID object can be either a single CID or a package (list) of CIDs */
@ -623,7 +648,7 @@ AcpiUtExecute_CID (
* FUNCTION: AcpiUtExecute_UID
*
* PARAMETERS: DeviceNode - Node for the device
* *Uid - Where the UID is returned
* Uid - Where the UID is returned
*
* RETURN: Status
*
@ -679,7 +704,7 @@ AcpiUtExecute_UID (
* FUNCTION: AcpiUtExecute_STA
*
* PARAMETERS: DeviceNode - Node for the device
* *Flags - Where the status flags are returned
* Flags - Where the status flags are returned
*
* RETURN: Status
*
@ -735,7 +760,7 @@ AcpiUtExecute_STA (
* FUNCTION: AcpiUtExecute_Sxds
*
* PARAMETERS: DeviceNode - Node for the device
* *Flags - Where the status flags are returned
* Flags - Where the status flags are returned
*
* RETURN: Status
*

View File

@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
* All rights reserved.
*
* 2. License
@ -124,13 +124,14 @@
ACPI_MODULE_NAME ("utglobal")
/******************************************************************************
/*******************************************************************************
*
* FUNCTION: AcpiFormatException
*
* PARAMETERS: Status - The ACPI_STATUS code to be formatted
*
* RETURN: A string containing the exception text
* RETURN: A string containing the exception text. A valid pointer is
* always returned.
*
* DESCRIPTION: This function translates an ACPI exception into an ASCII string.
*
@ -140,8 +141,8 @@ const char *
AcpiFormatException (
ACPI_STATUS Status)
{
const char *Exception = "UNKNOWN_STATUS_CODE";
ACPI_STATUS SubStatus;
const char *Exception = NULL;
ACPI_FUNCTION_NAME ("FormatException");
@ -156,61 +157,60 @@ AcpiFormatException (
if (SubStatus <= AE_CODE_ENV_MAX)
{
Exception = AcpiGbl_ExceptionNames_Env [SubStatus];
break;
}
goto Unknown;
break;
case AE_CODE_PROGRAMMER:
if (SubStatus <= AE_CODE_PGM_MAX)
{
Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus -1];
break;
}
goto Unknown;
break;
case AE_CODE_ACPI_TABLES:
if (SubStatus <= AE_CODE_TBL_MAX)
{
Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus -1];
break;
}
goto Unknown;
break;
case AE_CODE_AML:
if (SubStatus <= AE_CODE_AML_MAX)
{
Exception = AcpiGbl_ExceptionNames_Aml [SubStatus -1];
break;
}
goto Unknown;
break;
case AE_CODE_CONTROL:
if (SubStatus <= AE_CODE_CTRL_MAX)
{
Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus -1];
break;
}
goto Unknown;
break;
default:
goto Unknown;
break;
}
if (!Exception)
{
/* Exception code was not recognized */
return ((const char *) Exception);
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Unknown exception code: 0x%8.8X\n", Status));
Unknown:
return ((const char *) "UNKNOWN_STATUS_CODE");
}
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown exception code: 0x%8.8X\n", Status));
return ((const char *) Exception);
}
/******************************************************************************
/*******************************************************************************
*
* Static global variable initialization.
*
@ -275,6 +275,8 @@ const char *AcpiGbl_HighestDstateNames[4] =
*/
const char *AcpiGbl_ValidOsiStrings[ACPI_NUM_OSI_STRINGS] =
{
/* Operating System Vendor Strings */
"Linux",
"Windows 2000",
"Windows 2001",
@ -283,23 +285,28 @@ const char *AcpiGbl_ValidOsiStrings[ACPI_NUM_OSI_STRINGS] =
"Windows 2001 SP1",
"Windows 2001 SP2",
"Windows 2001 SP3",
"Windows 2001 SP4"
"Windows 2001 SP4",
/* Feature Group Strings */
"Extended Address Space Descriptor"
};
/******************************************************************************
/*******************************************************************************
*
* Namespace globals
*
******************************************************************************/
/*
* Predefined ACPI Names (Built-in to the Interpreter)
*
* NOTES:
* 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.
*/
const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] =
{
@ -308,16 +315,18 @@ const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] =
{"_SB_", ACPI_TYPE_DEVICE, NULL},
{"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_TZ_", ACPI_TYPE_THERMAL, NULL},
{"_REV", ACPI_TYPE_INTEGER, "2"},
{"_REV", ACPI_TYPE_INTEGER, (char *) ACPI_CA_SUPPORT_LEVEL},
{"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
{"_GL_", ACPI_TYPE_MUTEX, "0"},
{"_GL_", ACPI_TYPE_MUTEX, (char *) 1},
#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
{"_OSI", ACPI_TYPE_METHOD, "1"},
{"_OSI", ACPI_TYPE_METHOD, (char *) 1},
#endif
{NULL, ACPI_TYPE_ANY, NULL} /* Table terminator */
};
/* Table terminator */
{NULL, ACPI_TYPE_ANY, NULL}
};
/*
* Properties of the ACPI Object Types, both internal and external.
@ -362,22 +371,25 @@ const UINT8 AcpiGbl_NsProperties[] =
/* 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'};
{
'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
* integer (multiple of 4)
*
* RETURN: Ascii character
* RETURN: The converted Ascii character
*
* DESCRIPTION: Convert a hex digit to an ascii character
* DESCRIPTION: Convert a hex digit to an Ascii character
*
****************************************************************************/
******************************************************************************/
char
AcpiUtHexToAsciiChar (
@ -389,7 +401,7 @@ AcpiUtHexToAsciiChar (
}
/******************************************************************************
/*******************************************************************************
*
* Table name globals
*
@ -398,7 +410,7 @@ AcpiUtHexToAsciiChar (
* that are not used by the subsystem are simply ignored.
*
* Do NOT add any table to this list that is not consumed directly by this
* subsystem.
* subsystem (No MADT, ECDT, SBST, etc.)
*
******************************************************************************/
@ -435,6 +447,7 @@ ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG] =
/* ACPI_BITREG_SLEEP_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_STATUS},
/* ACPI_BITREG_RT_CLOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_STATUS},
/* ACPI_BITREG_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_WAKE_STATUS, ACPI_BITMASK_WAKE_STATUS},
/* ACPI_BITREG_PCIEXP_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_PCIEXP_WAKE_STATUS, ACPI_BITMASK_PCIEXP_WAKE_STATUS},
/* ACPI_BITREG_TIMER_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_TIMER_ENABLE, ACPI_BITMASK_TIMER_ENABLE},
/* ACPI_BITREG_GLOBAL_LOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_ENABLE},
@ -442,6 +455,7 @@ ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG] =
/* ACPI_BITREG_SLEEP_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
/* ACPI_BITREG_RT_CLOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_ENABLE},
/* ACPI_BITREG_WAKE_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, 0, 0},
/* ACPI_BITREG_PCIEXP_WAKE_DISABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE, ACPI_BITMASK_PCIEXP_WAKE_DISABLE},
/* ACPI_BITREG_SCI_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SCI_ENABLE, ACPI_BITMASK_SCI_ENABLE},
/* ACPI_BITREG_BUS_MASTER_RLD */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_BUS_MASTER_RLD, ACPI_BITMASK_BUS_MASTER_RLD},
@ -463,7 +477,7 @@ ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] =
/* 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
*
@ -473,7 +487,7 @@ ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] =
*
* DESCRIPTION: Translate a Space ID into a name string (Debug only)
*
****************************************************************************/
******************************************************************************/
/* Region type decoding */
@ -501,7 +515,6 @@ AcpiUtGetRegionName (
{
return ("UserDefinedRegion");
}
else if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS)
{
return ("InvalidSpaceId");
@ -511,7 +524,7 @@ AcpiUtGetRegionName (
}
/*****************************************************************************
/*******************************************************************************
*
* FUNCTION: AcpiUtGetEventName
*
@ -521,17 +534,19 @@ AcpiUtGetRegionName (
*
* DESCRIPTION: Translate a Event ID into a name string (Debug only)
*
****************************************************************************/
******************************************************************************/
/* Event type decoding */
static const char *AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS] =
{
/*! [Begin] no source code translation (keep these strings as-is) */
"PM_Timer",
"GlobalLock",
"PowerButton",
"SleepButton",
"RealTimeClock",
/*! [End] no source code translation !*/
};
@ -549,7 +564,7 @@ AcpiUtGetEventName (
}
/*****************************************************************************
/*******************************************************************************
*
* FUNCTION: AcpiUtGetTypeName
*
@ -559,21 +574,23 @@ AcpiUtGetEventName (
*
* 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.
* 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";
#define TYPE_NAME_LENGTH 12 /* Maximum length of each string */
static const char *AcpiGbl_NsTypeNames[] = /* printable names of ACPI types */
/* Printable names of the ACPI object types */
static const char *AcpiGbl_NsTypeNames[] =
{
/*! [Begin] no source code translation (keep these strings as-is) */
/* 00 */ "Untyped",
/* 01 */ "Integer",
/* 02 */ "String",
@ -605,6 +622,7 @@ static const char *AcpiGbl_NsTypeNames[] = /* printable names of AC
/* 28 */ "Extra",
/* 29 */ "Data",
/* 30 */ "Invalid"
/*! [End] no source code translation !*/
};
@ -636,7 +654,7 @@ AcpiUtGetObjectTypeName (
}
/*****************************************************************************
/*******************************************************************************
*
* FUNCTION: AcpiUtGetNodeName
*
@ -646,7 +664,7 @@ AcpiUtGetObjectTypeName (
*
* DESCRIPTION: Validate the node and return the node's ACPI name.
*
****************************************************************************/
******************************************************************************/
char *
AcpiUtGetNodeName (
@ -690,7 +708,7 @@ AcpiUtGetNodeName (
}
/*****************************************************************************
/*******************************************************************************
*
* FUNCTION: AcpiUtGetDescriptorName
*
@ -700,10 +718,13 @@ AcpiUtGetNodeName (
*
* DESCRIPTION: Validate object and return the descriptor type
*
****************************************************************************/
******************************************************************************/
static const char *AcpiGbl_DescTypeNames[] = /* printable names of descriptor types */
/* Printable names of object descriptor types */
static const char *AcpiGbl_DescTypeNames[] =
{
/*! [Begin] no source code translation (keep these ASL Keywords as-is) */
/* 00 */ "Invalid",
/* 01 */ "Cached",
/* 02 */ "State-Generic",
@ -720,6 +741,7 @@ static const char *AcpiGbl_DescTypeNames[] = /* printable names of
/* 13 */ "Parser",
/* 14 */ "Operand",
/* 15 */ "Node"
/*! [End] no source code translation !*/
};
@ -748,17 +770,18 @@ AcpiUtGetDescriptorName (
* Strings and procedures used for debug only
*/
/*****************************************************************************
/*******************************************************************************
*
* FUNCTION: AcpiUtGetMutexName
*
* PARAMETERS: None.
* PARAMETERS: MutexId - The predefined ID for this mutex.
*
* RETURN: Status
* 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 (
@ -772,21 +795,20 @@ AcpiUtGetMutexName (
return (AcpiGbl_MutexNames[MutexId]);
}
#endif
/*****************************************************************************
/*******************************************************************************
*
* FUNCTION: AcpiUtValidObjectType
*
* PARAMETERS: Type - Object type to be validated
*
* RETURN: TRUE if valid object type
* RETURN: TRUE if valid object type, FALSE otherwise
*
* DESCRIPTION: Validate an object type
*
****************************************************************************/
******************************************************************************/
BOOLEAN
AcpiUtValidObjectType (
@ -804,121 +826,37 @@ AcpiUtValidObjectType (
}
/****************************************************************************
*
* FUNCTION: AcpiUtAllocateOwnerId
*
* PARAMETERS: IdType - Type of ID (method or table)
*
* DESCRIPTION: Allocate a table or method owner id
*
***************************************************************************/
ACPI_OWNER_ID
AcpiUtAllocateOwnerId (
UINT32 IdType)
{
ACPI_OWNER_ID OwnerId = 0xFFFF;
ACPI_FUNCTION_TRACE ("UtAllocateOwnerId");
if (ACPI_FAILURE (AcpiUtAcquireMutex (ACPI_MTX_CACHES)))
{
return (0);
}
switch (IdType)
{
case ACPI_OWNER_TYPE_TABLE:
OwnerId = AcpiGbl_NextTableOwnerId;
AcpiGbl_NextTableOwnerId++;
/* Check for wraparound */
if (AcpiGbl_NextTableOwnerId == ACPI_FIRST_METHOD_ID)
{
AcpiGbl_NextTableOwnerId = ACPI_FIRST_TABLE_ID;
ACPI_REPORT_WARNING (("Table owner ID wraparound\n"));
}
break;
case ACPI_OWNER_TYPE_METHOD:
OwnerId = AcpiGbl_NextMethodOwnerId;
AcpiGbl_NextMethodOwnerId++;
if (AcpiGbl_NextMethodOwnerId == ACPI_FIRST_TABLE_ID)
{
/* Check for wraparound */
AcpiGbl_NextMethodOwnerId = ACPI_FIRST_METHOD_ID;
}
break;
default:
break;
}
(void) AcpiUtReleaseMutex (ACPI_MTX_CACHES);
return_VALUE (OwnerId);
}
/****************************************************************************
/*******************************************************************************
*
* FUNCTION: AcpiUtInitGlobals
*
* PARAMETERS: none
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Init library globals. All globals that require specific
* initialization should be initialized here!
*
***************************************************************************/
******************************************************************************/
void
AcpiUtInitGlobals (
void)
{
ACPI_STATUS Status;
UINT32 i;
ACPI_FUNCTION_TRACE ("UtInitGlobals");
/* Memory allocation and cache lists */
/* Create all memory caches */
ACPI_MEMSET (AcpiGbl_MemoryLists, 0, sizeof (ACPI_MEMORY_LIST) * ACPI_NUM_MEM_LISTS);
AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_GENERIC_STATE *) NULL)->Common.Next), NULL);
AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_PARSE_OBJECT *) NULL)->Common.Next), NULL);
AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_PARSE_OBJECT *) NULL)->Common.Next), NULL);
AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_OPERAND_OBJECT *) NULL)->Cache.Next), NULL);
AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_WALK_STATE *) NULL)->Next), NULL);
AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].ObjectSize = sizeof (ACPI_NAMESPACE_NODE);
AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].ObjectSize = sizeof (ACPI_GENERIC_STATE);
AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].ObjectSize = sizeof (ACPI_PARSE_OBJ_COMMON);
AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].ObjectSize = sizeof (ACPI_PARSE_OBJ_NAMED);
AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].ObjectSize = sizeof (ACPI_OPERAND_OBJECT);
AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].ObjectSize = sizeof (ACPI_WALK_STATE);
AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].MaxCacheDepth = ACPI_MAX_STATE_CACHE_DEPTH;
AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].MaxCacheDepth = ACPI_MAX_PARSE_CACHE_DEPTH;
AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].MaxCacheDepth = ACPI_MAX_EXTPARSE_CACHE_DEPTH;
AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].MaxCacheDepth = ACPI_MAX_OBJECT_CACHE_DEPTH;
AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].MaxCacheDepth = ACPI_MAX_WALK_CACHE_DEPTH;
ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_GLOBAL].ListName = "Global Memory Allocation");
ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].ListName = "Namespace Nodes");
ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].ListName = "State Object Cache");
ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].ListName = "Parse Node Cache");
ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].ListName = "Extended Parse Node Cache");
ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].ListName = "Operand Object Cache");
ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].ListName = "Tree Walk Node Cache");
Status = AcpiUtCreateCaches ();
if (ACPI_FAILURE (Status))
{
return;
}
/* ACPI table structure */
@ -933,7 +871,7 @@ AcpiUtInitGlobals (
for (i = 0; i < NUM_MUTEX; i++)
{
AcpiGbl_MutexInfo[i].Mutex = NULL;
AcpiGbl_MutexInfo[i].OwnerId = ACPI_MUTEX_NOT_ACQUIRED;
AcpiGbl_MutexInfo[i].ThreadId = ACPI_MUTEX_NOT_ACQUIRED;
AcpiGbl_MutexInfo[i].UseCount = 0;
}
@ -974,8 +912,10 @@ AcpiUtInitGlobals (
AcpiGbl_NsLookupCount = 0;
AcpiGbl_PsFindCount = 0;
AcpiGbl_AcpiHardwarePresent = TRUE;
AcpiGbl_NextTableOwnerId = ACPI_FIRST_TABLE_ID;
AcpiGbl_NextMethodOwnerId = ACPI_FIRST_METHOD_ID;
AcpiGbl_OwnerIdMask = 0;
AcpiGbl_TraceMethodName = 0;
AcpiGbl_TraceDbgLevel = 0;
AcpiGbl_TraceDbgLayer = 0;
AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT;