Fifth lint pass - CLEAN for 32-bit and 64-bit

date	2002.04.12.20.46.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 17:13:56 +00:00
parent 570bb863c6
commit e78d187040
2 changed files with 92 additions and 82 deletions

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dswload - Dispatcher namespace load callbacks
* $Revision: 1.61 $
* $Revision: 1.66 $
*
*****************************************************************************/
@ -208,16 +208,16 @@ AcpiDsLoad1BeginOp (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
if (Op && (Op->Opcode == AML_INT_NAMEDFIELD_OP))
if (Op && (Op->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP))
{
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
}
/* We are only interested in opcodes that have an associated name */
if (WalkState->Op)
if (Op)
{
if (!(WalkState->OpInfo->Flags & AML_NAMED))
if (!(WalkState->OpInfo->Flags & AML_NAMED))
{
*OutOp = Op;
return (AE_OK);
@ -225,7 +225,7 @@ AcpiDsLoad1BeginOp (
/* Check if this object has already been installed in the namespace */
if (Op->Node)
if (Op->Common.Node)
{
*OutOp = Op;
return (AE_OK);
@ -239,7 +239,7 @@ AcpiDsLoad1BeginOp (
ObjectType = WalkState->OpInfo->ObjectType;
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"State=%p Op=%p Type=%x\n", WalkState, Op, ObjectType));
"State=%p Op=%p Type=%X\n", WalkState, Op, ObjectType));
/*
* Enter the named type into the internal namespace. We enter the name
@ -267,13 +267,13 @@ AcpiDsLoad1BeginOp (
/* Initialize */
((ACPI_PARSE2_OBJECT *)Op)->Name = Node->Name;
Op->Named.Name = Node->Name.Integer;
/*
* Put the Node in the "op" object that the parser uses, so we
* can get it again quickly when this scope is closed
*/
Op->Node = Node;
Op->Common.Node = Node;
AcpiPsAppendArg (AcpiPsGetParentScope (&WalkState->ParserState), Op);
*OutOp = Op;
@ -302,6 +302,7 @@ AcpiDsLoad1EndOp (
{
ACPI_PARSE_OBJECT *Op;
ACPI_OBJECT_TYPE ObjectType;
ACPI_STATUS Status = AE_OK;
ACPI_FUNCTION_NAME ("DsLoad1EndOp");
@ -327,27 +328,30 @@ AcpiDsLoad1EndOp (
WalkState->Opcode == AML_BANK_FIELD_OP ||
WalkState->Opcode == AML_INDEX_FIELD_OP)
{
AcpiDsInitFieldObjects (Op, WalkState);
Status = AcpiDsInitFieldObjects (Op, WalkState);
}
return (AE_OK);
return (Status);
}
if (Op->Opcode == AML_REGION_OP)
if (Op->Common.AmlOpcode == AML_REGION_OP)
{
/*Status = */AcpiExCreateRegion (((ACPI_PARSE2_OBJECT *) Op)->Data,
((ACPI_PARSE2_OBJECT *) Op)->Length,
(ACPI_ADR_SPACE_TYPE) ((Op->Value.Arg)->Value.Integer), WalkState);
Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
(ACPI_ADR_SPACE_TYPE) ((Op->Common.Value.Arg)->Common.Value.Integer), WalkState);
if (ACPI_FAILURE (Status))
{
return (Status);
}
}
if (Op->Opcode == AML_NAME_OP)
if (Op->Common.AmlOpcode == AML_NAME_OP)
{
/* For Name opcode, get the object type from the argument */
if (Op->Value.Arg)
if (Op->Common.Value.Arg)
{
ObjectType = (AcpiPsGetOpcodeInfo ((Op->Value.Arg)->Opcode))->ObjectType;
Op->Node->Type = (UINT8) ObjectType;
ObjectType = (AcpiPsGetOpcodeInfo ((Op->Common.Value.Arg)->Common.AmlOpcode))->ObjectType;
Op->Common.Node->Type = (UINT8) ObjectType;
}
}
@ -358,10 +362,10 @@ AcpiDsLoad1EndOp (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s): Popping scope for Op %p\n",
AcpiUtGetTypeName (ObjectType), Op));
AcpiDsScopeStackPop (WalkState);
Status = AcpiDsScopeStackPop (WalkState);
}
return (AE_OK);
return (Status);
}
@ -389,7 +393,6 @@ AcpiDsLoad2BeginOp (
ACPI_STATUS Status;
ACPI_OBJECT_TYPE ObjectType;
NATIVE_CHAR *BufferPtr;
void *Original = NULL;
ACPI_FUNCTION_NAME ("DsLoad2BeginOp");
@ -415,7 +418,7 @@ AcpiDsLoad2BeginOp (
{
/* For Namepath op, get the path string */
BufferPtr = Op->Value.String;
BufferPtr = Op->Common.Value.String;
if (!BufferPtr)
{
/* No name, just exit */
@ -427,7 +430,7 @@ AcpiDsLoad2BeginOp (
{
/* Get name from the op */
BufferPtr = (NATIVE_CHAR *) &((ACPI_PARSE2_OBJECT *)Op)->Name;
BufferPtr = (NATIVE_CHAR *) &Op->Named.Name;
}
}
else
@ -442,7 +445,7 @@ AcpiDsLoad2BeginOp (
ObjectType = WalkState->OpInfo->ObjectType;
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"State=%p Op=%p Type=%x\n", WalkState, Op, ObjectType));
"State=%p Op=%p Type=%X\n", WalkState, Op, ObjectType));
if (WalkState->Opcode == AML_FIELD_OP ||
@ -463,10 +466,13 @@ AcpiDsLoad2BeginOp (
}
else
{
if (Op && Op->Node)
/* All other opcodes */
if (Op && Op->Common.Node)
{
Original = Op->Node;
Node = Op->Node;
/* This op/node was previously entered into the namespace */
Node = Op->Common.Node;
if (AcpiNsOpensScope (ObjectType))
{
@ -503,26 +509,21 @@ AcpiDsLoad2BeginOp (
/* Initialize the new op */
((ACPI_PARSE2_OBJECT *)Op)->Name = Node->Name;
*OutOp = Op;
if (Node)
{
Op->Named.Name = Node->Name.Integer;
}
if (OutOp)
{
*OutOp = Op;
}
}
/*
* Put the Node in the "op" object that the parser uses, so we
* can get it again quickly when this scope is closed
*/
Op->Node = Node;
if (Original)
{
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "old %p new %p\n", Original, Node));
if (Original != Node)
{
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Lookup match error: old %p new %p\n", Original, Node));
}
}
Op->Common.Node = Node;
}
return (Status);
@ -570,12 +571,12 @@ AcpiDsLoad2EndOp (
return (AE_OK);
}
if (Op->Opcode == AML_SCOPE_OP)
if (Op->Common.AmlOpcode == AML_SCOPE_OP)
{
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"Ending scope Op=%p State=%p\n", Op, WalkState));
if (((ACPI_PARSE2_OBJECT *)Op)->Name == ACPI_UINT16_MAX)
if (Op->Named.Name == ACPI_UINT16_MAX)
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unnamed scope! Op=%p State=%p\n",
Op, WalkState));
@ -590,7 +591,7 @@ AcpiDsLoad2EndOp (
* Get the Node/name from the earlier lookup
* (It was saved in the *op structure)
*/
Node = Op->Node;
Node = Op->Common.Node;
/*
* Put the Node on the object stack (Contains the ACPI Name of
@ -605,7 +606,12 @@ AcpiDsLoad2EndOp (
{
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n",
AcpiUtGetTypeName (ObjectType), Op));
AcpiDsScopeStackPop (WalkState);
Status = AcpiDsScopeStackPop (WalkState);
if (ACPI_FAILURE (Status))
{
return (Status);
}
}
/*
@ -638,11 +644,11 @@ AcpiDsLoad2EndOp (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"Create-Load [%s] State=%p Op=%p NamedObj=%p\n",
AcpiPsGetOpcodeName (Op->Opcode), WalkState, Op, Node));
AcpiPsGetOpcodeName (Op->Common.AmlOpcode), WalkState, Op, Node));
/* Decode the opcode */
Arg = Op->Value.Arg;
Arg = Op->Common.Value.Arg;
switch (WalkState->OpInfo->Type)
{
@ -658,22 +664,26 @@ AcpiDsLoad2EndOp (
case AML_TYPE_NAMED_FIELD:
switch (Op->Opcode)
switch (Op->Common.AmlOpcode)
{
case AML_INDEX_FIELD_OP:
Status = AcpiDsCreateIndexField (Op, (ACPI_HANDLE) Arg->Node,
Status = AcpiDsCreateIndexField (Op, (ACPI_HANDLE) Arg->Common.Node,
WalkState);
break;
case AML_BANK_FIELD_OP:
Status = AcpiDsCreateBankField (Op, Arg->Node, WalkState);
Status = AcpiDsCreateBankField (Op, Arg->Common.Node, WalkState);
break;
case AML_FIELD_OP:
Status = AcpiDsCreateField (Op, Arg->Node, WalkState);
Status = AcpiDsCreateField (Op, Arg->Common.Node, WalkState);
break;
default:
/* All NAMED_FIELD opcodes must be handled above */
break;
}
break;
@ -687,7 +697,7 @@ AcpiDsLoad2EndOp (
goto Cleanup;
}
switch (Op->Opcode)
switch (Op->Common.AmlOpcode)
{
case AML_PROCESSOR_OP:
@ -739,7 +749,7 @@ AcpiDsLoad2EndOp (
case AML_TYPE_NAMED_COMPLEX:
switch (Op->Opcode)
switch (Op->Common.AmlOpcode)
{
case AML_METHOD_OP:
/*
@ -757,9 +767,8 @@ AcpiDsLoad2EndOp (
goto Cleanup;
}
Status = AcpiExCreateMethod (((ACPI_PARSE2_OBJECT *) Op)->Data,
((ACPI_PARSE2_OBJECT *) Op)->Length,
WalkState);
Status = AcpiExCreateMethod (Op->Named.Data,
Op->Named.Length, WalkState);
}
break;
@ -793,6 +802,11 @@ AcpiDsLoad2EndOp (
Status = AcpiDsCreateNode (WalkState, Node, Op);
break;
default:
/* All NAMED_COMPLEX opcodes must be handled above */
break;
}
break;
@ -812,7 +826,7 @@ AcpiDsLoad2EndOp (
/*
* Lookup the method name and save the Node
*/
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Value.String,
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS2,
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
WalkState, &(NewNode));
@ -831,7 +845,7 @@ AcpiDsLoad2EndOp (
* for now, we will put it in the "op" object that the parser uses, so we
* can get it again at the end of this scope
*/
Op->Node = NewNode;
Op->Common.Node = NewNode;
}
break;

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes)
* $Revision: 1.75 $
* $Revision: 1.63 $
*
*****************************************************************************/
@ -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 - 2002, Intel Corp.
* All rights reserved.
*
* 2. License
@ -160,7 +160,7 @@ AcpiExAddTable (
/* Create an object to be the table handle */
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_REFERENCE);
ObjDesc = AcpiUtCreateInternalObject (INTERNAL_TYPE_REFERENCE);
if (!ObjDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@ -168,14 +168,12 @@ AcpiExAddTable (
/* Install the new table into the local data structures */
ACPI_MEMSET (&TableInfo, 0, sizeof (ACPI_TABLE_DESC));
TableInfo.Type = 5;
TableInfo.Pointer = Table;
TableInfo.Length = (ACPI_SIZE) Table->Length;
TableInfo.Length = Table->Length;
TableInfo.Allocation = ACPI_MEM_ALLOCATED;
TableInfo.BasePointer = Table;
Status = AcpiTbInstallTable (&TableInfo);
Status = AcpiTbInstallTable (NULL, &TableInfo);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@ -236,7 +234,6 @@ AcpiExLoadTableOp (
ACPI_FUNCTION_TRACE ("ExLoadTableOp");
#if 0
/*
* Make sure that the signature does not match one of the tables that
* is already loaded.
@ -248,7 +245,6 @@ AcpiExLoadTableOp (
return_ACPI_STATUS (AE_ALREADY_EXISTS);
}
#endif
/* Find the ACPI table */
@ -262,7 +258,7 @@ AcpiExLoadTableOp (
return_ACPI_STATUS (Status);
}
/* Table not found, return an Integer=0 and AE_OK */
/* Not found, return an Integer=0 and AE_OK */
DdbHandle = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
if (!DdbHandle)
@ -341,11 +337,9 @@ AcpiExLoadTableOp (
if (ACPI_FAILURE (Status))
{
(void) AcpiExUnloadTable (DdbHandle);
return_ACPI_STATUS (Status);
}
}
*ReturnDesc = DdbHandle;
return_ACPI_STATUS (Status);
}
@ -389,7 +383,7 @@ AcpiExLoadOp (
case ACPI_TYPE_REGION:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Load from Region %p %s\n",
ObjDesc, AcpiUtGetObjectTypeName (ObjDesc)));
ObjDesc, AcpiUtGetTypeName (ObjDesc->Common.Type)));
/* Get the table header */
@ -433,12 +427,13 @@ AcpiExLoadOp (
break;
case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Load from Field %p %s\n",
ObjDesc, AcpiUtGetObjectTypeName (ObjDesc)));
ObjDesc, AcpiUtGetTypeName (ObjDesc->Common.Type)));
/*
* The length of the field must be at least as large as the table.
@ -462,11 +457,11 @@ AcpiExLoadOp (
/* The table must be either an SSDT or a PSDT */
if ((!ACPI_STRNCMP (TablePtr->Signature,
AcpiGbl_TableData[ACPI_TABLE_PSDT].Signature,
AcpiGbl_TableData[ACPI_TABLE_PSDT].SigLength)) &&
AcpiGbl_AcpiTableData[ACPI_TABLE_PSDT].Signature,
AcpiGbl_AcpiTableData[ACPI_TABLE_PSDT].SigLength)) &&
(!ACPI_STRNCMP (TablePtr->Signature,
AcpiGbl_TableData[ACPI_TABLE_SSDT].Signature,
AcpiGbl_TableData[ACPI_TABLE_SSDT].SigLength)))
AcpiGbl_AcpiTableData[ACPI_TABLE_SSDT].Signature,
AcpiGbl_AcpiTableData[ACPI_TABLE_SSDT].SigLength)))
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Table has invalid signature [%4.4s], must be SSDT or PSDT\n",
@ -524,7 +519,7 @@ ACPI_STATUS
AcpiExUnloadTable (
ACPI_OPERAND_OBJECT *DdbHandle)
{
ACPI_STATUS Status = AE_OK;
ACPI_STATUS Status = AE_NOT_IMPLEMENTED;
ACPI_OPERAND_OBJECT *TableDesc = DdbHandle;
ACPI_TABLE_DESC *TableInfo;
@ -540,7 +535,8 @@ AcpiExUnloadTable (
*/
if ((!DdbHandle) ||
(ACPI_GET_DESCRIPTOR_TYPE (DdbHandle) != ACPI_DESC_TYPE_OPERAND) ||
(ACPI_GET_OBJECT_TYPE (DdbHandle) != ACPI_TYPE_LOCAL_REFERENCE))
(((ACPI_OPERAND_OBJECT *)DdbHandle)->Common.Type !=
INTERNAL_TYPE_REFERENCE))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}