当前位置: 首页>>代码示例>>C++>>正文


C++ ACPI_TO_POINTER函数代码示例

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


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

示例1: AcpiDbGenerateGpe

void
AcpiDbGenerateGpe (
    char                    *GpeArg,
    char                    *BlockArg)
{
    UINT32                  BlockNumber = 0;
    UINT32                  GpeNumber;
    ACPI_GPE_EVENT_INFO     *GpeEventInfo;


    GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0);

    /*
     * If no block arg, or block arg == 0 or 1, use the FADT-defined
     * GPE blocks.
     */
    if (BlockArg)
    {
        BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0);
        if (BlockNumber == 1)
        {
            BlockNumber = 0;
        }
    }

    GpeEventInfo = AcpiEvGetGpeEventInfo (ACPI_TO_POINTER (BlockNumber),
        GpeNumber);
    if (!GpeEventInfo)
    {
        AcpiOsPrintf ("Invalid GPE\n");
        return;
    }

    (void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber);
}
开发者ID:zenny,项目名称:DragonFlyBSD,代码行数:35,代码来源:dbcmds.c

示例2: acpi_db_generate_gpe

void acpi_db_generate_gpe(char *gpe_arg, char *block_arg)
{
	u32 block_number = 0;
	u32 gpe_number;
	struct acpi_gpe_event_info *gpe_event_info;

	gpe_number = strtoul(gpe_arg, NULL, 0);

	/*
	 * If no block arg, or block arg == 0 or 1, use the FADT-defined
	 * GPE blocks.
	 */
	if (block_arg) {
		block_number = strtoul(block_arg, NULL, 0);
		if (block_number == 1) {
			block_number = 0;
		}
	}

	gpe_event_info =
	    acpi_ev_get_gpe_event_info(ACPI_TO_POINTER(block_number),
				       gpe_number);
	if (!gpe_event_info) {
		acpi_os_printf("Invalid GPE\n");
		return;
	}

	(void)acpi_ev_gpe_dispatch(NULL, gpe_event_info, gpe_number);
}
开发者ID:125radheyshyam,项目名称:linux-1,代码行数:29,代码来源:dbcmds.c

示例3: AcpiDbGetPointer

void *
AcpiDbGetPointer (
    void                    *Target)
{
    void                    *ObjPtr;


#if ACPI_MACHINE_WIDTH == 16
#include <stdio.h>

    /* Have to handle 16-bit pointers of the form segment:offset */

    if (!sscanf (Target, "%p", &ObjPtr))
    {
        AcpiOsPrintf ("Invalid pointer: %s\n", Target);
        return (NULL);
    }

#else

    /* Simple flat pointer */

    ObjPtr = ACPI_TO_POINTER (ACPI_STRTOUL (Target, NULL, 16));
#endif

    return (ObjPtr);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:27,代码来源:dbdisply.c

示例4: AcpiOsMapMemory

void *
AcpiOsMapMemory (
    ACPI_PHYSICAL_ADDRESS   Where,
    ACPI_SIZE               Length)
{

    return (ACPI_TO_POINTER ((ACPI_SIZE) Where));
}
开发者ID:zenny,项目名称:DragonFlyBSD,代码行数:8,代码来源:oswintbl.c

示例5: strtoul

static void *acpi_db_get_pointer(void *target)
{
	void *obj_ptr;
	acpi_size address;

	address = strtoul(target, NULL, 16);
	obj_ptr = ACPI_TO_POINTER(address);
	return (obj_ptr);
}
开发者ID:a2hojsjsjs,项目名称:linux,代码行数:9,代码来源:dbdisply.c

示例6: acpi_db_dump_buffer

void acpi_db_dump_buffer(u32 address)
{

	acpi_os_printf("\nLocation %X:\n", address);

	acpi_dbg_level |= ACPI_LV_TABLES;
	acpi_ut_debug_dump_buffer(ACPI_TO_POINTER(address), 64, DB_BYTE_DISPLAY,
				  ACPI_UINT32_MAX);
}
开发者ID:a2hojsjsjs,项目名称:linux,代码行数:9,代码来源:dbutils.c

示例7: AcpiDbDisplayObjectType

void
AcpiDbDisplayObjectType (
    char                    *ObjectArg)
{
    ACPI_HANDLE             Handle;
    ACPI_DEVICE_INFO        *Info;
    ACPI_STATUS             Status;
    UINT32                  i;


    Handle = ACPI_TO_POINTER (strtoul (ObjectArg, NULL, 16));

    Status = AcpiGetObjectInfo (Handle, &Info);
    if (ACPI_FAILURE (Status))
    {
        AcpiOsPrintf ("Could not get object info, %s\n",
            AcpiFormatException (Status));
        return;
    }

    AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
        ACPI_FORMAT_UINT64 (Info->Address),
        Info->CurrentStatus, Info->Flags);

    AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
        Info->HighestDstates[0], Info->HighestDstates[1],
        Info->HighestDstates[2], Info->HighestDstates[3]);

    AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
        Info->LowestDstates[0], Info->LowestDstates[1],
        Info->LowestDstates[2], Info->LowestDstates[3],
        Info->LowestDstates[4]);

    if (Info->Valid & ACPI_VALID_HID)
    {
        AcpiOsPrintf ("HID: %s\n", Info->HardwareId.String);
    }

    if (Info->Valid & ACPI_VALID_UID)
    {
        AcpiOsPrintf ("UID: %s\n", Info->UniqueId.String);
    }

    if (Info->Valid & ACPI_VALID_CID)
    {
        for (i = 0; i < Info->CompatibleIdList.Count; i++)
        {
            AcpiOsPrintf ("CID %u: %s\n", i,
                Info->CompatibleIdList.Ids[i].String);
        }
    }

    ACPI_FREE (Info);
}
开发者ID:ikitayama,项目名称:acpica-tools,代码行数:54,代码来源:dbdisply.c

示例8: AcpiDbDumpBuffer

void
AcpiDbDumpBuffer (
    UINT32                  Address)
{

    AcpiOsPrintf ("\nLocation %X:\n", Address);

    AcpiDbgLevel |= ACPI_LV_TABLES;
    AcpiUtDebugDumpBuffer (ACPI_TO_POINTER (Address), 64, DB_BYTE_DISPLAY,
            ACPI_UINT32_MAX);
}
开发者ID:cloudius-systems,项目名称:acpica,代码行数:11,代码来源:dbutils.c

示例9: AcpiDbGetPointer

static void *
AcpiDbGetPointer (
    void                    *Target)
{
    void                    *ObjPtr;
    ACPI_SIZE               Address;


    Address = strtoul (Target, NULL, 16);
    ObjPtr = ACPI_TO_POINTER (Address);
    return (ObjPtr);
}
开发者ID:iHaD,项目名称:DragonFlyBSD,代码行数:12,代码来源:dbdisply.c

示例10: LsGenerateListing

static void
LsGenerateListing (
    UINT32                  FileId)
{
    UINT32                  WalkMode = ASL_WALK_VISIT_DOWNWARD | ASL_WALK_VISIT_DB_SEPARATELY;

    /* Start at the beginning of both the source and AML files */

    FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0);
    FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
    AslGbl_SourceLine = 0;
    AslGbl_CurrentHexColumn = 0;
    LsPushNode (AslGbl_Files[ASL_FILE_INPUT].Filename);

    if (FileId == ASL_FILE_C_OFFSET_OUTPUT)
    {
        AslGbl_CurrentAmlOffset = 0;

        /* Offset table file has a special header and footer */

        LsDoOffsetTableHeader (FileId);

        TrWalkParseTree (AslGbl_CurrentDB, WalkMode,
            LsAmlOffsetWalk, NULL, (void *) ACPI_TO_POINTER (FileId));
        LsDoOffsetTableFooter (FileId);
        return;
    }

    /* Process all parse nodes */

    TrWalkParseTree (AslGbl_CurrentDB, WalkMode,
        LsAmlListingWalk, NULL, (void *) ACPI_TO_POINTER (FileId));

    /* Final processing */

    LsFinishSourceListing (FileId);
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:37,代码来源:asllisting.c

示例11: AcpiDbConvertToNode

ACPI_NAMESPACE_NODE *
AcpiDbConvertToNode (
    char                    *InString)
{
    ACPI_NAMESPACE_NODE     *Node;
    ACPI_SIZE               Address;


    if ((*InString >= 0x30) && (*InString <= 0x39))
    {
        /* Numeric argument, convert */

        Address = strtoul (InString, NULL, 16);
        Node = ACPI_TO_POINTER (Address);
        if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
        {
            AcpiOsPrintf ("Address %p is invalid",
                Node);
            return (NULL);
        }

        /* Make sure pointer is valid NS node */

        if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
        {
            AcpiOsPrintf ("Address %p is not a valid namespace node [%s]\n",
                    Node, AcpiUtGetDescriptorName (Node));
            return (NULL);
        }
    }
    else
    {
        /*
         * Alpha argument: The parameter is a name string that must be
         * resolved to a Namespace object.
         */
        Node = AcpiDbLocalNsLookup (InString);
        if (!Node)
        {
            AcpiOsPrintf (
                "Could not find [%s] in namespace, defaulting to root node\n",
                InString);
            Node = AcpiGbl_RootNode;
        }
    }

    return (Node);
}
开发者ID:iHaD,项目名称:DragonFlyBSD,代码行数:48,代码来源:dbcmds.c

示例12: acpi_db_find_references

void acpi_db_find_references(char *object_arg)
{
	union acpi_operand_object *obj_desc;
	acpi_size address;

	/* Convert string to object pointer */

	address = strtoul(object_arg, NULL, 16);
	obj_desc = ACPI_TO_POINTER(address);

	/* Search all nodes in namespace */

	(void)acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
				  ACPI_UINT32_MAX, acpi_db_walk_for_references,
				  NULL, (void *)obj_desc, NULL);
}
开发者ID:JamesChenFromChina,项目名称:linux,代码行数:16,代码来源:dbnames.c

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

示例14: acpi_db_display_object_type

void acpi_db_display_object_type(char *object_arg)
{
	acpi_handle handle;
	struct acpi_device_info *info;
	acpi_status status;
	u32 i;

	handle = ACPI_TO_POINTER(strtoul(object_arg, NULL, 16));

	status = acpi_get_object_info(handle, &info);
	if (ACPI_FAILURE(status)) {
		acpi_os_printf("Could not get object info, %s\n",
			       acpi_format_exception(status));
		return;
	}

	acpi_os_printf("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
		       ACPI_FORMAT_UINT64(info->address),
		       info->current_status, info->flags);

	acpi_os_printf("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
		       info->highest_dstates[0], info->highest_dstates[1],
		       info->highest_dstates[2], info->highest_dstates[3]);

	acpi_os_printf("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
		       info->lowest_dstates[0], info->lowest_dstates[1],
		       info->lowest_dstates[2], info->lowest_dstates[3],
		       info->lowest_dstates[4]);

	if (info->valid & ACPI_VALID_HID) {
		acpi_os_printf("HID: %s\n", info->hardware_id.string);
	}

	if (info->valid & ACPI_VALID_UID) {
		acpi_os_printf("UID: %s\n", info->unique_id.string);
	}

	if (info->valid & ACPI_VALID_CID) {
		for (i = 0; i < info->compatible_id_list.count; i++) {
			acpi_os_printf("CID %u: %s\n", i,
				       info->compatible_id_list.ids[i].string);
		}
	}

	ACPI_FREE(info);
}
开发者ID:a2hojsjsjs,项目名称:linux,代码行数:46,代码来源:dbdisply.c

示例15: AcpiPsPushScope

ACPI_STATUS
AcpiPsPushScope (
    ACPI_PARSE_STATE        *ParserState,
    ACPI_PARSE_OBJECT       *Op,
    UINT32                  RemainingArgs,
    UINT32                  ArgCount)
{
    ACPI_GENERIC_STATE      *Scope;


    ACPI_FUNCTION_TRACE_PTR (PsPushScope, Op);


    Scope = AcpiUtCreateGenericState ();
    if (!Scope)
    {
        return_ACPI_STATUS (AE_NO_MEMORY);
    }

    Scope->Common.DescriptorType = ACPI_DESC_TYPE_STATE_PSCOPE;
    Scope->ParseScope.Op = Op;
    Scope->ParseScope.ArgList = RemainingArgs;
    Scope->ParseScope.ArgCount = ArgCount;
    Scope->ParseScope.PkgEnd = ParserState->PkgEnd;

    /* Push onto scope stack */

    AcpiUtPushGenericState (&ParserState->Scope, Scope);

    if (ArgCount == ACPI_VAR_ARGS)
    {
        /* Multiple arguments */

        Scope->ParseScope.ArgEnd = ParserState->PkgEnd;
    }
    else
    {
        /* Single argument */

        Scope->ParseScope.ArgEnd = ACPI_TO_POINTER (ACPI_MAX_PTR);
    }

    return_ACPI_STATUS (AE_OK);
}
开发者ID:hoangduit,项目名称:reactos,代码行数:44,代码来源:psscope.c


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