• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ AcpiGetHandle函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中AcpiGetHandle函数的典型用法代码示例。如果您正苦于以下问题:C++ AcpiGetHandle函数的具体用法?C++ AcpiGetHandle怎么用?C++ AcpiGetHandle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了AcpiGetHandle函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: AfInstallGpeBlock

static void
AfInstallGpeBlock (
    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,代码来源:aeexec.c


示例2: 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


示例3: pciehpc_acpi_hpc_init

/*
 * Intialize hot plug control for ACPI mode.
 */
static int
pciehpc_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,代码来源:pciehpc_acpi.c


示例4: acpi_GetReference

ACPI_HANDLE
acpi_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,代码来源:acpi_package.c


示例5: get_next_entry

status_t
get_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,代码来源:BusManager.cpp


示例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 int
psm_node_has_prt(ACPI_HANDLE *ah)
{
	ACPI_HANDLE rh;

	return (AcpiGetHandle(ah, "_PRT", &rh) == AE_OK);
}
开发者ID:MatiasNAmendola,项目名称:AuroraUX-SunOS,代码行数:14,代码来源:psm_common.c


示例7: 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);
}
开发者ID:yazshel,项目名称:netbsd-kernel,代码行数:31,代码来源:nsdumpdv.c


示例8: acpi_device_init_driver

static status_t
acpi_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,代码来源:Device.cpp


示例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.
 */
void
acpi_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", &params->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,代码来源:acpi_ec.c


示例10: acpi_pci_bind

static 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,代码来源:pci_bind.c


示例11: AeDoOneOverride

static void
AeDoOneOverride (
    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,代码来源:aeinitfile.c


示例12: GetLnkInfo

void
GetLnkInfo (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,代码来源:acpi.c


示例13: AcpiDbCreateExecutionThread

void
AcpiDbCreateExecutionThread (
    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,代码来源:dbexec.c


示例14: get_object_type

uint32
get_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,代码来源:BusManager.cpp


示例15: 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


示例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 int
acpi_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,代码来源:psm_common.c


示例17: AcpiUtGetMutexObject

static ACPI_STATUS
AcpiUtGetMutexObject (
    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,代码来源:utxfmutex.c


示例18: acpi_psm_init

int
acpi_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,代码来源:psm_common.c


示例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,代码来源:radeon_atpx_handler.c


示例20: thinkpad_resume

static bool
thinkpad_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,代码来源:thinkpad_acpi.c



注:本文中的AcpiGetHandle函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AcpiGetTableByIndex函数代码示例发布时间:2022-05-30
下一篇:
C++ AcpiFormatException函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap