本文整理匯總了C++中ACPI_STRTOUL函數的典型用法代碼示例。如果您正苦於以下問題:C++ ACPI_STRTOUL函數的具體用法?C++ ACPI_STRTOUL怎麽用?C++ ACPI_STRTOUL使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ACPI_STRTOUL函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: AcpiDbDumpNamespaceByOwner
void
AcpiDbDumpNamespaceByOwner (
char *OwnerArg,
char *DepthArg)
{
ACPI_HANDLE SubtreeEntry = AcpiGbl_RootNode;
UINT32 MaxDepth = ACPI_UINT32_MAX;
ACPI_OWNER_ID OwnerId;
OwnerId = (ACPI_OWNER_ID) ACPI_STRTOUL (OwnerArg, NULL, 0);
/* Now we can check for the depth argument */
if (DepthArg)
{
MaxDepth = ACPI_STRTOUL (DepthArg, NULL, 0);
}
AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
AcpiOsPrintf ("ACPI Namespace by owner %X:\n", OwnerId);
/* Display the subtree */
AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth, OwnerId,
SubtreeEntry);
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
}
示例2: 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);
}
示例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: AcpiDbSetMethodBreakpoint
void
AcpiDbSetMethodBreakpoint (
char *Location,
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op)
{
UINT32 Address;
if (!Op)
{
AcpiOsPrintf ("There is no method currently executing\n");
return;
}
/* Get and verify the breakpoint address */
Address = ACPI_STRTOUL (Location, NULL, 16);
if (Address <= Op->Common.AmlOffset)
{
AcpiOsPrintf ("Breakpoint %X is beyond current address %X\n",
Address, Op->Common.AmlOffset);
}
/* Save breakpoint in current walk */
WalkState->UserBreakpoint = Address;
AcpiOsPrintf ("Breakpoint set at AML offset %X\n", Address);
}
示例5: AcpiDbExecuteMethod
static ACPI_STATUS
AcpiDbExecuteMethod (
ACPI_DB_METHOD_INFO *Info,
ACPI_BUFFER *ReturnObj)
{
ACPI_STATUS Status;
ACPI_OBJECT_LIST ParamObjects;
ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS];
UINT32 i;
if (AcpiGbl_DbOutputToFile && !AcpiDbgLevel)
{
AcpiOsPrintf ("Warning: debug output is not enabled!\n");
}
/* Are there arguments to the method? */
if (Info->Args && Info->Args[0])
{
for (i = 0; Info->Args[i] && i < ACPI_METHOD_NUM_ARGS; i++)
{
Params[i].Type = ACPI_TYPE_INTEGER;
Params[i].Integer.Value = ACPI_STRTOUL (Info->Args[i], NULL, 16);
}
ParamObjects.Pointer = Params;
ParamObjects.Count = i;
}
else
{
/* Setup default parameters */
Params[0].Type = ACPI_TYPE_INTEGER;
Params[0].Integer.Value = 0x01020304;
Params[1].Type = ACPI_TYPE_STRING;
Params[1].String.Length = 12;
Params[1].String.Pointer = "AML Debugger";
ParamObjects.Pointer = Params;
ParamObjects.Count = 2;
}
/* Prepare for a return object of arbitrary size */
ReturnObj->Pointer = AcpiGbl_DbBuffer;
ReturnObj->Length = ACPI_DEBUG_BUFFER_SIZE;
/* Do the actual method execution */
AcpiGbl_MethodExecuting = TRUE;
Status = AcpiEvaluateObject (NULL,
Info->Pathname, &ParamObjects, ReturnObj);
AcpiGbl_CmSingleStep = FALSE;
AcpiGbl_MethodExecuting = FALSE;
return (Status);
}
示例6: AcpiDbSleep
ACPI_STATUS
AcpiDbSleep (
char *ObjectArg)
{
UINT8 SleepState;
UINT32 i;
ACPI_FUNCTION_TRACE (AcpiDbSleep);
/* Null input (no arguments) means to invoke all sleep states */
if (!ObjectArg)
{
AcpiOsPrintf ("Invoking all possible sleep states, 0-%d\n",
ACPI_S_STATES_MAX);
for (i = 0; i <= ACPI_S_STATES_MAX; i++)
{
AcpiDbDoOneSleepState ((UINT8) i);
}
return_ACPI_STATUS (AE_OK);
}
/* Convert argument to binary and invoke the sleep state */
SleepState = (UINT8) ACPI_STRTOUL (ObjectArg, NULL, 0);
AcpiDbDoOneSleepState (SleepState);
return_ACPI_STATUS (AE_OK);
}
示例7: AcpiDbGetPointer
static void *
AcpiDbGetPointer (
void *Target)
{
void *ObjPtr;
ACPI_SIZE Address;
Address = ACPI_STRTOUL (Target, NULL, 16);
ObjPtr = ACPI_TO_POINTER (Address);
return (ObjPtr);
}
示例8: AcpiDbSleep
ACPI_STATUS
AcpiDbSleep (
char *ObjectArg)
{
ACPI_STATUS Status;
UINT8 SleepState;
ACPI_FUNCTION_TRACE (AcpiDbSleep);
SleepState = (UINT8) ACPI_STRTOUL (ObjectArg, NULL, 0);
AcpiOsPrintf ("**** Prepare to sleep ****\n");
Status = AcpiEnterSleepStatePrep (SleepState);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
AcpiOsPrintf ("**** Going to sleep ****\n");
Status = AcpiEnterSleepState (SleepState);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
AcpiOsPrintf ("**** Prepare to return from sleep ****\n");
Status = AcpiLeaveSleepStatePrep (SleepState);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
AcpiOsPrintf ("**** Returning from sleep ****\n");
Status = AcpiLeaveSleepState (SleepState);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
return (Status);
ErrorExit:
ACPI_EXCEPTION ((AE_INFO, Status, "During sleep test"));
return (Status);
}
示例9: AcpiDbGenerateGpe
void
AcpiDbGenerateGpe (
char *GpeArg,
char *BlockArg)
{
UINT32 BlockNumber;
UINT32 GpeNumber;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0);
BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0);
GpeEventInfo = AcpiEvGetGpeEventInfo (ACPI_TO_POINTER (BlockNumber),
GpeNumber);
if (!GpeEventInfo)
{
AcpiOsPrintf ("Invalid GPE\n");
return;
}
(void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber);
}
示例10: 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);
}
示例11: AcpiDbConvertToNode
ACPI_NAMESPACE_NODE *
AcpiDbConvertToNode (
char *InString)
{
ACPI_NAMESPACE_NODE *Node;
ACPI_SIZE Address;
if ((*InString >= 0x30) && (*InString <= 0x39))
{
/* Numeric argument, convert */
Address = ACPI_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: AcpiDbConvertToNode
ACPI_NAMESPACE_NODE *
AcpiDbConvertToNode (
char *InString)
{
ACPI_NAMESPACE_NODE *Node;
if ((*InString >= 0x30) && (*InString <= 0x39))
{
/* Numeric argument, convert */
Node = ACPI_TO_POINTER (ACPI_STRTOUL (InString, NULL, 16));
if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
{
AcpiOsPrintf ("Address %p is invalid in this address space\n",
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 NS node [%s]\n",
Node, AcpiUtGetDescriptorName (Node));
return (NULL);
}
}
else
{
/* Alpha argument */
/* The parameter is a name string that must be resolved to a
* Named obj
*/
Node = AcpiDbLocalNsLookup (InString);
if (!Node)
{
Node = AcpiGbl_RootNode;
}
}
return (Node);
}
示例13: AcpiDbGetFromHistory
char *
AcpiDbGetFromHistory (
char *CommandNumArg)
{
UINT32 CmdNum;
if (CommandNumArg == NULL)
{
CmdNum = AcpiGbl_NextCmdNum - 1;
}
else
{
CmdNum = ACPI_STRTOUL (CommandNumArg, NULL, 0);
}
return (AcpiDbGetHistoryByIndex (CmdNum));
}
示例14: AhDecodeAmlOpcode
void
AhDecodeAmlOpcode (
char *OpcodeString)
{
const AH_AML_OPCODE *Op;
UINT32 Opcode;
UINT8 Prefix;
if (!OpcodeString)
{
AhFindAmlOpcode (NULL);
return;
}
Opcode = ACPI_STRTOUL (OpcodeString, NULL, 16);
if (Opcode > ACPI_UINT16_MAX)
{
printf ("Invalid opcode (more than 16 bits)\n");
return;
}
/* Only valid opcode extension is 0x5B */
Prefix = (Opcode & 0x0000FF00) >> 8;
if (Prefix && (Prefix != 0x5B))
{
printf ("Invalid opcode (invalid extension prefix 0x%X)\n",
Prefix);
return;
}
/* Find/Display the opcode. May fall within an opcode range */
for (Op = AmlOpcodeInfo; Op->OpcodeString; Op++)
{
if ((Opcode >= Op->OpcodeRangeStart) &&
(Opcode <= Op->OpcodeRangeEnd))
{
AhDisplayAmlOpcode (Op);
}
}
}
示例15: AcpiDbGetFromHistory
char *
AcpiDbGetFromHistory (
char *CommandNumArg)
{
UINT32 i;
UINT16 HistoryIndex;
UINT32 CmdNum;
if (CommandNumArg == NULL)
{
CmdNum = AcpiGbl_NextCmdNum - 1;
}
else
{
CmdNum = ACPI_STRTOUL (CommandNumArg, NULL, 0);
}
/* Search history buffer */
HistoryIndex = AcpiGbl_LoHistory;
for (i = 0; i < AcpiGbl_NumHistory; i++)
{
if (AcpiGbl_HistoryBuffer[HistoryIndex].CmdNum == CmdNum)
{
/* Found the command, return it */
return (AcpiGbl_HistoryBuffer[HistoryIndex].Command);
}
HistoryIndex++;
if (HistoryIndex >= HISTORY_SIZE)
{
HistoryIndex = 0;
}
}
AcpiOsPrintf ("Invalid history number: %u\n", HistoryIndex);
return (NULL);
}