这篇教程C++ AcpiGetHandle函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AcpiGetHandle函数的典型用法代码示例。如果您正苦于以下问题:C++ AcpiGetHandle函数的具体用法?C++ AcpiGetHandle怎么用?C++ AcpiGetHandle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AcpiGetHandle函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AfInstallGpeBlockstatic voidAfInstallGpeBlock ( void){ ACPI_STATUS Status; ACPI_HANDLE Handle; ACPI_HANDLE Handle2 = NULL; ACPI_HANDLE Handle3 = NULL; ACPI_GENERIC_ADDRESS BlockAddress; ACPI_HANDLE GpeDevice; Status = AcpiGetHandle (NULL, "//_GPE", &Handle); if (ACPI_FAILURE (Status)) { return; } ACPI_MEMSET (&BlockAddress, 0, sizeof (ACPI_GENERIC_ADDRESS)); BlockAddress.SpaceId = ACPI_ADR_SPACE_SYSTEM_MEMORY; BlockAddress.Address = 0x76540000; Status = AcpiGetHandle (NULL, "//GPE2", &Handle2); if (ACPI_SUCCESS (Status)) { Status = AcpiInstallGpeBlock (Handle2, &BlockAddress, 7, 8); AE_CHECK_OK (AcpiInstallGpeBlock, Status); Status = AcpiInstallGpeHandler (Handle2, 8, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL); AE_CHECK_OK (AcpiInstallGpeHandler, Status); Status = AcpiEnableGpe (Handle2, 8); AE_CHECK_OK (AcpiEnableGpe, Status); Status = AcpiGetGpeDevice (0x30, &GpeDevice); AE_CHECK_OK (AcpiGetGpeDevice, Status); Status = AcpiGetGpeDevice (0x42, &GpeDevice); AE_CHECK_OK (AcpiGetGpeDevice, Status); Status = AcpiGetGpeDevice (AcpiCurrentGpeCount-1, &GpeDevice); AE_CHECK_OK (AcpiGetGpeDevice, Status); Status = AcpiGetGpeDevice (AcpiCurrentGpeCount, &GpeDevice); AE_CHECK_STATUS (AcpiGetGpeDevice, Status, AE_NOT_EXIST); Status = AcpiRemoveGpeHandler (Handle2, 8, AeGpeHandler); AE_CHECK_OK (AcpiRemoveGpeHandler, Status); } Status = AcpiGetHandle (NULL, "//GPE3", &Handle3); if (ACPI_SUCCESS (Status)) { Status = AcpiInstallGpeBlock (Handle3, &BlockAddress, 8, 11); AE_CHECK_OK (AcpiInstallGpeBlock, Status); }}
开发者ID:Jyang772,项目名称:XEOS,代码行数:58,
示例2: AcpiDbTestAllObjectsstatic voidAcpiDbTestAllObjects ( 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,
示例3: pciehpc_acpi_hpc_init/* * Intialize hot plug control for ACPI mode. */static intpciehpc_acpi_hpc_init(pcie_hp_ctrl_t *ctrl_p){ ACPI_HANDLE pcibus_obj; int status = AE_ERROR; ACPI_HANDLE slot_dev_obj; ACPI_HANDLE hdl; pciehpc_acpi_t *acpi_p; uint16_t bus_methods = 0; uint16_t slot_methods = 0; /* get the ACPI object for the bus node */ status = acpica_get_handle(ctrl_p->hc_dip, &pcibus_obj); if (status != AE_OK) return (DDI_FAILURE); /* get the ACPI object handle for the child node */ status = AcpiGetNextObject(ACPI_TYPE_DEVICE, pcibus_obj, NULL, &slot_dev_obj); if (status != AE_OK) return (DDI_FAILURE); /* * gather the info about the ACPI methods present on the bus node * and the child nodes. */ if (AcpiGetHandle(pcibus_obj, "_OSC", &hdl) == AE_OK) bus_methods |= PCIEHPC_ACPI_OSC_PRESENT; if (AcpiGetHandle(pcibus_obj, "_OSHP", &hdl) == AE_OK) bus_methods |= PCIEHPC_ACPI_OSHP_PRESENT; if (AcpiGetHandle(pcibus_obj, "_HPX", &hdl) == AE_OK) bus_methods |= PCIEHPC_ACPI_HPX_PRESENT; if (AcpiGetHandle(pcibus_obj, "_HPP", &hdl) == AE_OK) bus_methods |= PCIEHPC_ACPI_HPP_PRESENT; if (AcpiGetHandle(pcibus_obj, "_DSM", &hdl) == AE_OK) bus_methods |= PCIEHPC_ACPI_DSM_PRESENT; if (AcpiGetHandle(slot_dev_obj, "_SUN", &hdl) == AE_OK) slot_methods |= PCIEHPC_ACPI_SUN_PRESENT; if (AcpiGetHandle(slot_dev_obj, "_PS0", &hdl) == AE_OK) slot_methods |= PCIEHPC_ACPI_PS0_PRESENT; if (AcpiGetHandle(slot_dev_obj, "_EJ0", &hdl) == AE_OK) slot_methods |= PCIEHPC_ACPI_EJ0_PRESENT; if (AcpiGetHandle(slot_dev_obj, "_STA", &hdl) == AE_OK) slot_methods |= PCIEHPC_ACPI_STA_PRESENT; /* save ACPI object handles, etc. */ acpi_p = kmem_zalloc(sizeof (pciehpc_acpi_t), KM_SLEEP); acpi_p->bus_obj = pcibus_obj; acpi_p->slot_dev_obj = slot_dev_obj; acpi_p->bus_methods = bus_methods; acpi_p->slot_methods = slot_methods; ctrl_p->hc_misc_data = acpi_p; return (DDI_SUCCESS);}
开发者ID:MatiasNAmendola,项目名称:AuroraUX-SunOS,代码行数:58,
示例4: acpi_GetReferenceACPI_HANDLEacpi_GetReference(ACPI_HANDLE scope, ACPI_OBJECT *obj){ ACPI_HANDLE h; if (obj == NULL) return (NULL); switch (obj->Type) { case ACPI_TYPE_LOCAL_REFERENCE: case ACPI_TYPE_ANY: h = obj->Reference.Handle; break; case ACPI_TYPE_STRING: /* * The String object usually contains a fully-qualified path, so * scope can be NULL. * * XXX This may not always be the case. */ if (ACPI_FAILURE(AcpiGetHandle(scope, obj->String.Pointer, &h))) h = NULL; break; default: h = NULL; break; } return (h);}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:30,
示例5: get_next_entrystatus_tget_next_entry(uint32 objectType, const char *base, char *result, size_t length, void **counter){ ACPI_HANDLE parent, child, newChild; ACPI_BUFFER buffer; ACPI_STATUS status; TRACE("get_next_entry %ld, %s/n", objectType, base); if (base == NULL || !strcmp(base, "//")) { parent = ACPI_ROOT_OBJECT; } else { status = AcpiGetHandle(NULL, (ACPI_STRING)base, &parent); if (status != AE_OK) return B_ENTRY_NOT_FOUND; } child = *counter; status = AcpiGetNextObject(objectType, parent, child, &newChild); if (status != AE_OK) return B_ENTRY_NOT_FOUND; *counter = newChild; buffer.Length = length; buffer.Pointer = result; status = AcpiGetName(newChild, ACPI_FULL_PATHNAME, &buffer); if (status != AE_OK) return B_NO_MEMORY; /* Corresponds to AE_BUFFER_OVERFLOW */ return B_OK;}
开发者ID:simonsouth,项目名称:haiku,代码行数:34,
示例6: psm_node_has_prt/* * Examines ACPI node for presence of _PRT object * * Returns: * 0 if no _PRT or error * 1 if _PRT is present */static intpsm_node_has_prt(ACPI_HANDLE *ah){ ACPI_HANDLE rh; return (AcpiGetHandle(ah, "_PRT", &rh) == AE_OK);}
开发者ID:MatiasNAmendola,项目名称:AuroraUX-SunOS,代码行数:14,
示例7: AcpiNsDumpRootDevicesvoidAcpiNsDumpRootDevices ( 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);}
开发者ID:yazshel,项目名称:netbsd-kernel,代码行数:31,
示例8: acpi_device_init_driverstatic status_tacpi_device_init_driver(device_node *node, void **cookie){ ACPI_HANDLE handle; const char *path = NULL; uint32 type; if (gDeviceManager->get_attr_uint32(node, ACPI_DEVICE_TYPE_ITEM, &type, false) != B_OK) return B_ERROR; gDeviceManager->get_attr_string(node, ACPI_DEVICE_PATH_ITEM, &path, false); acpi_device_cookie *device = (acpi_device_cookie*)malloc(sizeof(*device)); if (device == NULL) return B_NO_MEMORY; memset(device, 0, sizeof(*device)); if (path != NULL && AcpiGetHandle(NULL, (ACPI_STRING)path, &handle) != AE_OK) { free(device); return B_ENTRY_NOT_FOUND; } device->handle = handle; device->path = path != NULL ? strdup(path) : NULL; device->type = type; device->node = node; snprintf(device->name, sizeof(device->name), "acpi_device %s", path); *cookie = device; return B_OK;}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:31,
示例9: acpi_ec_ecdt_probe/* * Look for an ECDT and if we find one, set up default GPE and * space handlers to catch attempts to access EC space before * we have a real driver instance in place. * * TODO: Some old Gateway laptops need us to fake up an ECDT or * otherwise attach early so that _REG methods can run. */voidacpi_ec_ecdt_probe(device_t parent){ ACPI_TABLE_ECDT *ecdt; ACPI_STATUS status; device_t child; ACPI_HANDLE h; struct acpi_ec_params *params; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); /* Find and validate the ECDT. */ status = AcpiGetTable(ACPI_SIG_ECDT, 1, (ACPI_TABLE_HEADER **)&ecdt); if (ACPI_FAILURE(status) || ecdt->Control.BitWidth != 8 || ecdt->Data.BitWidth != 8) { return; } /* Create the child device with the given unit number. */ child = BUS_ADD_CHILD(parent, parent, 0, "acpi_ec", ecdt->Uid); if (child == NULL) { kprintf("%s: can't add child/n", __func__); return; } /* Find and save the ACPI handle for this device. */ status = AcpiGetHandle(NULL, ecdt->Id, &h); if (ACPI_FAILURE(status)) { device_delete_child(parent, child); kprintf("%s: can't get handle/n", __func__); return; } acpi_set_handle(child, h); /* Set the data and CSR register addresses. */ bus_set_resource(child, SYS_RES_IOPORT, 0, ecdt->Data.Address, /*count*/1, -1); bus_set_resource(child, SYS_RES_IOPORT, 1, ecdt->Control.Address, /*count*/1, -1); /* * Store values for the probe/attach routines to use. Store the * ECDT GPE bit and set the global lock flag according to _GLK. * Note that it is not perfectly correct to be evaluating a method * before initializing devices, but in practice this function * should be safe to call at this point. */ params = kmalloc(sizeof(struct acpi_ec_params), M_TEMP, M_WAITOK | M_ZERO); params->gpe_handle = NULL; params->gpe_bit = ecdt->Gpe; params->uid = ecdt->Uid; acpi_GetInteger(h, "_GLK", ¶ms->glk); acpi_set_private(child, params); /* Finish the attach process. */ if (device_probe_and_attach(child) != 0) device_delete_child(parent, child);}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:67,
示例10: acpi_pci_bindstatic int acpi_pci_bind(struct acpi_device *device){ ACPI_STATUS status; ACPI_HANDLE handle; struct pci_bus *bus; struct pci_dev *dev; dev = acpi_get_pci_dev(device->handle); if (!dev) return 0; device->pci_dev = dev; dev->acpi_dev = device; dbgprintf("bind ACPI %s PCI_%x_%x/n", device->pnp.bus_id, dev->vendor, dev->device);// pci_acpi_add_pm_notifier(device, dev);// if (device->wakeup.flags.run_wake)// device_set_run_wake(&dev->dev, true); /* * Install the 'bind' function to facilitate callbacks for * children of the P2P bridge. */ if (dev->subordinate) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device %04x:%02x:%02x.%d is a PCI bridge/n", pci_domain_nr(dev->bus), dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn))); device->ops.bind = acpi_pci_bind; device->ops.unbind = acpi_pci_unbind; } /* * Evaluate and parse _PRT, if exists. This code allows parsing of * _PRT objects within the scope of non-bridge devices. Note that * _PRTs within the scope of a PCI bridge assume the bridge's * subordinate bus number. * * TBD: Can _PRTs exist within the scope of non-bridge PCI devices? */ status = AcpiGetHandle(device->handle, METHOD_NAME__PRT, &handle); if (ACPI_FAILURE(status)) goto out; if (dev->subordinate) bus = dev->subordinate; else bus = dev->bus; acpi_pci_irq_add_prt(device->handle, bus);out:// pci_dev_put(dev); return 0;}
开发者ID:Misha-Mainenko,项目名称:kolibrios-llvm,代码行数:58,
示例11: AeDoOneOverridestatic voidAeDoOneOverride ( char *Pathname, char *ValueString, ACPI_OPERAND_OBJECT *ObjDesc, ACPI_WALK_STATE *WalkState){ ACPI_HANDLE Handle; ACPI_STATUS Status; UINT64 Value; AcpiOsPrintf ("Value Override: %s, ", Pathname); /* * Get the namespace node associated with the override * pathname from the init file. */ Status = AcpiGetHandle (NULL, Pathname, &Handle); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("%s/n", AcpiFormatException (Status)); return; } /* Extract the 64-bit integer */ Status = AcpiUtStrtoul64 (ValueString, (ACPI_STRTOUL_BASE16 | ACPI_STRTOUL_64BIT), &Value); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("%s %s/n", ValueString, AcpiFormatException (Status)); return; } ObjDesc->Integer.Value = Value; /* * At the point this function is called, the namespace is fully * built and initialized. We can simply store the new object to * the target node. */ AcpiExEnterInterpreter (); Status = AcpiExStore (ObjDesc, Handle, WalkState); AcpiExExitInterpreter (); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("%s/n", AcpiFormatException (Status)); return; } AcpiOsPrintf ("New value: 0x%8.8X%8.8X/n", ACPI_FORMAT_UINT64 (Value));}
开发者ID:ColinIanKing,项目名称:acpica,代码行数:56,
示例12: GetLnkInfovoidGetLnkInfo (char *lnkname, pci_irq_t *irq){ ACPI_HANDLE Handle; ACPI_STATUS Status; Status = AcpiGetHandle (NULL, lnkname, &Handle); if (ACPI_SUCCESS (Status)) { AcpiWalkResources (Handle, "_CRS", GetLnkIrq, (void *) irq); }}
开发者ID:missimer,项目名称:quest-edison,代码行数:11,
示例13: AcpiDbCreateExecutionThreadvoidAcpiDbCreateExecutionThread ( char *MethodNameArg, char **Arguments, ACPI_OBJECT_TYPE *Types){ ACPI_STATUS Status; UINT32 i; memset (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO)); AcpiGbl_DbMethodInfo.Name = MethodNameArg; AcpiGbl_DbMethodInfo.InitArgs = 1; AcpiGbl_DbMethodInfo.Args = AcpiGbl_DbMethodInfo.Arguments; AcpiGbl_DbMethodInfo.Types = AcpiGbl_DbMethodInfo.ArgTypes; /* Setup method arguments, up to 7 (0-6) */ for (i = 0; (i < ACPI_METHOD_NUM_ARGS) && *Arguments; i++) { AcpiGbl_DbMethodInfo.Arguments[i] = *Arguments; Arguments++; AcpiGbl_DbMethodInfo.ArgTypes[i] = *Types; Types++; } Status = AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo); if (ACPI_FAILURE (Status)) { return; } /* Get the NS node, determines existence also */ Status = AcpiGetHandle (NULL, AcpiGbl_DbMethodInfo.Pathname, &AcpiGbl_DbMethodInfo.Method); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("%s Could not get handle for %s/n", AcpiFormatException (Status), AcpiGbl_DbMethodInfo.Pathname); return; } Status = AcpiOsExecute (OSL_DEBUGGER_EXEC_THREAD, AcpiDbSingleExecutionThread, &AcpiGbl_DbMethodInfo); if (ACPI_FAILURE (Status)) { return; } AcpiOsPrintf ("/nBackground thread started/n");}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:53,
示例14: get_object_typeuint32get_object_type(const char* path){ ACPI_HANDLE handle; ACPI_OBJECT_TYPE type; if (AcpiGetHandle(NULL, (ACPI_STRING)path, &handle) != AE_OK) return B_ENTRY_NOT_FOUND; AcpiGetType(handle, &type); return type;}
开发者ID:simonsouth,项目名称:haiku,代码行数:12,
示例15: acpi_dock_eject_childrenstatic voidacpi_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,
示例16: acpi_eval_lnk/* * * If the interrupt link device is already configured, * stores polarity and sensitivity in the structure pointed to by * intr_flagp, and irqno in the value pointed to by pci_irqp. * * Returns: * ACPI_PSM_SUCCESS if the interrupt link device is already configured. * ACPI_PSM_PARTIAL if configuration is needed. * ACPI_PSM_FAILURE in case of error. * * When two devices share the same interrupt link device, and the * link device is already configured (i.e. found in the irq cache) * we need to use the already configured irq instead of reconfiguring * the link device. */static intacpi_eval_lnk(dev_info_t *dip, char *lnkname, int *pci_irqp,iflag_t *intr_flagp, acpi_psm_lnk_t *acpipsmlnkp){ ACPI_HANDLE tmpobj; ACPI_HANDLE lnkobj; int status; /* * Convert the passed-in link device name to a handle */ if (AcpiGetHandle(NULL, lnkname, &lnkobj) != AE_OK) { return (ACPI_PSM_FAILURE); } /* * Assume that the link device is invalid if no _CRS method * exists, since _CRS method is a required method */ if (AcpiGetHandle(lnkobj, "_CRS", &tmpobj) != AE_OK) { return (ACPI_PSM_FAILURE); } ASSERT(acpipsmlnkp != NULL); acpipsmlnkp->lnkobj = lnkobj; if ((acpi_get_irq_lnk_cache_ent(lnkobj, pci_irqp, intr_flagp)) == ACPI_PSM_SUCCESS) { PSM_VERBOSE_IRQ((CE_CONT, "!psm: link object found from cache " " for device %s, instance #%d, irq no %d/n", ddi_get_name(dip), ddi_get_instance(dip), *pci_irqp)); return (ACPI_PSM_SUCCESS); } else { if (acpica_eval_int(lnkobj, "_STA", &status) == AE_OK) { acpipsmlnkp->device_status = (uchar_t)status; } return (ACPI_PSM_PARTIAL); }}
开发者ID:MatiasNAmendola,项目名称:AuroraUX-SunOS,代码行数:55,
示例17: AcpiUtGetMutexObjectstatic ACPI_STATUSAcpiUtGetMutexObject ( ACPI_HANDLE Handle, ACPI_STRING Pathname, ACPI_OPERAND_OBJECT **RetObj){ ACPI_NAMESPACE_NODE *MutexNode; ACPI_OPERAND_OBJECT *MutexObj; ACPI_STATUS Status; /* Parameter validation */ if (!RetObj || (!Handle && !Pathname)) { return (AE_BAD_PARAMETER); } /* Get a the namespace node for the mutex */ MutexNode = Handle; if (Pathname != NULL) { Status = AcpiGetHandle (Handle, Pathname, ACPI_CAST_PTR (ACPI_HANDLE, &MutexNode)); if (ACPI_FAILURE (Status)) { return (Status); } } /* Ensure that we actually have a Mutex object */ if (!MutexNode || (MutexNode->Type != ACPI_TYPE_MUTEX)) { return (AE_TYPE); } /* Get the low-level mutex object */ MutexObj = AcpiNsGetAttachedObject (MutexNode); if (!MutexObj) { return (AE_NULL_OBJECT); } *RetObj = MutexObj; return (AE_OK);}
开发者ID:ErfanBagheri,项目名称:haiku,代码行数:50,
示例18: acpi_psm_initintacpi_psm_init(char *module_name, int verbose_flags){ psm_module_name = module_name; psm_verbose = verbose_flags; if (AcpiGetHandle(NULL, "//_SB", &acpi_sbobj) != AE_OK) { cmn_err(CE_WARN, "!psm: get _SB failed"); return (ACPI_PSM_FAILURE); } mutex_init(&acpi_irq_cache_mutex, NULL, MUTEX_DEFAULT, NULL); return (ACPI_PSM_SUCCESS);}
开发者ID:MatiasNAmendola,项目名称:AuroraUX-SunOS,代码行数:17,
示例19: radeon_atpx_pci_probe_handle/** * radeon_atpx_pci_probe_handle - look up the ATPX handle * * @pdev: pci device * * Look up the ATPX handles (all asics). * Returns true if the handles are found, false if not. */static bool radeon_atpx_pci_probe_handle(struct pci_dev *pdev){ ACPI_HANDLE dhandle, atpx_handle; ACPI_STATUS status; dhandle = DEVICE_ACPI_HANDLE(&pdev->dev); if (!dhandle) return false; status = AcpiGetHandle(dhandle, "ATPX", &atpx_handle); if (ACPI_FAILURE(status)) return false; radeon_atpx_priv.dhandle = dhandle; radeon_atpx_priv.atpx.handle = atpx_handle; return true;}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:25,
示例20: thinkpad_resumestatic boolthinkpad_resume(device_t dv PMF_FN_ARGS){ ACPI_STATUS rv; ACPI_HANDLE pubs; rv = AcpiGetHandle(NULL, "//_SB.PCI0.LPC.EC.PUBS", &pubs); if (ACPI_FAILURE(rv)) return true; /* not fatal */ rv = AcpiEvaluateObject(pubs, "_ON", NULL, NULL); if (ACPI_FAILURE(rv)) aprint_error_dev(dv, "failed to execute PUBS._ON: %s/n", AcpiFormatException(rv)); return true;}
开发者ID:lacombar,项目名称:netbsd-alc,代码行数:17,
示例21: acpi_dock_probestatic intacpi_dock_probe(device_t dev){ ACPI_HANDLE h, tmp; h = acpi_get_handle(dev); if (acpi_disabled("dock") || ACPI_FAILURE(AcpiGetHandle(h, "_DCK", &tmp))) return (ENXIO); device_set_desc(dev, "ACPI Docking Station"); /* * XXX Somewhere else in the kernel panics on "sysctl kern" if we * return a negative value here (reprobe ok). */ return (0);}
开发者ID:DangerDexter,项目名称:FreeBSD-8.0-dyntick,代码行数:18,
示例22: fujitsu_hk_cap/* * fujitsu_hk_cap: * * Returns true if and only if (a) the object handle.path exists and * (b) this object is a method or has the given type. */static boolfujitsu_hk_cap(ACPI_HANDLE handle, const char *path, ACPI_OBJECT_TYPE type){ ACPI_HANDLE hdl; ACPI_OBJECT_TYPE typ; KASSERT(handle != NULL); if (ACPI_FAILURE(AcpiGetHandle(handle, path, &hdl))) return false; if (ACPI_FAILURE(AcpiGetType(hdl, &typ))) return false; if (typ != ACPI_TYPE_METHOD && typ != type) return false; return true;}
开发者ID:ryo,项目名称:netbsd-src,代码行数:25,
示例23: get_objectstatus_tget_object(const char* path, acpi_object_type** _returnValue){ ACPI_HANDLE handle; ACPI_BUFFER buffer; ACPI_STATUS status; status = AcpiGetHandle(NULL, (ACPI_STRING)path, &handle); if (status != AE_OK) return B_ENTRY_NOT_FOUND; buffer.Pointer = NULL; buffer.Length = ACPI_ALLOCATE_BUFFER; status = AcpiEvaluateObject(handle, NULL, NULL, &buffer); *_returnValue = (acpi_object_type*)buffer.Pointer; return status == AE_OK ? B_OK : B_ERROR;}
开发者ID:simonsouth,项目名称:haiku,代码行数:19,
示例24: AcpiNsDumpRootDevicesvoidAcpiNsDumpRootDevices (void){ ACPI_HANDLE SysBusHandle; PROC_NAME ("NsDumpRootDevices"); /* Only dump the table if tracing is enabled */ if (!(ACPI_LV_TABLES & AcpiDbgLevel)) { return; } AcpiGetHandle (0, NS_SYSTEM_BUS, &SysBusHandle); ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Display of all devices in the namespace:/n")); AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, SysBusHandle, ACPI_UINT32_MAX, NS_WALK_NO_UNLOCK, AcpiNsDumpOneDevice, NULL, NULL);}
开发者ID:MarginC,项目名称:kame,代码行数:22,
示例25: prt_attach_devicesstatic voidprt_attach_devices(ACPI_PCI_ROUTING_TABLE *entry, void *arg){ ACPI_HANDLE handle; device_t child, pcib; int error; /* We only care about entries that reference a link device. */ if (entry->Source == NULL || entry->Source[0] == '/0') return; /* * In practice, we only see SourceIndex's of 0 out in the wild. * When indices != 0 have been found, they've been bugs in the ASL. */ if (entry->SourceIndex != 0) return; /* Lookup the associated handle and device. */ pcib = (device_t)arg; if (ACPI_FAILURE(AcpiGetHandle(ACPI_ROOT_OBJECT, entry->Source, &handle))) return; child = acpi_get_device(handle); if (child == NULL) return; /* If the device hasn't been probed yet, force it to do so. */ error = device_probe_and_attach(child); if (error != 0) { device_printf(pcib, "failed to force attach of %s/n", acpi_name(handle)); return; } /* Add a reference for a specific bus/device/pin tuple. */ acpi_pci_link_add_reference(child, entry->SourceIndex, pcib, ACPI_ADR_PCI_SLOT(entry->Address), entry->Pin);}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:38,
示例26: get_device_hidstatus_tget_device_hid(const char *path, char *hid, size_t bufferLength){ ACPI_HANDLE handle; ACPI_DEVICE_INFO *info; TRACE("get_device_hid: path %s, hid %s/n", path, hid); if (AcpiGetHandle(NULL, (ACPI_STRING)path, &handle) != AE_OK) return B_ENTRY_NOT_FOUND; if (bufferLength < ACPI_DEVICE_ID_LENGTH) return B_BUFFER_OVERFLOW; if (AcpiGetObjectInfo(handle, &info) != AE_OK) return B_BAD_TYPE; if ((info->Valid & ACPI_VALID_HID) != 0) strlcpy(hid, info->HardwareId.String, bufferLength); else hid[0] = '/0'; AcpiOsFree(info); return B_OK;}
开发者ID:simonsouth,项目名称:haiku,代码行数:23,
示例27: AeMutexInterfacesstatic voidAeMutexInterfaces ( void){ ACPI_STATUS Status; ACPI_HANDLE MutexHandle; /* Get a handle to an AML mutex */ Status = AcpiGetHandle (NULL, "//MTX1", &MutexHandle); if (Status == AE_NOT_FOUND) { return; } ACPI_CHECK_OK (AcpiGetHandle, Status); if (ACPI_FAILURE (Status)) { return; } /* Acquire the mutex */ Status = AcpiAcquireMutex (NULL, "//MTX1", 0xFFFF); ACPI_CHECK_OK (AcpiAcquireMutex, Status); if (ACPI_FAILURE (Status)) { return; } /* Release mutex with different parameters */ Status = AcpiReleaseMutex (MutexHandle, NULL); ACPI_CHECK_OK (AcpiReleaseMutex, Status);}
开发者ID:ryo,项目名称:netbsd-src,代码行数:36,
示例28: PyErr_Formatstatic PyObject *bits_acpi_get_object_info(PyObject *self, PyObject *args){ char *pathname; ACPI_HANDLE handle = 0; ACPI_DEVICE_INFO *info = NULL; PyObject *ret; ACPI_DEVICE_INFO *addr; if (!PyArg_ParseTuple(args, "s", &pathname)) return NULL; if (acpica_init() != GRUB_ERR_NONE) return PyErr_Format(PyExc_RuntimeError, "ACPICA module failed to initialize."); if (ACPI_FAILURE(AcpiGetHandle(NULL, pathname, &handle)) || (handle == 0)) return PyErr_Format(PyExc_RuntimeError, "Couldn't get object handle for /"%s/"", pathname); if (ACPI_FAILURE(AcpiGetObjectInfo(handle, &info))) return PyErr_Format(PyExc_RuntimeError, "Couldn't get object info for /"%s/"", pathname); ret = Py_BuildValue("(s#k)", info, info->InfoSize, info); ACPI_FREE(info); return ret;}
开发者ID:mfleming,项目名称:bits,代码行数:24,
示例29: AcpiDbCreateExecutionThreads//.........这里部分代码省略......... AcpiOsPrintf ("Could not create semaphore for synchronization of AcpiGbl_DbMethodInfo, %s/n", AcpiFormatException (Status)); (void) AcpiOsDeleteSemaphore (ThreadCompleteGate); (void) AcpiOsDeleteSemaphore (MainThreadGate); return; } ACPI_MEMSET (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO)); /* Array to store IDs of threads */ AcpiGbl_DbMethodInfo.NumThreads = NumThreads; Size = sizeof (ACPI_THREAD_ID) * AcpiGbl_DbMethodInfo.NumThreads; AcpiGbl_DbMethodInfo.Threads = AcpiOsAllocate (Size); if (AcpiGbl_DbMethodInfo.Threads == NULL) { AcpiOsPrintf ("No memory for thread IDs array/n"); (void) AcpiOsDeleteSemaphore (MainThreadGate); (void) AcpiOsDeleteSemaphore (ThreadCompleteGate); (void) AcpiOsDeleteSemaphore (InfoGate); return; } ACPI_MEMSET (AcpiGbl_DbMethodInfo.Threads, 0, Size); /* Setup the context to be passed to each thread */ AcpiGbl_DbMethodInfo.Name = MethodNameArg; AcpiGbl_DbMethodInfo.Flags = 0; AcpiGbl_DbMethodInfo.NumLoops = NumLoops; AcpiGbl_DbMethodInfo.MainThreadGate = MainThreadGate; AcpiGbl_DbMethodInfo.ThreadCompleteGate = ThreadCompleteGate; AcpiGbl_DbMethodInfo.InfoGate = InfoGate; /* Init arguments to be passed to method */ AcpiGbl_DbMethodInfo.InitArgs = 1; AcpiGbl_DbMethodInfo.Args = AcpiGbl_DbMethodInfo.Arguments; AcpiGbl_DbMethodInfo.Arguments[0] = AcpiGbl_DbMethodInfo.NumThreadsStr; AcpiGbl_DbMethodInfo.Arguments[1] = AcpiGbl_DbMethodInfo.IdOfThreadStr; AcpiGbl_DbMethodInfo.Arguments[2] = AcpiGbl_DbMethodInfo.IndexOfThreadStr; AcpiGbl_DbMethodInfo.Arguments[3] = NULL; AcpiGbl_DbMethodInfo.Types = AcpiGbl_DbMethodInfo.ArgTypes; AcpiGbl_DbMethodInfo.ArgTypes[0] = ACPI_TYPE_INTEGER; AcpiGbl_DbMethodInfo.ArgTypes[1] = ACPI_TYPE_INTEGER; AcpiGbl_DbMethodInfo.ArgTypes[2] = ACPI_TYPE_INTEGER; AcpiDbUint32ToHexString (NumThreads, AcpiGbl_DbMethodInfo.NumThreadsStr); Status = AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo); if (ACPI_FAILURE (Status)) { goto CleanupAndExit; } /* Get the NS node, determines existence also */ Status = AcpiGetHandle (NULL, AcpiGbl_DbMethodInfo.Pathname, &AcpiGbl_DbMethodInfo.Method); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("%s Could not get handle for %s/n", AcpiFormatException (Status), AcpiGbl_DbMethodInfo.Pathname); goto CleanupAndExit; } /* Create the threads */ AcpiOsPrintf ("Creating %X threads to execute %X times each/n", NumThreads, NumLoops); for (i = 0; i < (NumThreads); i++) { Status = AcpiOsExecute (OSL_DEBUGGER_THREAD, AcpiDbMethodThread, &AcpiGbl_DbMethodInfo); if (ACPI_FAILURE (Status)) { break; } } /* Wait for all threads to complete */ (void) AcpiOsWaitSemaphore (MainThreadGate, 1, ACPI_WAIT_FOREVER); AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT); AcpiOsPrintf ("All threads (%X) have completed/n", NumThreads); AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);CleanupAndExit: /* Cleanup and exit */ (void) AcpiOsDeleteSemaphore (MainThreadGate); (void) AcpiOsDeleteSemaphore (ThreadCompleteGate); (void) AcpiOsDeleteSemaphore (InfoGate); AcpiOsFree (AcpiGbl_DbMethodInfo.Threads); AcpiGbl_DbMethodInfo.Threads = NULL;}
开发者ID:Lxg1582,项目名称:freebsd,代码行数:101,
示例30: AcpiDbExecutevoidAcpiDbExecute ( char *Name, char **Args, ACPI_OBJECT_TYPE *Types, UINT32 Flags){ ACPI_STATUS Status; ACPI_BUFFER ReturnObj; char *NameString;#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, NULL); return; } else { NameString = ACPI_ALLOCATE (ACPI_STRLEN (Name) + 1); if (!NameString) { return; } ACPI_MEMSET (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO)); ACPI_STRCPY (NameString, Name); AcpiUtStrupr (NameString); AcpiGbl_DbMethodInfo.Name = NameString; AcpiGbl_DbMethodInfo.Args = Args; AcpiGbl_DbMethodInfo.Types = Types; AcpiGbl_DbMethodInfo.Flags = Flags; ReturnObj.Pointer = NULL; ReturnObj.Length = ACPI_ALLOCATE_BUFFER; Status = AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo); if (ACPI_FAILURE (Status)) { ACPI_FREE (NameString); return; } /* Get the NS node, determines existence also */ Status = AcpiGetHandle (NULL, AcpiGbl_DbMethodInfo.Pathname, &AcpiGbl_DbMethodInfo.Method); if (ACPI_SUCCESS (Status)) { Status = AcpiDbExecuteMethod (&AcpiGbl_DbMethodInfo, &ReturnObj); } ACPI_FREE (NameString); } /* * Allow any handlers in separate threads to complete. * (Such as Notify handlers invoked from AML executed above). */ AcpiOsSleep ((UINT64) 10);#ifdef ACPI_DEBUG_OUTPUT /* Memory allocation tracking */ Allocations = AcpiDbGetOutstandingAllocations () - PreviousAllocations; AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT); if (Allocations > 0) { AcpiOsPrintf ("0x%X Outstanding allocations after evaluation of %s/n", Allocations, AcpiGbl_DbMethodInfo.Pathname); }#endif if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Evaluation of %s failed with status %s/n", AcpiGbl_DbMethodInfo.Pathname, AcpiFormatException (Status)); } else { /* Display a return object, if any */ if (ReturnObj.Length) { AcpiOsPrintf ( "Evaluation of %s returned object %p, external buffer length %X/n",//.........这里部分代码省略.........
开发者ID:Lxg1582,项目名称:freebsd,代码行数:101,
注:本文中的AcpiGetHandle函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AcpiGetTableByIndex函数代码示例 C++ AcpiFormatException函数代码示例 |