本文整理汇总了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);
}
示例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);
}
示例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);
}
示例4: AcpiOsMapMemory
void *
AcpiOsMapMemory (
ACPI_PHYSICAL_ADDRESS Where,
ACPI_SIZE Length)
{
return (ACPI_TO_POINTER ((ACPI_SIZE) Where));
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例9: AcpiDbGetPointer
static void *
AcpiDbGetPointer (
void *Target)
{
void *ObjPtr;
ACPI_SIZE Address;
Address = strtoul (Target, NULL, 16);
ObjPtr = ACPI_TO_POINTER (Address);
return (ObjPtr);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}