mirror of
https://github.com/acpica/acpica/
synced 2025-02-24 17:34:43 +03:00
Eliminated "Name Tables" and replaced with "Named Objects"
date 2000.08.29.00.38.00; author rmoore1; state Exp;
This commit is contained in:
parent
5a17f4ce50
commit
9d1a2a2506
@ -1,7 +1,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: cmalloc - local memory allocation routines
|
||||
* $Revision: 1.70 $
|
||||
* $Revision: 1.71 $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -500,9 +500,14 @@ AcpiCmDumpAllocationInfo (
|
||||
(AcpiGbl_MaxConcurrentObjectSize + 1023) / 1024));
|
||||
|
||||
DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
|
||||
("%30s: %4d (%3d Kb)\n", "Current Name Tables",
|
||||
AcpiGbl_CurrentNameTableCount,
|
||||
(AcpiGbl_CurrentNameTableSize + 1023) / 1024));
|
||||
("%30s: %4d (%3d Kb)\n", "Current Named Objects",
|
||||
AcpiGbl_CurrentNamedObjectCount,
|
||||
(AcpiGbl_CurrentNamedObjectSize + 1023) / 1024));
|
||||
|
||||
DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
|
||||
("%30s: %4d (%3d Kb)\n", "Max Named Objects",
|
||||
AcpiGbl_MaxConcurrentNamedObjectCount,
|
||||
((AcpiGbl_MaxConcurrentNamedObjectCount * sizeof (ACPI_NAMED_OBJECT)) + 1023) / 1024));
|
||||
|
||||
DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
|
||||
("%30s: %4d (%3d Kb)\n", "Total (all) internal objects",
|
||||
@ -589,7 +594,7 @@ AcpiCmDumpCurrentAllocations (
|
||||
|
||||
case ACPI_DESC_TYPE_NAMED:
|
||||
DEBUG_PRINT_RAW (TRACE_ALLOCATIONS | TRACE_TABLES,
|
||||
(" NTE Name %4.4s",
|
||||
(" Named Object %4.4s",
|
||||
&((ACPI_NAMED_OBJECT*)(Element->Address))->Name));
|
||||
break;
|
||||
|
||||
|
@ -162,7 +162,7 @@ AcpiCmBuildExternalSimpleObject (
|
||||
UINT32 *BufferSpaceUsed)
|
||||
{
|
||||
UINT32 Length = 0;
|
||||
char *SourcePtr = NULL;
|
||||
UINT8 *SourcePtr = NULL;
|
||||
|
||||
|
||||
FUNCTION_TRACE ("CmBuildExternalSimpleObject");
|
||||
@ -199,8 +199,8 @@ AcpiCmBuildExternalSimpleObject (
|
||||
|
||||
Length = InternalObj->String.Length;
|
||||
ExternalObj->String.Length = InternalObj->String.Length;
|
||||
ExternalObj->String.Pointer = (char *) DataSpace;
|
||||
SourcePtr = InternalObj->String.Pointer;
|
||||
ExternalObj->String.Pointer = (NATIVE_CHAR *) DataSpace;
|
||||
SourcePtr = (UINT8 *) InternalObj->String.Pointer;
|
||||
break;
|
||||
|
||||
|
||||
@ -209,7 +209,7 @@ AcpiCmBuildExternalSimpleObject (
|
||||
Length = InternalObj->Buffer.Length;
|
||||
ExternalObj->Buffer.Length = InternalObj->Buffer.Length;
|
||||
ExternalObj->Buffer.Pointer = DataSpace;
|
||||
SourcePtr = (char *) InternalObj->Buffer.Pointer;
|
||||
SourcePtr = (UINT8 *) InternalObj->Buffer.Pointer;
|
||||
break;
|
||||
|
||||
|
||||
@ -228,7 +228,7 @@ AcpiCmBuildExternalSimpleObject (
|
||||
*/
|
||||
|
||||
ExternalObj->Type = ACPI_TYPE_ANY;
|
||||
ExternalObj->Reference.Handle = InternalObj->Reference.Nte;
|
||||
ExternalObj->Reference.Handle = InternalObj->Reference.NameDesc;
|
||||
break;
|
||||
|
||||
|
||||
@ -365,10 +365,11 @@ AcpiCmBuildExternalPackageObject (
|
||||
|
||||
|
||||
/*
|
||||
* Check for 1) Null object -- OK, this can happen if package
|
||||
* Check for
|
||||
* 1) Null object -- OK, this can happen if package
|
||||
* element is never initialized
|
||||
* 2) Not an internal object - can be an NTE instead
|
||||
* 3) Any internal object other than a package.
|
||||
* 2) Not an internal object - can be NamedObject instead
|
||||
* 3) Any internal object other than a package.
|
||||
*
|
||||
* The more complex package case is handled later
|
||||
*/
|
||||
@ -475,8 +476,6 @@ AcpiCmBuildExternalPackageObject (
|
||||
LevelPtr->Index = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
@ -630,7 +629,6 @@ AcpiCmBuildInternalPackageObject (
|
||||
UINT8 *FreeSpace;
|
||||
ACPI_OBJECT *ExternalObj;
|
||||
UINT32 CurrentDepth = 0;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
UINT32 Length = 0;
|
||||
UINT32 ThisIndex;
|
||||
UINT32 ObjectSpace = 0;
|
||||
@ -730,18 +728,6 @@ AcpiCmBuildInternalPackageObject (
|
||||
|
||||
else
|
||||
{
|
||||
/* Status = AcpiCmBuildSimpleObject(ThisInternalObj,
|
||||
ThisExternalObj, FreeSpace,
|
||||
&ObjectSpace);
|
||||
*/
|
||||
if (Status != AE_OK)
|
||||
{
|
||||
/*
|
||||
* Failure get out
|
||||
*/
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
FreeSpace += ObjectSpace;
|
||||
Length += ObjectSpace;
|
||||
|
||||
@ -778,13 +764,6 @@ AcpiCmBuildInternalPackageObject (
|
||||
}
|
||||
} /* else object is NOT a package */
|
||||
} /* while (1) */
|
||||
|
||||
|
||||
/*
|
||||
* We'll never get here, but the compiler whines about
|
||||
* return value
|
||||
*/
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
|
@ -227,18 +227,9 @@ AcpiCmDeleteInternalObj (
|
||||
case ACPI_TYPE_METHOD:
|
||||
|
||||
DEBUG_PRINT (ACPI_INFO,
|
||||
("CmDeleteInternalObj: ***** Method %p, ParserOp %p\n",
|
||||
Object, Object->Method.ParserOp));
|
||||
("CmDeleteInternalObj: ***** Method %p\n", Object));
|
||||
|
||||
/* Delete parse tree if it exists */
|
||||
|
||||
if (Object->Method.ParserOp)
|
||||
{
|
||||
AcpiPsDeleteParseTree (Object->Method.ParserOp);
|
||||
Object->Method.ParserOp = NULL;
|
||||
}
|
||||
|
||||
/* Delete semaphore if it exists */
|
||||
/* Delete the method semaphore if it exists */
|
||||
|
||||
if (Object->Method.Semaphore)
|
||||
{
|
||||
@ -364,7 +355,7 @@ AcpiCmDeleteInternalObjectList (
|
||||
void
|
||||
AcpiCmUpdateRefCount (
|
||||
ACPI_OBJECT_INTERNAL *Object,
|
||||
INT32 Action)
|
||||
UINT32 Action)
|
||||
{
|
||||
UINT16 Count;
|
||||
UINT16 NewCount;
|
||||
@ -484,11 +475,11 @@ AcpiCmUpdateRefCount (
|
||||
* DESCRIPTION: Increment the object reference count
|
||||
*
|
||||
* Object references are incremented when:
|
||||
* 1) An object is added as a value in an Name Table Entry (NTE)
|
||||
* 1) An object is attached to a NamedObject (namespace object)
|
||||
* 2) An object is copied (all subobjects must be incremented)
|
||||
*
|
||||
* Object references are decremented when:
|
||||
* 1) An object is removed from an NTE
|
||||
* 1) An object is detached from an NamedObject
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -129,7 +129,7 @@
|
||||
*
|
||||
* FUNCTION: AcpiCmEvaluateNumericObject
|
||||
*
|
||||
* PARAMETERS: AcpiDevice - NTE for the device
|
||||
* PARAMETERS: AcpiDevice - Named Object for the device
|
||||
* *Address - Where the value is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
@ -143,7 +143,7 @@
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiCmEvaluateNumericObject (
|
||||
char *ObjectName,
|
||||
NATIVE_CHAR *ObjectName,
|
||||
ACPI_NAMED_OBJECT *AcpiDevice,
|
||||
UINT32 *Address)
|
||||
{
|
||||
@ -169,7 +169,8 @@ AcpiCmEvaluateNumericObject (
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("%s on %4.4s failed with status %4.4x\n", ObjectName,
|
||||
&((ACPI_NAMED_OBJECT*) AcpiDevice)->Name, Status));
|
||||
&((ACPI_NAMED_OBJECT*) AcpiDevice)->Name,
|
||||
AcpiCmFormatException (Status)));
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
@ -215,7 +216,7 @@ AcpiCmEvaluateNumericObject (
|
||||
*
|
||||
* FUNCTION: AcpiCmExecute_HID
|
||||
*
|
||||
* PARAMETERS: AcpiDevice - NTE for the device
|
||||
* PARAMETERS: AcpiDevice - Named Object for the device
|
||||
* *Hid - Where the HID is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
@ -256,7 +257,8 @@ AcpiCmExecute_HID (
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("_HID on %4.4s failed with status %4.4x\n",
|
||||
&((ACPI_NAMED_OBJECT*) AcpiDevice)->Name, Status));
|
||||
&((ACPI_NAMED_OBJECT*) AcpiDevice)->Name,
|
||||
AcpiCmFormatException (Status)));
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
@ -316,7 +318,7 @@ AcpiCmExecute_HID (
|
||||
*
|
||||
* FUNCTION: AcpiCmExecute_UID
|
||||
*
|
||||
* PARAMETERS: AcpiDevice - NTE for the device
|
||||
* PARAMETERS: AcpiDevice - Named Object for the device
|
||||
* *Uid - Where the UID is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
@ -354,7 +356,8 @@ AcpiCmExecute_UID (
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("_UID on %4.4s failed with status %4.4x\n",
|
||||
&((ACPI_NAMED_OBJECT*) AcpiDevice)->Name, Status));
|
||||
&((ACPI_NAMED_OBJECT*) AcpiDevice)->Name,
|
||||
AcpiCmFormatException (Status)));
|
||||
}
|
||||
|
||||
return (Status);
|
||||
@ -412,7 +415,7 @@ AcpiCmExecute_UID (
|
||||
*
|
||||
* FUNCTION: AcpiCmExecute_STA
|
||||
*
|
||||
* PARAMETERS: AcpiDevice - NTE for the device
|
||||
* PARAMETERS: AcpiDevice - Named Object for the device
|
||||
* *Flags - Where the status flags are returned
|
||||
*
|
||||
* RETURN: Status
|
||||
@ -453,7 +456,8 @@ AcpiCmExecute_STA (
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("_STA on %4.4s failed with status %4.4x\n",
|
||||
&((ACPI_NAMED_OBJECT*) AcpiDevice)->Name, Status));
|
||||
&((ACPI_NAMED_OBJECT*) AcpiDevice)->Name,
|
||||
AcpiCmFormatException (Status)));
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -118,9 +118,9 @@
|
||||
#define DEFINE_ACPI_GLOBALS
|
||||
|
||||
#include "acpi.h"
|
||||
#include "events.h"
|
||||
#include "namesp.h"
|
||||
#include "interp.h"
|
||||
#include "acevents.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acinterp.h"
|
||||
|
||||
|
||||
#define _COMPONENT MISCELLANEOUS
|
||||
@ -287,7 +287,7 @@ ACPI_INIT_DATA AcpiGbl_AcpiInitData;
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
char *MsgAcpiErrorBreak = "*** Break on ACPI_ERROR ***\n";
|
||||
NATIVE_CHAR *MsgAcpiErrorBreak = "*** Break on ACPI_ERROR ***\n";
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
@ -302,7 +302,7 @@ char *MsgAcpiErrorBreak = "*** Break on ACPI_ERROR ***\n"
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
char *
|
||||
NATIVE_CHAR *
|
||||
AcpiCmGetMutexName (
|
||||
UINT32 MutexId)
|
||||
{
|
||||
@ -325,10 +325,10 @@ AcpiCmGetMutexName (
|
||||
* indicatewhat type is actually going to be stored for this entry.
|
||||
*/
|
||||
|
||||
static char AcpiGbl_BadType[] = "UNDEFINED";
|
||||
static NATIVE_CHAR AcpiGbl_BadType[] = "UNDEFINED";
|
||||
#define TYPE_NAME_LENGTH 9 /* Maximum length of each string */
|
||||
|
||||
static char *AcpiGbl_NsTypeNames[] = /* printable names of ACPI types */
|
||||
static NATIVE_CHAR *AcpiGbl_NsTypeNames[] = /* printable names of ACPI types */
|
||||
{
|
||||
"Untyped",
|
||||
"Number",
|
||||
@ -386,7 +386,7 @@ static char *AcpiGbl_NsTypeNames[] = /* printable names of AC
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
char *
|
||||
NATIVE_CHAR *
|
||||
AcpiCmGetTypeName (
|
||||
UINT32 Type)
|
||||
{
|
||||
@ -424,11 +424,11 @@ AcpiCmValidObjectType (
|
||||
if ((Type < INTERNAL_TYPE_BEGIN) ||
|
||||
(Type > INTERNAL_TYPE_MAX))
|
||||
{
|
||||
return FALSE;
|
||||
return (FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
@ -444,17 +444,65 @@ AcpiCmValidObjectType (
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
char *
|
||||
NATIVE_CHAR *
|
||||
AcpiCmFormatException (
|
||||
ACPI_STATUS Status)
|
||||
{
|
||||
NATIVE_CHAR *Exception = "UNKNOWN_STATUS";
|
||||
ACPI_STATUS SubStatus;
|
||||
|
||||
if (Status > ACPI_MAX_STATUS)
|
||||
|
||||
SubStatus = (Status & ~AE_CODE_MASK);
|
||||
|
||||
|
||||
switch (Status & AE_CODE_MASK)
|
||||
{
|
||||
return "UNKNOWN_STATUS";
|
||||
case AE_CODE_ENVIRONMENTAL:
|
||||
|
||||
if (SubStatus <= AE_CODE_ENV_MAX)
|
||||
{
|
||||
Exception = AcpiGbl_ExceptionNames_Env [SubStatus];
|
||||
}
|
||||
break;
|
||||
|
||||
case AE_CODE_PROGRAMMER:
|
||||
|
||||
if (SubStatus <= AE_CODE_PGM_MAX)
|
||||
{
|
||||
Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus -1];
|
||||
}
|
||||
break;
|
||||
|
||||
case AE_CODE_ACPI_TABLES:
|
||||
|
||||
if (SubStatus <= AE_CODE_TBL_MAX)
|
||||
{
|
||||
Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus -1];
|
||||
}
|
||||
break;
|
||||
|
||||
case AE_CODE_AML:
|
||||
|
||||
if (SubStatus <= AE_CODE_AML_MAX)
|
||||
{
|
||||
Exception = AcpiGbl_ExceptionNames_Aml [SubStatus -1];
|
||||
}
|
||||
break;
|
||||
|
||||
case AE_CODE_CONTROL:
|
||||
|
||||
if (SubStatus <= AE_CODE_CTRL_MAX)
|
||||
{
|
||||
Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus -1];
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return (AcpiGbl_ExceptionNames [Status]);
|
||||
|
||||
return (Exception);
|
||||
}
|
||||
|
||||
|
||||
@ -622,6 +670,11 @@ AcpiCmInitGlobals (ACPI_INIT_DATA *InitData)
|
||||
AcpiGbl_ParseCacheRequests = 0;
|
||||
AcpiGbl_ParseCacheHits = 0;
|
||||
|
||||
AcpiGbl_ExtParseCache = NULL;
|
||||
AcpiGbl_ExtParseCacheDepth = 0;
|
||||
AcpiGbl_ExtParseCacheRequests = 0;
|
||||
AcpiGbl_ExtParseCacheHits = 0;
|
||||
|
||||
AcpiGbl_ObjectCache = NULL;
|
||||
AcpiGbl_ObjectCacheDepth = 0;
|
||||
AcpiGbl_ObjectCacheRequests = 0;
|
||||
@ -651,18 +704,15 @@ AcpiCmInitGlobals (ACPI_INIT_DATA *InitData)
|
||||
|
||||
/* Namespace */
|
||||
|
||||
AcpiGbl_RootNameTable.NextTable = NULL;
|
||||
AcpiGbl_RootNameTable.ParentEntry = NULL;
|
||||
AcpiGbl_RootNameTable.ParentTable = NULL;
|
||||
AcpiGbl_RootObject = NULL;
|
||||
|
||||
AcpiGbl_RootObject = AcpiGbl_RootNameTable.Entries;
|
||||
|
||||
AcpiGbl_RootObject->Name = ACPI_ROOT_NAME;
|
||||
AcpiGbl_RootObject->DataType = ACPI_DESC_TYPE_NAMED;
|
||||
AcpiGbl_RootObject->Type = ACPI_TYPE_ANY;
|
||||
AcpiGbl_RootObject->ThisIndex = 0;
|
||||
AcpiGbl_RootObject->ChildTable = NULL;
|
||||
AcpiGbl_RootObject->Object = NULL;
|
||||
AcpiGbl_RootNamedObject.Name = ACPI_ROOT_NAME;
|
||||
AcpiGbl_RootNamedObject.DataType = ACPI_DESC_TYPE_NAMED;
|
||||
AcpiGbl_RootNamedObject.Type = ACPI_TYPE_ANY;
|
||||
AcpiGbl_RootNamedObject.Child = NULL;
|
||||
AcpiGbl_RootNamedObject.Peer = NULL;
|
||||
AcpiGbl_RootNamedObject.Object = NULL;
|
||||
AcpiGbl_RootNamedObject.Flags = ANOBJ_END_OF_PEER_LIST;
|
||||
|
||||
/* Memory allocation metrics - compiled out in non-debug mode. */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user