ReactOS  0.4.14-dev-991-g696cdc6
utdecode.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
#include "amlcode.h"
Include dependency graph for utdecode.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_UTILITIES
 

Functions

const charAcpiUtGetRegionName (UINT8 SpaceId)
 
const charAcpiUtGetEventName (UINT32 EventId)
 
const charAcpiUtGetTypeName (ACPI_OBJECT_TYPE Type)
 
const charAcpiUtGetObjectTypeName (ACPI_OPERAND_OBJECT *ObjDesc)
 
const charAcpiUtGetNodeName (void *Object)
 
const charAcpiUtGetDescriptorName (void *Object)
 
const charAcpiUtGetReferenceName (ACPI_OPERAND_OBJECT *Object)
 
const charAcpiUtGetMutexName (UINT32 MutexId)
 
BOOLEAN AcpiUtValidObjectType (ACPI_OBJECT_TYPE Type)
 

Variables

const UINT8 AcpiGbl_NsProperties [ACPI_NUM_NS_TYPES]
 
const charAcpiGbl_RegionTypes [ACPI_NUM_PREDEFINED_REGIONS]
 
static const charAcpiGbl_EventTypes [ACPI_NUM_FIXED_EVENTS]
 
static const char AcpiGbl_BadType [] = "UNDEFINED"
 
static const charAcpiGbl_NsTypeNames []
 
static const charAcpiGbl_DescTypeNames []
 
static const charAcpiGbl_RefClassNames []
 
static const charAcpiGbl_MutexNames [ACPI_NUM_MUTEX]
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_UTILITIES

Definition at line 49 of file utdecode.c.

Function Documentation

◆ AcpiUtGetDescriptorName()

const char* AcpiUtGetDescriptorName ( void Object)

Definition at line 381 of file utdecode.c.

383 {
384 
385  if (!Object)
386  {
387  return ("NULL OBJECT");
388  }
389 
391  {
392  return ("Not a Descriptor");
393  }
394 
396 }
static const char * AcpiGbl_DescTypeNames[]
Definition: utdecode.c:359
#define ACPI_DESC_TYPE_MAX
Definition: acobject.h:576
static IUnknown Object
Definition: main.c:512
#define ACPI_GET_DESCRIPTOR_TYPE(d)
Definition: acmacros.h:414

Referenced by AcpiDsInitBufferField(), AcpiExResolveMultiple(), AcpiExResolveOperands(), AcpiNsAttachObject(), AcpiNsLookup(), AcpiUtDeleteObjectDesc(), AcpiUtGetObjectTypeName(), and AcpiUtValidInternalObject().

◆ AcpiUtGetEventName()

const char* AcpiUtGetEventName ( UINT32  EventId)

Definition at line 174 of file utdecode.c.

176 {
177 
178  if (EventId > ACPI_EVENT_MAX)
179  {
180  return ("InvalidEventID");
181  }
182 
183  return (AcpiGbl_EventTypes[EventId]);
184 }
#define ACPI_EVENT_MAX
Definition: actypes.h:760
static const char * AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS]
Definition: utdecode.c:163

Referenced by AcpiDisableEvent(), AcpiEnableEvent(), AcpiEvFixedEventDispatch(), AcpiInstallFixedEventHandler(), and AcpiRemoveFixedEventHandler().

◆ AcpiUtGetMutexName()

const char* AcpiUtGetMutexName ( UINT32  MutexId)

Definition at line 478 of file utdecode.c.

480 {
481 
482  if (MutexId > ACPI_MAX_MUTEX)
483  {
484  return ("Invalid Mutex ID");
485  }
486 
487  return (AcpiGbl_MutexNames[MutexId]);
488 }
#define ACPI_MAX_MUTEX
Definition: aclocal.h:91
static const char * AcpiGbl_MutexNames[ACPI_NUM_MUTEX]
Definition: utdecode.c:467

Referenced by AcpiUtAcquireMutex(), and AcpiUtReleaseMutex().

◆ AcpiUtGetNodeName()

const char* AcpiUtGetNodeName ( void Object)

Definition at line 305 of file utdecode.c.

307 {
309 
310 
311  /* Must return a string of exactly 4 characters == ACPI_NAMESEG_SIZE */
312 
313  if (!Object)
314  {
315  return ("NULL");
316  }
317 
318  /* Check for Root node */
319 
320  if ((Object == ACPI_ROOT_OBJECT) ||
321  (Object == AcpiGbl_RootNode))
322  {
323  return ("\"\\\" ");
324  }
325 
326  /* Descriptor must be a namespace node */
327 
329  {
330  return ("####");
331  }
332 
333  /*
334  * Ensure name is valid. The name was validated/repaired when the node
335  * was created, but make sure it has not been corrupted.
336  */
337  AcpiUtRepairName (Node->Name.Ascii);
338 
339  /* Return the name */
340 
341  return (Node->Name.Ascii);
342 }
void AcpiUtRepairName(char *Name)
Definition: utstring.c:183
#define ACPI_ROOT_OBJECT
Definition: actypes.h:500
static IUnknown Object
Definition: main.c:512
#define ACPI_DESC_TYPE_NAMED
Definition: acobject.h:575
Definition: dlist.c:348
#define ACPI_GET_DESCRIPTOR_TYPE(d)
Definition: acmacros.h:414

Referenced by AcpiDsAutoSerializeMethod(), AcpiDsBeginMethodExecution(), AcpiDsGetBankFieldArguments(), AcpiDsGetBufferFieldArguments(), AcpiDsGetRegionArguments(), AcpiDsInitBufferField(), AcpiDsInitOneObject(), AcpiDsLoad1BeginOp(), AcpiDsLoad2BeginOp(), AcpiDsRestartControlMethod(), AcpiDsScopeStackPop(), AcpiDsScopeStackPush(), AcpiEvAddressSpaceDispatch(), AcpiEvAsynchExecuteGpeMethod(), AcpiEvAttachRegion(), AcpiEvInstallSpaceHandler(), AcpiEvPciConfigRegionSetup(), AcpiEvQueueNotifyRequest(), AcpiExAcquireMutex(), AcpiExPrepFieldValue(), AcpiExReleaseMutex(), AcpiExResolveMultiple(), AcpiExSetupRegion(), AcpiNsAttachObject(), AcpiNsDetachObject(), AcpiNsHandleToName(), AcpiNsInitOneObject(), AcpiNsInstallNode(), AcpiNsLookup(), AcpiNsSearchOneScope(), AcpiNsSearchParentTree(), AcpiUtAddAddressRange(), AcpiUtEvaluateObject(), AcpiUtExecute_STA(), AcpiUtExecutePowerMethods(), and AcpiUtRemoveAddressRange().

◆ AcpiUtGetObjectTypeName()

const char* AcpiUtGetObjectTypeName ( ACPI_OPERAND_OBJECT ObjDesc)

Definition at line 263 of file utdecode.c.

265 {
266  ACPI_FUNCTION_TRACE (UtGetObjectTypeName);
267 
268 
269  if (!ObjDesc)
270  {
271  ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Null Object Descriptor\n"));
272  return_STR ("[NULL Object Descriptor]");
273  }
274 
275  /* These descriptor types share a common area */
276 
279  {
281  "Invalid object descriptor type: 0x%2.2X [%s] (%p)\n",
282  ACPI_GET_DESCRIPTOR_TYPE (ObjDesc),
283  AcpiUtGetDescriptorName (ObjDesc), ObjDesc));
284 
285  return_STR ("Invalid object");
286  }
287 
288  return_STR (AcpiUtGetTypeName (ObjDesc->Common.Type));
289 }
const char * AcpiUtGetTypeName(ACPI_OBJECT_TYPE Type)
Definition: utdecode.c:249
#define return_STR(s)
Definition: acoutput.h:498
#define ACPI_DESC_TYPE_OPERAND
Definition: acobject.h:574
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define ACPI_DB_EXEC
Definition: acoutput.h:165
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
ACPI_OBJECT_COMMON Common
Definition: acobject.h:517
const char * AcpiUtGetDescriptorName(void *Object)
Definition: utdecode.c:381
#define ACPI_DESC_TYPE_NAMED
Definition: acobject.h:575
#define ACPI_GET_DESCRIPTOR_TYPE(d)
Definition: acmacros.h:414

Referenced by AcpiDsInitBufferField(), AcpiDsObjStackPush(), AcpiDsResultPop(), AcpiDsResultPush(), AcpiExConvertToTargetType(), AcpiExDoDebugObject(), AcpiExGetObjectReference(), AcpiExResolveNodeToValue(), AcpiExResolveObject(), AcpiExResolveOperands(), AcpiExSetupRegion(), AcpiExStore(), AcpiExStoreDirectToNode(), AcpiExStoreObjectToIndex(), AcpiExStoreObjectToNode(), AcpiExStoreObjectToObject(), AcpiExWriteSerialBus(), AcpiNsCheckObjectType(), AcpiNsEvaluate(), AcpiNsRepairNullElement(), AcpiNsSimpleRepair(), AcpiNsWrapWithPackage(), AcpiRsCreatePciRoutingTable(), AcpiUtDeleteInternalObj(), AcpiUtEvaluateObject(), AcpiUtGetSimpleObjectSize(), and AcpiUtUpdateRefCount().

◆ AcpiUtGetReferenceName()

const char* AcpiUtGetReferenceName ( ACPI_OPERAND_OBJECT Object)

Definition at line 425 of file utdecode.c.

427 {
428 
429  if (!Object)
430  {
431  return ("NULL Object");
432  }
433 
435  {
436  return ("Not an Operand object");
437  }
438 
439  if (Object->Common.Type != ACPI_TYPE_LOCAL_REFERENCE)
440  {
441  return ("Not a Reference object");
442  }
443 
444  if (Object->Reference.Class > ACPI_REFCLASS_MAX)
445  {
446  return ("Unknown Reference class");
447  }
448 
449  return (AcpiGbl_RefClassNames[Object->Reference.Class]);
450 }
#define ACPI_TYPE_LOCAL_REFERENCE
Definition: actypes.h:711
static const char * AcpiGbl_RefClassNames[]
Definition: utdecode.c:413
#define ACPI_DESC_TYPE_OPERAND
Definition: acobject.h:574
static IUnknown Object
Definition: main.c:512
#define ACPI_GET_DESCRIPTOR_TYPE(d)
Definition: acmacros.h:414

Referenced by AcpiExDoDebugObject(), AcpiExResolveOperands(), AcpiNsCheckReference(), and AcpiUtGetSimpleObjectSize().

◆ AcpiUtGetRegionName()

const char* AcpiUtGetRegionName ( UINT8  SpaceId)

Definition at line 124 of file utdecode.c.

126 {
127 
129  {
130  return ("UserDefinedRegion");
131  }
133  {
134  return ("DataTable");
135  }
137  {
138  return ("FunctionalFixedHW");
139  }
141  {
142  return ("InvalidSpaceId");
143  }
144 
145  return (AcpiGbl_RegionTypes[SpaceId]);
146 }
#define ACPI_ADR_SPACE_DATA_TABLE
Definition: actypes.h:874
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE SpaceId
Definition: acpixf.h:828
#define ACPI_USER_REGION_BEGIN
Definition: acconfig.h:197
const char * AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS]
Definition: utdecode.c:107
#define ACPI_NUM_PREDEFINED_REGIONS
Definition: actypes.h:864
#define ACPI_ADR_SPACE_FIXED_HARDWARE
Definition: actypes.h:875

Referenced by AcpiEvAddressSpaceDispatch(), AcpiEvAttachRegion(), AcpiEvDetachRegion(), AcpiEvExecuteRegMethods(), AcpiEvInitializeRegion(), AcpiEvInstallHandler(), AcpiEvInstallSpaceHandler(), AcpiExAccessRegion(), AcpiExCreateRegion(), AcpiHwRead(), AcpiHwWrite(), AcpiRemoveAddressSpaceHandler(), and AcpiUtCheckAddressRange().

◆ AcpiUtGetTypeName()

◆ AcpiUtValidObjectType()

BOOLEAN AcpiUtValidObjectType ( ACPI_OBJECT_TYPE  Type)

Definition at line 680 of file utdecode.c.

682 {
683 
685  {
686  /* Note: Assumes all TYPEs are contiguous (external/local) */
687 
688  return (FALSE);
689  }
690 
691  return (TRUE);
692 }
#define TRUE
Definition: types.h:120
Type
Definition: Type.h:6
#define ACPI_TYPE_LOCAL_MAX
Definition: actypes.h:730

Referenced by AcpiDsScopeStackPush(), AcpiExResolveOperands(), and AcpiNsLocal().

Variable Documentation

◆ AcpiGbl_BadType

const char AcpiGbl_BadType[] = "UNDEFINED"
static

Definition at line 208 of file utdecode.c.

Referenced by AcpiUtGetTypeName().

◆ AcpiGbl_DescTypeNames

const char* AcpiGbl_DescTypeNames[]
static
Initial value:
=
{
"Not a Descriptor",
"Cached Object",
"State-Generic",
"State-Update",
"State-Package",
"State-Control",
"State-RootParseScope",
"State-ParseScope",
"State-WalkScope",
"State-Result",
"State-Notify",
"State-Thread",
"Tree Walk State",
"Parse Tree Op",
"Operand Object",
"Namespace Node"
}

Definition at line 359 of file utdecode.c.

Referenced by AcpiUtGetDescriptorName().

◆ AcpiGbl_EventTypes

const char* AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS]
static
Initial value:
=
{
"PM_Timer",
"GlobalLock",
"PowerButton",
"SleepButton",
"RealTimeClock",
}

Definition at line 163 of file utdecode.c.

Referenced by AcpiUtGetEventName().

◆ AcpiGbl_MutexNames

const char* AcpiGbl_MutexNames[ACPI_NUM_MUTEX]
static
Initial value:
=
{
"ACPI_MTX_Interpreter",
"ACPI_MTX_Namespace",
"ACPI_MTX_Tables",
"ACPI_MTX_Events",
"ACPI_MTX_Caches",
"ACPI_MTX_Memory",
}

Definition at line 467 of file utdecode.c.

Referenced by AcpiUtGetMutexName().

◆ AcpiGbl_NsProperties

const UINT8 AcpiGbl_NsProperties[ACPI_NUM_NS_TYPES]

Definition at line 57 of file utdecode.c.

Referenced by AcpiNsLocal(), and AcpiNsOpensScope().

◆ AcpiGbl_NsTypeNames

const char* AcpiGbl_NsTypeNames[]
static

Definition at line 212 of file utdecode.c.

Referenced by AcpiUtGetTypeName().

◆ AcpiGbl_RefClassNames

const char* AcpiGbl_RefClassNames[]
static
Initial value:
=
{
"Local",
"Argument",
"RefOf",
"Index",
"DdbHandle",
"Named Object",
"Debug"
}

Definition at line 413 of file utdecode.c.

Referenced by AcpiUtGetReferenceName().

◆ AcpiGbl_RegionTypes

const char* AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS]
Initial value:
=
{
"SystemMemory",
"SystemIO",
"PCI_Config",
"EmbeddedControl",
"SMBus",
"SystemCMOS",
"PCIBARTarget",
"IPMI",
"GeneralPurposeIo",
"GenericSerialBus",
"PlatformCommChannel"
}

Definition at line 107 of file utdecode.c.

Referenced by AcpiUtGetRegionName().