本文整理汇总了C++中AcpiWalkNamespace函数的典型用法代码示例。如果您正苦于以下问题:C++ AcpiWalkNamespace函数的具体用法?C++ AcpiWalkNamespace怎么用?C++ AcpiWalkNamespace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AcpiWalkNamespace函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: acpi_pci_attach
static int
acpi_pci_attach(device_t dev)
{
int busno, domain, error;
error = pci_attach_common(dev);
if (error)
return (error);
/*
* Since there can be multiple independantly numbered PCI
* busses on systems with multiple PCI domains, we can't use
* the unit number to decide which bus we are probing. We ask
* the parent pcib what our domain and bus numbers are.
*/
domain = pcib_get_domain(dev);
busno = pcib_get_bus(dev);
/*
* First, PCI devices are added as in the normal PCI bus driver.
* Afterwards, the ACPI namespace under the bridge driver is
* walked to save ACPI handles to all the devices that appear in
* the ACPI namespace as immediate descendants of the bridge.
*
* XXX: Sometimes PCI devices show up in the ACPI namespace that
* pci_add_children() doesn't find. We currently just ignore
* these devices.
*/
pci_add_children(dev, domain, busno, sizeof(struct acpi_pci_devinfo));
AcpiWalkNamespace(ACPI_TYPE_DEVICE, acpi_get_handle(dev), 1,
acpi_pci_save_handle, NULL, dev, NULL);
return (bus_generic_attach(dev));
}
开发者ID:MattDooner,项目名称:freebsd-west,代码行数:34,代码来源:acpi_pci.c
示例2: AcpiDbFindNameInNamespace
ACPI_STATUS
AcpiDbFindNameInNamespace (
char *NameArg)
{
char AcpiName[5] = "____";
char *AcpiNamePtr = AcpiName;
if (strlen (NameArg) > 4)
{
AcpiOsPrintf ("Name must be no longer than 4 characters\n");
return (AE_OK);
}
/* Pad out name with underscores as necessary to create a 4-char name */
AcpiUtStrupr (NameArg);
while (*NameArg)
{
*AcpiNamePtr = *NameArg;
AcpiNamePtr++;
NameArg++;
}
/* Walk the namespace from the root */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkAndMatchName, NULL, AcpiName, NULL);
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
return (AE_OK);
}
开发者ID:fsheikh,项目名称:acpica,代码行数:32,代码来源:dbnames.c
示例3: AcpiDbGetBusInfo
void
AcpiDbGetBusInfo (
void)
{
/* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbBusWalk, NULL, NULL, NULL);
}
开发者ID:fsheikh,项目名称:acpica,代码行数:9,代码来源:dbnames.c
示例4: AcpiDbTestAllObjects
static void
AcpiDbTestAllObjects (
void)
{
ACPI_STATUS Status;
/* Install the debugger read-object control method if necessary */
if (!ReadHandle)
{
Status = AcpiInstallMethod (ReadMethodCode);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("%s, Could not install debugger read method\n",
AcpiFormatException (Status));
return;
}
Status = AcpiGetHandle (NULL, ACPI_DB_READ_METHOD, &ReadHandle);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not obtain handle for debug method %s\n",
ACPI_DB_READ_METHOD);
return;
}
}
/* Install the debugger write-object control method if necessary */
if (!WriteHandle)
{
Status = AcpiInstallMethod (WriteMethodCode);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("%s, Could not install debugger write method\n",
AcpiFormatException (Status));
return;
}
Status = AcpiGetHandle (NULL, ACPI_DB_WRITE_METHOD, &WriteHandle);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not obtain handle for debug method %s\n",
ACPI_DB_WRITE_METHOD);
return;
}
}
/* Walk the entire namespace, testing each supported named data object */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, AcpiDbTestOneObject, NULL, NULL, NULL);
}
开发者ID:fjdoria76,项目名称:acpica,代码行数:54,代码来源:dbtest.c
示例5: acpi_dock_eject_children
static void
acpi_dock_eject_children(device_t dev)
{
ACPI_HANDLE sb_handle;
ACPI_STATUS status;
status = AcpiGetHandle(ACPI_ROOT_OBJECT, "\\_SB_", &sb_handle);
if (ACPI_SUCCESS(status)) {
AcpiWalkNamespace(ACPI_TYPE_DEVICE, sb_handle,
100, acpi_dock_eject_child, &dev, NULL);
}
}
开发者ID:DangerDexter,项目名称:FreeBSD-8.0-dyntick,代码行数:12,代码来源:acpi_dock.c
示例6: AcpiDbCheckIntegrity
void
AcpiDbCheckIntegrity (
void)
{
ACPI_INTEGRITY_INFO Info = {0,0};
/* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbIntegrityWalk, NULL, (void *) &Info, NULL);
AcpiOsPrintf ("Verified %u namespace nodes with %u Objects\n",
Info.Nodes, Info.Objects);
}
开发者ID:fsheikh,项目名称:acpica,代码行数:14,代码来源:dbnames.c
示例7: AcpiDbCheckPredefinedNames
void
AcpiDbCheckPredefinedNames (
void)
{
UINT32 Count = 0;
/* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForPredefinedNames, NULL, (void *) &Count, NULL);
AcpiOsPrintf ("Found %u predefined names in the namespace\n", Count);
}
开发者ID:fsheikh,项目名称:acpica,代码行数:14,代码来源:dbnames.c
示例8: AcpiDbFindReferences
void
AcpiDbFindReferences (
char *ObjectArg)
{
ACPI_OPERAND_OBJECT *ObjDesc;
/* Convert string to object pointer */
ObjDesc = ACPI_TO_POINTER (ACPI_STRTOUL (ObjectArg, NULL, 16));
/* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForReferences, NULL, (void *) ObjDesc, NULL);
}
开发者ID:Aresthu,项目名称:ucore_plus,代码行数:16,代码来源:dbnames.c
示例9: AcpiDbEvaluatePredefinedNames
void
AcpiDbEvaluatePredefinedNames (
void)
{
ACPI_DB_EXECUTE_WALK Info;
Info.Count = 0;
Info.MaxCount = ACPI_UINT32_MAX;
/* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForExecute, NULL, (void *) &Info, NULL);
AcpiOsPrintf ("Evaluated %u predefined names in the namespace\n", Info.Count);
}
开发者ID:Lekensteyn,项目名称:acpica,代码行数:17,代码来源:dbmethod.c
示例10: AcpiNsInitializeObjects
ACPI_STATUS
AcpiNsInitializeObjects (
void)
{
ACPI_STATUS Status;
ACPI_INIT_WALK_INFO Info;
ACPI_FUNCTION_TRACE (NsInitializeObjects);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"[Init] Completing Initialization of ACPI Objects\n"));
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n"));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
"Completing Region/Field/Buffer/Package initialization:\n"));
/* Set all init info to zero */
memset (&Info, 0, sizeof (ACPI_INIT_WALK_INFO));
/* Walk entire namespace from the supplied root */
Status = AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, AcpiNsInitOneObject, NULL,
&Info, NULL);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace"));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
" Initialized %u/%u Regions %u/%u Fields %u/%u "
"Buffers %u/%u Packages (%u nodes)\n",
Info.OpRegionInit, Info.OpRegionCount,
Info.FieldInit, Info.FieldCount,
Info.BufferInit, Info.BufferCount,
Info.PackageInit, Info.PackageCount, Info.ObjectCount));
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"%u Control Methods found\n%u Op Regions found\n",
Info.MethodCount, Info.OpRegionCount));
return_ACPI_STATUS (AE_OK);
}
开发者ID:Paradoxianer,项目名称:haiku,代码行数:46,代码来源:nsinit.c
示例11: AcpiDbDisplayObjects
ACPI_STATUS
AcpiDbDisplayObjects (
char *ObjTypeArg,
char *DisplayCountArg)
{
ACPI_WALK_INFO Info;
ACPI_OBJECT_TYPE Type;
/* Get the object type */
Type = AcpiDbMatchArgument (ObjTypeArg, AcpiDbObjectTypes);
if (Type == ACPI_TYPE_NOT_FOUND)
{
AcpiOsPrintf ("Invalid or unsupported argument\n");
return (AE_OK);
}
AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
AcpiOsPrintf (
"Objects of type [%s] defined in the current ACPI Namespace:\n",
AcpiUtGetTypeName (Type));
AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
Info.Count = 0;
Info.OwnerId = ACPI_OWNER_ID_MAX;
Info.DebugLevel = ACPI_UINT32_MAX;
Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
/* Walk the namespace from the root */
(void) AcpiWalkNamespace (Type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForSpecificObjects, NULL, (void *) &Info, NULL);
AcpiOsPrintf (
"\nFound %u objects of type [%s] in the current ACPI Namespace\n",
Info.Count, AcpiUtGetTypeName (Type));
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
return (AE_OK);
}
开发者ID:fsheikh,项目名称:acpica,代码行数:42,代码来源:dbnames.c
示例12: AcpiDsInitializeObjects
ACPI_STATUS
AcpiDsInitializeObjects (
ACPI_TABLE_DESC *TableDesc,
ACPI_NAMESPACE_NODE *StartNode)
{
ACPI_STATUS Status;
ACPI_INIT_WALK_INFO Info;
ACPI_FUNCTION_TRACE ("DsInitializeObjects");
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n"));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Parsing all Control Methods:"));
Info.MethodCount = 0;
Info.OpRegionCount = 0;
Info.ObjectCount = 0;
Info.DeviceCount = 0;
Info.TableDesc = TableDesc;
/* Walk entire namespace from the supplied root */
Status = AcpiWalkNamespace (ACPI_TYPE_ANY, StartNode, ACPI_UINT32_MAX,
AcpiDsInitOneObject, &Info, NULL);
if (ACPI_FAILURE (Status))
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "WalkNamespace failed, %s\n",
AcpiFormatException (Status)));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
"\nTable [%4.4s] - %hd Objects with %hd Devices %hd Methods %hd Regions\n",
TableDesc->Pointer->Signature, Info.ObjectCount,
Info.DeviceCount, Info.MethodCount, Info.OpRegionCount));
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"%hd Methods, %hd Regions\n", Info.MethodCount, Info.OpRegionCount));
return_ACPI_STATUS (AE_OK);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:42,代码来源:dsinit.c
示例13: AcpiDbEvaluateAllPredefinedNames
static void
AcpiDbEvaluateAllPredefinedNames (
char *CountArg)
{
ACPI_DB_EXECUTE_WALK Info;
Info.Count = 0;
Info.MaxCount = ACPI_UINT32_MAX;
if (CountArg)
{
Info.MaxCount = ACPI_STRTOUL (CountArg, NULL, 0);
}
/* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbEvaluateOnePredefinedName, NULL, (void *) &Info, NULL);
AcpiOsPrintf ("Evaluated %u predefined names in the namespace\n", Info.Count);
}
开发者ID:99corps,项目名称:runtime,代码行数:22,代码来源:dbtest.c
示例14: AcpiDbDisplayResources
void
AcpiDbDisplayResources (
char *ObjectArg)
{
ACPI_NAMESPACE_NODE *Node;
AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
AcpiDbgLevel |= ACPI_LV_RESOURCES;
/* Asterisk means "display resources for all devices" */
if (!ObjectArg || (!strcmp (ObjectArg, "*")))
{
(void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, AcpiDbDeviceResources, NULL, NULL, NULL);
}
else
{
/* Convert string to object pointer */
Node = AcpiDbConvertToNode (ObjectArg);
if (Node)
{
if (Node->Type != ACPI_TYPE_DEVICE)
{
AcpiOsPrintf (
"%4.4s: Name is not a device object (%s)\n",
Node->Name.Ascii, AcpiUtGetTypeName (Node->Type));
}
else
{
(void) AcpiDbDeviceResources (Node, 0, NULL, NULL);
}
}
}
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
}
开发者ID:iHaD,项目名称:DragonFlyBSD,代码行数:39,代码来源:dbcmds.c
示例15: AcpiDbBatchExecute
void
AcpiDbBatchExecute (
char *CountArg)
{
ACPI_EXECUTE_WALK Info;
Info.Count = 0;
Info.MaxCount = ACPI_UINT32_MAX;
if (CountArg)
{
Info.MaxCount = ACPI_STRTOUL (CountArg, NULL, 0);
}
/* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForExecute, NULL, (void *) &Info, NULL);
AcpiOsPrintf ("Executed %u predefined names in the namespace\n", Info.Count);
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:23,代码来源:dbmethod.c
示例16: acpi_table_sbbr_namespace_check_test1
/* Test function that makes sure processors are under the _SB_ namespace. */
static int acpi_table_sbbr_namespace_check_test1(fwts_framework *fw)
{
int error_count = 0;
/* Initializing ACPICA library so we can call AcpiWalkNamespace. */
if (fwts_acpica_init(fw) != FWTS_OK)
return FWTS_ERROR;
/* Searching for all processor devices in the namespace. */
AcpiWalkNamespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
processor_handler, NULL, NULL, (void **)&error_count);
/* Deinitializing ACPICA, if we don't call this the terminal will break on exit. */
fwts_acpica_deinit();
/* error_count variable counts the number of processors outside of the _SB_ namespace. */
if (error_count > 0)
fwts_failed(fw, LOG_LEVEL_HIGH, "SbbrAcpiCpuWrongNamespace", "%d Processor devices "
"were found outside of the _SB_ namespace.", error_count);
else
fwts_passed(fw, "All processor devices were located in the _SB_ namespace.");
return FWTS_OK;
}
开发者ID:9elements,项目名称:fwts,代码行数:25,代码来源:acpitables.c
示例17: AcpiDbExecute
void
AcpiDbExecute (
char *Name,
char **Args,
UINT32 Flags)
{
ACPI_STATUS Status;
ACPI_BUFFER ReturnObj;
#ifdef ACPI_DEBUG_OUTPUT
UINT32 PreviousAllocations;
UINT32 Allocations;
/* Memory allocation tracking */
PreviousAllocations = AcpiDbGetOutstandingAllocations ();
#endif
if (*Name == '*')
{
(void) AcpiWalkNamespace (ACPI_TYPE_METHOD, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbExecutionWalk, NULL, NULL);
return;
}
else
{
AcpiGbl_DbMethodInfo.Name = Name;
AcpiGbl_DbMethodInfo.Args = Args;
AcpiGbl_DbMethodInfo.Flags = Flags;
ReturnObj.Pointer = NULL;
ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);
Status = AcpiDbExecuteMethod (&AcpiGbl_DbMethodInfo, &ReturnObj);
}
/*
* Allow any handlers in separate threads to complete.
* (Such as Notify handlers invoked from AML executed above).
*/
AcpiOsSleep (0, 10);
#ifdef ACPI_DEBUG_OUTPUT
/* Memory allocation tracking */
Allocations = AcpiDbGetOutstandingAllocations () - PreviousAllocations;
AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
if (Allocations > 0)
{
AcpiOsPrintf ("Outstanding: %ld allocations after execution\n",
Allocations);
}
#endif
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Execution of %s failed with status %s\n",
AcpiGbl_DbMethodInfo.Pathname, AcpiFormatException (Status));
}
else
{
/* Display a return object, if any */
if (ReturnObj.Length)
{
AcpiOsPrintf ("Execution of %s returned object %p Buflen %X\n",
AcpiGbl_DbMethodInfo.Pathname, ReturnObj.Pointer,
(UINT32) ReturnObj.Length);
AcpiDbDumpObject (ReturnObj.Pointer, 1);
}
else
{
AcpiOsPrintf ("No return object from execution of %s\n",
AcpiGbl_DbMethodInfo.Pathname);
}
}
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:87,代码来源:dbexec.c
示例18: acpica_init
/*
* Initialize the CA subsystem if it hasn't been done already
*/
int
acpica_init()
{
extern void acpica_find_ioapics(void);
ACPI_STATUS status;
/*
* Make sure user options are processed,
* then fail to initialize if ACPI CA has been
* disabled
*/
acpica_process_user_options();
if (!acpica_enable)
return (AE_ERROR);
mutex_enter(&acpica_module_lock);
if (acpica_init_state == ACPICA_INITIALIZED) {
mutex_exit(&acpica_module_lock);
return (AE_OK);
}
if (ACPI_FAILURE(status = AcpiLoadTables()))
goto error;
if (ACPI_FAILURE(status = acpica_install_handlers()))
goto error;
/*
* Create ACPI-to-devinfo mapping now so _INI and _STA
* methods can access PCI config space when needed
*/
scan_d2a_map();
if (ACPI_FAILURE(status = AcpiEnableSubsystem(acpi_init_level)))
goto error;
/* do after AcpiEnableSubsystem() so GPEs are initialized */
acpica_ec_init(); /* initialize EC if present */
/* This runs all device _STA and _INI methods. */
if (ACPI_FAILURE(status = AcpiInitializeObjects(0)))
goto error;
acpica_init_state = ACPICA_INITIALIZED;
/*
* [ACPI, sec. 4.4.1.1]
* As of ACPICA version 20101217 (December 2010), the _PRW methods
* (Power Resources for Wake) are no longer automatically executed
* as part of the ACPICA initialization. The OS must do this.
*/
(void) AcpiWalkNamespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
UINT32_MAX, acpica_init_PRW, NULL, NULL, NULL);
(void) AcpiUpdateAllGpes();
/*
* If we are running on the Xen hypervisor as dom0 we need to
* find the ioapics so we can prevent ACPI from trying to
* access them.
*/
if (get_hwenv() == HW_XEN_PV && is_controldom())
acpica_find_ioapics();
acpica_init_kstats();
error:
if (acpica_init_state != ACPICA_INITIALIZED) {
cmn_err(CE_NOTE, "!failed to initialize ACPI services");
}
/*
* Set acpi-status to 13 if acpica has been initialized successfully.
* This indicates that acpica is up and running. This variable name
* and value were chosen in order to remain compatible with acpi_intp.
*/
e_ddi_prop_update_int(DDI_DEV_T_NONE, ddi_root_node(), "acpi-status",
(ACPI_SUCCESS(status)) ? (ACPI_BOOT_INIT | ACPI_BOOT_ENABLE |
ACPI_BOOT_BOOTCONF) : 0);
/* Mark acpica subsystem as fully initialized. */
if (ACPI_SUCCESS(status) &&
acpi_init_level == ACPI_FULL_INITIALIZATION) {
acpica_set_core_feature(ACPI_FEATURE_FULL_INIT);
}
mutex_exit(&acpica_module_lock);
return (status);
}
开发者ID:pcd1193182,项目名称:openzfs,代码行数:89,代码来源:acpica.c
示例19: AcpiDbDisplayObjects
ACPI_STATUS
AcpiDbDisplayObjects (
char *ObjTypeArg,
char *DisplayCountArg)
{
ACPI_WALK_INFO Info;
ACPI_OBJECT_TYPE Type;
ACPI_OBJECT_INFO *ObjectInfo;
UINT32 i;
UINT32 TotalObjects = 0;
/* No argument means display summary/count of all object types */
if (!ObjTypeArg)
{
ObjectInfo = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_OBJECT_INFO));
/* Walk the namespace from the root */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, AcpiDbWalkForObjectCounts, NULL,
(void *) ObjectInfo, NULL);
AcpiOsPrintf ("\nSummary of namespace objects:\n\n");
for (i = 0; i < ACPI_TOTAL_TYPES; i++)
{
AcpiOsPrintf ("%8u %s\n", ObjectInfo->Types[i],
AcpiUtGetTypeName (i));
TotalObjects += ObjectInfo->Types[i];
}
AcpiOsPrintf ("\n%8u Total namespace objects\n\n",
TotalObjects);
ACPI_FREE (ObjectInfo);
return (AE_OK);
}
/* Get the object type */
Type = AcpiDbMatchArgument (ObjTypeArg, AcpiDbObjectTypes);
if (Type == ACPI_TYPE_NOT_FOUND)
{
AcpiOsPrintf ("Invalid or unsupported argument\n");
return (AE_OK);
}
AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
AcpiOsPrintf (
"Objects of type [%s] defined in the current ACPI Namespace:\n",
AcpiUtGetTypeName (Type));
AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
Info.Count = 0;
Info.OwnerId = ACPI_OWNER_ID_MAX;
Info.DebugLevel = ACPI_UINT32_MAX;
Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
/* Walk the namespace from the root */
(void) AcpiWalkNamespace (Type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForSpecificObjects, NULL, (void *) &Info, NULL);
AcpiOsPrintf (
"\nFound %u objects of type [%s] in the current ACPI Namespace\n",
Info.Count, AcpiUtGetTypeName (Type));
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
return (AE_OK);
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:74,代码来源:dbnames.c
示例20: acpi_secondary_init
void
acpi_secondary_init(void)
{
ACPI_STATUS Status;
ACPI_STATUS DisplayOneDevice (ACPI_HANDLE, UINT32, void *, void **);
/* Complete the ACPICA initialization sequence */
Status = AcpiInitializeSubsystem ();
if (ACPI_FAILURE (Status)) {
DLOG_COM1 ("Failed to initialize ACPI.\n");
}
Status = AcpiReallocateRootTable ();
if (ACPI_FAILURE (Status)) {
DLOG_COM1 ("Failed: AcpiReallocateRootTable %d.\n", Status);
}
Status = AcpiLoadTables ();
if (ACPI_FAILURE (Status)) {
DLOG_COM1 ("Failed: AcpiLoadTables.\n");
}
Status = AcpiEnableSubsystem (ACPI_FULL_INITIALIZATION);
if (ACPI_FAILURE (Status)) {
DLOG_COM1 ("Failed: AcpiEnableSubsystem.\n");
}
Status = AcpiInitializeObjects (ACPI_FULL_INITIALIZATION);
if (ACPI_FAILURE (Status)) {
DLOG_COM1 ("Failed: AcpiInitializeObjects.\n");
}
/* Must enable IOAPIC before checking any PCI routing tables. */
acpi_enable_IOAPIC ();
/* Install System Control Interrupt */
u8 vector = find_unused_vector (MINIMUM_VECTOR_PRIORITY);
if (vector) {
u64 flags = IOAPIC_DELIVERY_FIXED | IOAPIC_DESTINATION_LOGICAL;
u8 gsi = acpi_sci_irq;
/* SCI defaults to LEVEL/LOW in IO-APIC mode. */
if ((acpi_sci_flags & ACPI_MADT_POLARITY_MASK) == ACPI_MADT_POLARITY_ACTIVE_HIGH)
flags |= IOAPIC_POLARITY_HIGH;
else
flags |= IOAPIC_POLARITY_LOW;
if ((acpi_sci_flags & ACPI_MADT_TRIGGER_MASK) == ACPI_MADT_TRIGGER_EDGE)
flags |= IOAPIC_TRIGGER_EDGE;
else
flags |= IOAPIC_TRIGGER_LEVEL;
if (IOAPIC_map_GSI (gsi, vector, 0x0100000000000000ULL | flags) != -1) {
set_vector_handler (vector, acpi_irq_handler);
DLOG ("ACPI: mapped GSI 0x%X to vector 0x%X (%s, %s)\n",
gsi, vector,
flags & IOAPIC_TRIGGER_LEVEL ? "level" : "edge",
flags & IOAPIC_POLARITY_LOW ? "low" : "high");
} else
DLOG ("ACPI: failed to map GSI\n");
} else
DLOG ("ACPI: failed to find unused vector\n");
DLOG ("AcpiEnableEvent returned %d\n",
AcpiEnableEvent (ACPI_EVENT_POWER_BUTTON, 0));
DLOG ("AcpiInstallFixedEventHandler returned %d\n",
AcpiInstallFixedEventHandler (ACPI_EVENT_POWER_BUTTON, acpi_power_button, NULL));
DLOG ("AcpiInstallNotifyHandler returned %d\n",
AcpiInstallNotifyHandler (ACPI_ROOT_OBJECT, ACPI_SYSTEM_NOTIFY, acpi_notify_handler, NULL));
DLOG ("AcpiInstallNotifyHandler returned %d\n",
AcpiInstallNotifyHandler (ACPI_ROOT_OBJECT, ACPI_DEVICE_NOTIFY, acpi_notify_handler, NULL));
extern u8 AcpiGbl_OsiData;
AcpiGbl_OsiData=0;
/* Walk the System Bus "\_SB_" and output info about each object
* found. */
#if 0
ACPI_HANDLE SysBusHandle;
AcpiGetHandle (ACPI_ROOT_OBJECT, ACPI_NS_SYSTEM_BUS, &SysBusHandle);
AcpiWalkNamespace (ACPI_TYPE_ANY, SysBusHandle, INT_MAX,
DisplayOneDevice, NULL, NULL);
#else
AcpiGetDevices (NULL, DisplayOneDevice, NULL, NULL);
#endif
}
开发者ID:missimer,项目名称:quest-edison,代码行数:80,代码来源:acpi.c
注:本文中的AcpiWalkNamespace函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论