Moved object init here

date	2000.01.28.23.16.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 17:04:23 +00:00
parent 9441ab6a4f
commit e768d037fd

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psxobj - Parser/Interpreter interface object conversion routines
* Module Name: psxobj - Parser/Interpreter interface object management routines
*
*****************************************************************************/
@ -117,18 +117,123 @@
#define __PSXOBJ_C__
#include <acpi.h>
#include <interpreter.h>
#include <amlcode.h>
#include <namespace.h>
#include <parser.h>
#include <psopcode.h>
#include <interpreter.h>
#include <namespace.h>
#define _COMPONENT PARSER
MODULE_NAME ("psxobj");
/*******************************************************************************
*
* FUNCTION: PsxInitOneObject
*
* PARAMETERS: ObjHandle - NTE of the object
* Level - Current nesting level
* Context - Points to a init info struct
* ReturnValue - Not used
*
* RETURN: Status
*
* DESCRIPTION: Callback from AcpiWalkNamespace. Invoked for every object within
* the namespace.
*
* Currently, the only objects that require initialization are:
* 1) Methods
* 2) Op Regions
*
******************************************************************************/
ACPI_STATUS
PsxInitOneObject (
ACPI_HANDLE ObjHandle,
UINT32 Level,
void *Context,
void **ReturnValue)
{
ACPI_OBJECT_TYPE Type;
Type = NsGetType (ObjHandle);
switch (Type)
{
case ACPI_TYPE_Region:
PsxInitializeRegion (ObjHandle);
((INIT_WALK_INFO *) Context)->OpRegionCount++;
break;
case ACPI_TYPE_Method:
PsxParseMethod (ObjHandle);
((INIT_WALK_INFO *) Context)->MethodCount++;
break;
default:
break;
}
/*
* We ignore errors from above, and always return OK, since
* we don't want to abort the walk on a single error.
*/
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: PsxInitializeObjects
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Walk the entire namespace and perform any necessary initialization
* on the objects found therein
*
******************************************************************************/
ACPI_STATUS
PsxInitializeObjects (void)
{
ACPI_STATUS Status;
INIT_WALK_INFO Info;
FUNCTION_TRACE ("PsxInitializeObjects");
DEBUG_PRINT (TRACE_PARSE, ("PsxInitializeObjects: **** Starting initialization of namespace objects ****\n"));
Info.MethodCount = 0;
Info.OpRegionCount = 0;
/* Walk entire namespace from the root */
Status = AcpiWalkNamespace (ACPI_TYPE_Any, Gbl_RootObject, ACPI_INT_MAX, PsxInitOneObject,
&Info, NULL);
if (ACPI_FAILURE (Status))
{
DEBUG_PRINT (ACPI_ERROR, ("PsxInitializeObjects: WalkNamespace failed! %x\n", Status));
}
DEBUG_PRINT (TRACE_PARSE, ("PsxInitializeObjects: %d Control Methods found\n", Info.MethodCount));
DEBUG_PRINT (TRACE_PARSE, ("PsxInitializeObjects: %d Op Regions found\n", Info.OpRegionCount));
return_ACPI_STATUS (AE_OK);
}
/*****************************************************************************
*