本文整理汇总了C++中AcpiNsWalkNamespace函数的典型用法代码示例。如果您正苦于以下问题:C++ AcpiNsWalkNamespace函数的具体用法?C++ AcpiNsWalkNamespace怎么用?C++ AcpiNsWalkNamespace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AcpiNsWalkNamespace函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LsDisplayNamespace
ACPI_STATUS
LsDisplayNamespace (
void)
{
ACPI_STATUS Status;
if (!Gbl_NsOutputFlag)
{
return (AE_OK);
}
Gbl_NumNamespaceObjects = 0;
/* File header */
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "Contents of ACPI Namespace\n\n");
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "Count Depth Name - Type\n\n");
/* Walk entire namespace from the root */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, LsDoOneNamespaceObject, NULL,
NULL, NULL);
/* Print the full pathname for each namespace node */
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\nNamespace pathnames\n\n");
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, LsDoOnePathname, NULL,
NULL, NULL);
return (Status);
}
示例2: AcpiEvExecuteRegMethods
ACPI_STATUS
AcpiEvExecuteRegMethods (
ACPI_NAMESPACE_NODE *Node,
ACPI_ADR_SPACE_TYPE SpaceId)
{
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (EvExecuteRegMethods);
/*
* Run all _REG methods for all Operation Regions for this space ID. This
* is a separate walk in order to handle any interdependencies between
* regions and _REG methods. (i.e. handlers must be installed for all
* regions of this Space ID before we can run any _REG methods)
*/
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL,
&SpaceId, NULL);
/* Special case for EC: handle "orphan" _REG methods with no region */
if (SpaceId == ACPI_ADR_SPACE_EC)
{
AcpiEvOrphanEcRegMethod (Node);
}
return_ACPI_STATUS (Status);
}
示例3: AcpiNsDumpRootDevices
void
AcpiNsDumpRootDevices (
void)
{
ACPI_HANDLE SysBusHandle;
ACPI_STATUS Status;
ACPI_FUNCTION_NAME (NsDumpRootDevices);
/* Only dump the table if tracing is enabled */
if (!(ACPI_LV_TABLES & AcpiDbgLevel))
{
return;
}
Status = AcpiGetHandle (NULL, METHOD_NAME__SB_, &SysBusHandle);
if (ACPI_FAILURE (Status))
{
return;
}
ACPI_DEBUG_PRINT ((ACPI_DB_TABLES,
"Display of all devices in the namespace:\n"));
Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, SysBusHandle,
ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
AcpiNsDumpOneDevice, NULL, NULL, NULL);
}
示例4: AcpiEvExecuteRegMethods
void
AcpiEvExecuteRegMethods (
ACPI_NAMESPACE_NODE *Node,
ACPI_ADR_SPACE_TYPE SpaceId,
UINT32 Function)
{
ACPI_REG_WALK_INFO Info;
ACPI_FUNCTION_TRACE (EvExecuteRegMethods);
/*
* These address spaces do not need a call to _REG, since the ACPI
* specification defines them as: "must always be accessible". Since
* they never change state (never become unavailable), no need to ever
* call _REG on them. Also, a DataTable is not a "real" address space,
* so do not call _REG. September 2018.
*/
if ((SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) ||
(SpaceId == ACPI_ADR_SPACE_SYSTEM_IO) ||
(SpaceId == ACPI_ADR_SPACE_DATA_TABLE))
{
return_VOID;
}
Info.SpaceId = SpaceId;
Info.Function = Function;
Info.RegRunCount = 0;
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES,
" Running _REG methods for SpaceId %s\n",
AcpiUtGetRegionName (Info.SpaceId)));
/*
* Run all _REG methods for all Operation Regions for this space ID. This
* is a separate walk in order to handle any interdependencies between
* regions and _REG methods. (i.e. handlers must be installed for all
* regions of this Space ID before we can run any _REG methods)
*/
(void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL, &Info, NULL);
/* Special case for EC: handle "orphan" _REG methods with no region */
if (SpaceId == ACPI_ADR_SPACE_EC)
{
AcpiEvOrphanEcRegMethod (Node);
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES,
" Executed %u _REG methods for SpaceId %s\n",
Info.RegRunCount, AcpiUtGetRegionName (Info.SpaceId)));
return_VOID;
}
示例5: AcpiNsDumpObjectPaths
void
AcpiNsDumpObjectPaths (
ACPI_OBJECT_TYPE Type,
UINT8 DisplayType,
UINT32 MaxDepth,
ACPI_OWNER_ID OwnerId,
ACPI_HANDLE StartHandle)
{
ACPI_STATUS Status;
UINT32 MaxLevel = 0;
ACPI_FUNCTION_ENTRY ();
/*
* Just lock the entire namespace for the duration of the dump.
* We don't want any changes to the namespace during this time,
* especially the temporary nodes since we are going to display
* them also.
*/
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not acquire namespace mutex\n");
return;
}
/* Get the max depth of the namespace tree, for formatting later */
(void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
AcpiNsGetMaxDepth, NULL, (void *) &MaxLevel, NULL);
/* Now dump the entire namespace */
(void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
AcpiNsDumpOneObjectPath, NULL, (void *) &MaxLevel, NULL);
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
}
示例6: LkFindUnreferencedObjects
void
LkFindUnreferencedObjects (
void)
{
/* Walk entire namespace from the supplied root */
(void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, LkIsObjectUsed, NULL,
NULL, NULL);
}
示例7: AcpiGetDevices
ACPI_STATUS
AcpiGetDevices (
char *HID,
ACPI_WALK_CALLBACK UserFunction,
void *Context,
void **ReturnValue)
{
ACPI_STATUS Status;
ACPI_GET_DEVICES_INFO Info;
ACPI_FUNCTION_TRACE (AcpiGetDevices);
/* Parameter validation */
if (!UserFunction)
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/*
* We're going to call their callback from OUR callback, so we need
* to know what it is, and their context parameter.
*/
Info.Hid = HID;
Info.Context = Context;
Info.UserFunction = UserFunction;
/*
* Lock the namespace around the walk.
* The namespace will be unlocked/locked around each call
* to the user function - since this function
* must be allowed to make Acpi calls itself.
*/
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK,
AcpiNsGetDeviceCallback, NULL, &Info, ReturnValue);
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (Status);
}
示例8: MpEmitDeviceTree
static void
MpEmitDeviceTree (
void)
{
FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\nACPI Device Tree\n");
FlPrintFile (ASL_FILE_MAP_OUTPUT, "----------------\n\n");
FlPrintFile (ASL_FILE_MAP_OUTPUT, "Device Pathname "
"_HID Description\n\n");
/* Walk the namespace from the root */
(void) AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, MpEmitOneDevice, NULL, NULL, NULL);
}
示例9: acpi_dock_insert_child
static ACPI_STATUS
acpi_dock_insert_child(ACPI_HANDLE handle, UINT32 level, void *context,
void **status)
{
device_t dock_dev, dev;
ACPI_HANDLE dock_handle;
dock_dev = (device_t)context;
dock_handle = acpi_get_handle(dock_dev);
if (!acpi_dock_is_ejd_device(dock_handle, handle))
goto out;
ACPI_VPRINT(dock_dev, acpi_device_get_parent_softc(dock_dev),
"inserting device for %s\n", acpi_name(handle));
#if 0
/*
* If the system boot up w/o Docking, the devices under the dock
* still un-initialized, also control methods such as _INI, _STA
* are not executed.
* Normal devices are initialized at booting by calling
* AcpiInitializeObjects(), however the devices under the dock
* need to be initialized here on the scheme of ACPICA.
*/
ACPI_INIT_WALK_INFO Info;
AcpiNsWalkNamespace(ACPI_TYPE_ANY, handle,
100, TRUE, AcpiNsInitOneDevice, &Info, NULL);
#endif
dev = acpi_get_device(handle);
if (dev == NULL) {
device_printf(dock_dev, "error: %s has no associated device\n",
acpi_name(handle));
goto out;
}
AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_dock_attach_later, dev);
out:
return (AE_OK);
}
示例10: AcpiWalkNamespace
ACPI_STATUS
AcpiWalkNamespace (
ACPI_OBJECT_TYPE Type,
ACPI_HANDLE StartObject,
UINT32 MaxDepth,
ACPI_WALK_CALLBACK UserFunction,
void *Context,
void **ReturnValue)
{
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (AcpiWalkNamespace);
/* Parameter validation */
if ((Type > ACPI_TYPE_LOCAL_MAX) ||
(!MaxDepth) ||
(!UserFunction))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/*
* Lock the namespace around the walk.
* The namespace will be unlocked/locked around each call
* to the user function - since this function
* must be allowed to make Acpi calls itself.
*/
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
Status = AcpiNsWalkNamespace (Type, StartObject, MaxDepth,
ACPI_NS_WALK_UNLOCK,
UserFunction, Context, ReturnValue);
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (Status);
}
示例11: AcpiNsDumpObjects
void
AcpiNsDumpObjects (
ACPI_OBJECT_TYPE8 Type,
UINT32 MaxDepth,
UINT32 OwnerId,
ACPI_HANDLE StartHandle)
{
ACPI_WALK_INFO Info;
FUNCTION_ENTRY ();
Info.DebugLevel = ACPI_LV_TABLES;
Info.OwnerId = OwnerId;
AcpiNsWalkNamespace (Type, StartHandle, MaxDepth, NS_WALK_NO_UNLOCK, AcpiNsDumpOneObject,
(void *) &Info, NULL);
}
示例12: AcpiDbCountNamespaceObjects
static void
AcpiDbCountNamespaceObjects (
void)
{
UINT32 i;
AcpiGbl_NumNodes = 0;
AcpiGbl_NumObjects = 0;
AcpiGbl_ObjTypeCountMisc = 0;
for (i = 0; i < (ACPI_TYPE_NS_NODE_MAX -1); i++)
{
AcpiGbl_ObjTypeCount [i] = 0;
AcpiGbl_NodeTypeCount [i] = 0;
}
(void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, AcpiDbClassifyOneObject, NULL, NULL, NULL);
}
示例13: AcpiEvExecuteRegMethods
void
AcpiEvExecuteRegMethods (
ACPI_NAMESPACE_NODE *Node,
ACPI_ADR_SPACE_TYPE SpaceId,
UINT32 Function)
{
ACPI_REG_WALK_INFO Info;
ACPI_FUNCTION_TRACE (EvExecuteRegMethods);
Info.SpaceId = SpaceId;
Info.Function = Function;
Info.RegRunCount = 0;
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES,
" Running _REG methods for SpaceId %s\n",
AcpiUtGetRegionName (Info.SpaceId)));
/*
* Run all _REG methods for all Operation Regions for this space ID. This
* is a separate walk in order to handle any interdependencies between
* regions and _REG methods. (i.e. handlers must be installed for all
* regions of this Space ID before we can run any _REG methods)
*/
(void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL, &Info, NULL);
/* Special case for EC: handle "orphan" _REG methods with no region */
if (SpaceId == ACPI_ADR_SPACE_EC)
{
AcpiEvOrphanEcRegMethod (Node);
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES,
" Executed %u _REG methods for SpaceId %s\n",
Info.RegRunCount, AcpiUtGetRegionName (Info.SpaceId)));
return_VOID;
}
示例14: XfObjectExists
static BOOLEAN
XfObjectExists (
char *Name)
{
ACPI_STATUS Status;
/* Walk entire namespace from the supplied root */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, XfCompareOneNamespaceObject, NULL,
Name, NULL);
if (Status == AE_CTRL_TRUE)
{
/* At least one instance of the name was found */
return (TRUE);
}
return (FALSE);
}
示例15: AcpiNsDumpObjects
void
AcpiNsDumpObjects (
ACPI_OBJECT_TYPE Type,
UINT8 DisplayType,
UINT32 MaxDepth,
ACPI_OWNER_ID OwnerId,
ACPI_HANDLE StartHandle)
{
ACPI_WALK_INFO Info;
ACPI_STATUS Status;
ACPI_FUNCTION_ENTRY ();
/*
* Just lock the entire namespace for the duration of the dump.
* We don't want any changes to the namespace during this time,
* especially the temporary nodes since we are going to display
* them also.
*/
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not acquire namespace mutex\n");
return;
}
Info.Count = 0;
Info.DebugLevel = ACPI_LV_TABLES;
Info.OwnerId = OwnerId;
Info.DisplayType = DisplayType;
(void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
AcpiNsDumpOneObject, NULL, (void *) &Info, NULL);
AcpiOsPrintf ("\nNamespace node count: %u\n\n", Info.Count);
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
}