这篇教程C++ ACPI_STRTOUL函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ACPI_STRTOUL函数的典型用法代码示例。如果您正苦于以下问题:C++ ACPI_STRTOUL函数的具体用法?C++ ACPI_STRTOUL怎么用?C++ ACPI_STRTOUL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ACPI_STRTOUL函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AcpiDbDumpNamespaceByOwnervoidAcpiDbDumpNamespaceByOwner ( 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);}
开发者ID:Aresthu,项目名称:ucore_plus,代码行数:29,
示例2: AcpiDbGenerateGpevoidAcpiDbGenerateGpe ( 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,
示例3: AcpiDbGetPointervoid *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,
示例4: AcpiDbSetMethodBreakpointvoidAcpiDbSetMethodBreakpoint ( 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);}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:29,
示例5: AcpiDbExecuteMethodstatic ACPI_STATUSAcpiDbExecuteMethod ( 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);}
开发者ID:andreiw,项目名称:polaris,代码行数:60,
示例6: AcpiDbSleepACPI_STATUSAcpiDbSleep ( 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);}
开发者ID:zenny,项目名称:DragonFlyBSD,代码行数:32,
示例7: AcpiDbGetPointerstatic void *AcpiDbGetPointer ( void *Target){ void *ObjPtr; ACPI_SIZE Address; Address = ACPI_STRTOUL (Target, NULL, 16); ObjPtr = ACPI_TO_POINTER (Address); return (ObjPtr);}
开发者ID:alexandermerritt,项目名称:dragonfly,代码行数:12,
示例8: AcpiDbSleepACPI_STATUSAcpiDbSleep ( 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);}
开发者ID:dmarion,项目名称:freebsd-armv6-sys,代码行数:49,
示例9: AcpiDbGenerateGpevoidAcpiDbGenerateGpe ( 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);}
开发者ID:dmarion,项目名称:freebsd-armv6-sys,代码行数:24,
示例10: AcpiDbFindReferencesvoidAcpiDbFindReferences ( 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,
示例11: AcpiDbConvertToNodeACPI_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);}
开发者ID:zenny,项目名称:DragonFlyBSD,代码行数:47,
示例12: AcpiDbConvertToNodeACPI_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);}
开发者ID:dmarion,项目名称:freebsd-armv6-sys,代码行数:43,
示例13: AcpiDbGetFromHistorychar *AcpiDbGetFromHistory ( char *CommandNumArg){ UINT32 CmdNum; if (CommandNumArg == NULL) { CmdNum = AcpiGbl_NextCmdNum - 1; } else { CmdNum = ACPI_STRTOUL (CommandNumArg, NULL, 0); } return (AcpiDbGetHistoryByIndex (CmdNum));}
开发者ID:Lxg1582,项目名称:freebsd,代码行数:19,
示例14: AhDecodeAmlOpcodevoidAhDecodeAmlOpcode ( 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); } }}
开发者ID:alexandermerritt,项目名称:dragonfly,代码行数:43,
示例15: AcpiDbGetFromHistorychar *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);}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:42,
示例16: AcpiDbDisassembleAmlvoidAcpiDbDisassembleAml ( char *Statements, ACPI_PARSE_OBJECT *Op){ UINT32 NumStatements = 8; if (!Op) { AcpiOsPrintf ("There is no method currently executing/n"); return; } if (Statements) { NumStatements = ACPI_STRTOUL (Statements, NULL, 0); } AcpiDmDisassemble (NULL, Op, NumStatements);}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:21,
示例17: AcpiDbEvaluateAllPredefinedNamesstatic voidAcpiDbEvaluateAllPredefinedNames ( char *CountArg){ ACPI_DB_EXECUTE_WALK Info; Info.Count = 0; Info.MaxCount = ACPI_UINT32_MAX; if (CountArg) { Info.MaxCount = ACPI_STRTOUL (CountArg, NULL, 0); } /* Search all nodes in namespace */ (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, AcpiDbEvaluateOnePredefinedName, NULL, (void *) &Info, NULL); AcpiOsPrintf ("Evaluated %u predefined names in the namespace/n", Info.Count);}
开发者ID:99corps,项目名称:runtime,代码行数:22,
示例18: AcpiDbDumpNamespacevoidAcpiDbDumpNamespace ( char *StartArg, char *DepthArg){ ACPI_HANDLE SubtreeEntry = AcpiGbl_RootNode; UINT32 MaxDepth = ACPI_UINT32_MAX; /* No argument given, just start at the root and dump entire namespace */ if (StartArg) { SubtreeEntry = AcpiDbConvertToNode (StartArg); if (!SubtreeEntry) { return; } /* Now we can check for the depth argument */ if (DepthArg) { MaxDepth = ACPI_STRTOUL (DepthArg, NULL, 0); } } AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT); AcpiOsPrintf ("ACPI Namespace (from %4.4s (%p) subtree):/n", ((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Name.Ascii, SubtreeEntry); /* Display the subtree */ AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT); AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth, ACPI_OWNER_ID_MAX, SubtreeEntry); AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);}
开发者ID:Aresthu,项目名称:ucore_plus,代码行数:38,
示例19: AcpiDbBatchExecutevoidAcpiDbBatchExecute ( char *CountArg){ ACPI_EXECUTE_WALK Info; Info.Count = 0; Info.MaxCount = ACPI_UINT32_MAX; if (CountArg) { Info.MaxCount = ACPI_STRTOUL (CountArg, NULL, 0); } /* Search all nodes in namespace */ (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, AcpiDbWalkForExecute, NULL, (void *) &Info, NULL); AcpiOsPrintf ("Executed %u predefined names in the namespace/n", Info.Count);}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:23,
示例20: AcpiDbCreateExecutionThreadsvoidAcpiDbCreateExecutionThreads ( char *NumThreadsArg, char *NumLoopsArg, char *MethodNameArg){ ACPI_STATUS Status; UINT32 NumThreads; UINT32 NumLoops; UINT32 i; UINT32 Size; ACPI_MUTEX MainThreadGate; ACPI_MUTEX ThreadCompleteGate; ACPI_MUTEX InfoGate; /* Get the arguments */ NumThreads = ACPI_STRTOUL (NumThreadsArg, NULL, 0); NumLoops = ACPI_STRTOUL (NumLoopsArg, NULL, 0); if (!NumThreads || !NumLoops) { AcpiOsPrintf ("Bad argument: Threads %X, Loops %X/n", NumThreads, NumLoops); return; } /* * Create the semaphore for synchronization of * the created threads with the main thread. */ Status = AcpiOsCreateSemaphore (1, 0, &MainThreadGate); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not create semaphore for synchronization with the main thread, %s/n", AcpiFormatException (Status)); return; } /* * Create the semaphore for synchronization * between the created threads. */ Status = AcpiOsCreateSemaphore (1, 1, &ThreadCompleteGate); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not create semaphore for synchronization between the created threads, %s/n", AcpiFormatException (Status)); (void) AcpiOsDeleteSemaphore (MainThreadGate); return; } Status = AcpiOsCreateSemaphore (1, 1, &InfoGate); if (ACPI_FAILURE (Status)) { 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;//.........这里部分代码省略.........
开发者ID:Lxg1582,项目名称:freebsd,代码行数:101,
示例21: OslTableInitializestatic ACPI_STATUSOslTableInitialize ( void){ char Buffer[32]; ACPI_TABLE_HEADER *MappedTable; UINT8 *TableAddress; UINT8 *RsdpAddress; ACPI_PHYSICAL_ADDRESS RsdpBase; ACPI_SIZE RsdpSize; ACPI_STATUS Status; u_long Address = 0; size_t Length = sizeof (Address); /* Get main ACPI tables from memory on first invocation of this function */ if (Gbl_MainTableObtained) { return (AE_OK); } /* Attempt to use kenv or sysctl to find RSD PTR record. */ if (Gbl_RsdpBase) { Address = Gbl_RsdpBase; } else if (kenv (KENV_GET, SYSTEM_KENV, Buffer, sizeof (Buffer)) > 0) { Address = ACPI_STRTOUL (Buffer, NULL, 0); } if (!Address) { if (sysctlbyname (SYSTEM_SYSCTL, &Address, &Length, NULL, 0) != 0) { Address = 0; } } if (Address) { RsdpBase = Address; RsdpSize = sizeof (Gbl_Rsdp); } else { RsdpBase = ACPI_HI_RSDP_WINDOW_BASE; RsdpSize = ACPI_HI_RSDP_WINDOW_SIZE; } /* Get RSDP from memory */ RsdpAddress = AcpiOsMapMemory (RsdpBase, RsdpSize); if (!RsdpAddress) { return (AE_BAD_ADDRESS); } /* Search low memory for the RSDP */ TableAddress = AcpiTbScanMemoryForRsdp (RsdpAddress, RsdpSize); if (!TableAddress) { AcpiOsUnmapMemory (RsdpAddress, RsdpSize); return (AE_ERROR); } ACPI_MEMCPY (&Gbl_Rsdp, TableAddress, sizeof (Gbl_Rsdp)); AcpiOsUnmapMemory (RsdpAddress, RsdpSize); /* Get XSDT from memory */ if (Gbl_Rsdp.Revision) { Status = OslMapTable (Gbl_Rsdp.XsdtPhysicalAddress, ACPI_SIG_XSDT, &MappedTable); if (ACPI_FAILURE (Status)) { return (Status); } Gbl_Revision = 2; Gbl_Xsdt = calloc (1, MappedTable->Length); if (!Gbl_Xsdt) { fprintf (stderr, "XSDT: Could not allocate buffer for table of length %X/n", MappedTable->Length); AcpiOsUnmapMemory (MappedTable, MappedTable->Length); return (AE_NO_MEMORY); } ACPI_MEMCPY (Gbl_Xsdt, MappedTable, MappedTable->Length); AcpiOsUnmapMemory (MappedTable, MappedTable->Length); } /* Get RSDT from memory */ if (Gbl_Rsdp.RsdtPhysicalAddress) {//.........这里部分代码省略.........
开发者ID:victoredwardocallaghan,项目名称:DragonFlyBSD,代码行数:101,
示例22: AcpiDbSetMethodDatavoidAcpiDbSetMethodData ( char *TypeArg, char *IndexArg, char *ValueArg){ char Type; UINT32 Index; UINT32 Value; ACPI_WALK_STATE *WalkState; ACPI_OPERAND_OBJECT *ObjDesc; ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node; /* Validate TypeArg */ AcpiUtStrupr (TypeArg); Type = TypeArg[0]; if ((Type != 'L') && (Type != 'A') && (Type != 'N')) { AcpiOsPrintf ("Invalid SET operand: %s/n", TypeArg); return; } Value = ACPI_STRTOUL (ValueArg, NULL, 16); if (Type == 'N') { Node = AcpiDbConvertToNode (IndexArg); if (Node->Type != ACPI_TYPE_INTEGER) { AcpiOsPrintf ("Can only set Integer nodes/n"); return; } ObjDesc = Node->Object; ObjDesc->Integer.Value = Value; return; } /* Get the index and value */ Index = ACPI_STRTOUL (IndexArg, NULL, 16); WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList); if (!WalkState) { AcpiOsPrintf ("There is no method currently executing/n"); return; } /* Create and initialize the new object */ ObjDesc = AcpiUtCreateIntegerObject ((UINT64) Value); if (!ObjDesc) { AcpiOsPrintf ("Could not create an internal object/n"); return; } /* Store the new object into the target */ switch (Type) { case 'A': /* Set a method argument */ if (Index > ACPI_METHOD_MAX_ARG) { AcpiOsPrintf ("Arg%u - Invalid argument name/n", Index); goto Cleanup; } Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_ARG, Index, ObjDesc, WalkState); if (ACPI_FAILURE (Status)) { goto Cleanup; } ObjDesc = WalkState->Arguments[Index].Object; AcpiOsPrintf ("Arg%u: ", Index); AcpiDmDisplayInternalObject (ObjDesc, WalkState); break; case 'L': /* Set a method local */ if (Index > ACPI_METHOD_MAX_LOCAL) { AcpiOsPrintf ("Local%u - Invalid local variable name/n", Index); goto Cleanup; } Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_LOCAL, Index, ObjDesc,//.........这里部分代码省略.........
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:101,
示例23: acpi_ev_save_method_infostatic acpi_statusacpi_ev_save_method_info ( acpi_handle obj_handle, u32 level, void *obj_desc, void **return_value){ struct acpi_gpe_block_info *gpe_block = (void *) obj_desc; struct acpi_gpe_event_info *gpe_event_info; u32 gpe_number; char name[ACPI_NAME_SIZE + 1]; u8 type; acpi_status status; ACPI_FUNCTION_TRACE ("ev_save_method_info"); /* Extract the name from the object and convert to a string */ ACPI_MOVE_32_TO_32 (name, &((struct acpi_namespace_node *) obj_handle)->name.integer); name[ACPI_NAME_SIZE] = 0; /* * Edge/Level determination is based on the 2nd character * of the method name */ switch (name[1]) { case 'L': type = ACPI_EVENT_LEVEL_TRIGGERED; break; case 'E': type = ACPI_EVENT_EDGE_TRIGGERED; break; default: /* Unknown method type, just ignore it! */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown GPE method type: %s (name not of form _Lnn or _Enn)/n", name)); return_ACPI_STATUS (AE_OK); } /* Convert the last two characters of the name to the GPE Number */ gpe_number = ACPI_STRTOUL (&name[2], NULL, 16); if (gpe_number == ACPI_UINT32_MAX) { /* Conversion failed; invalid method, just ignore it */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not extract GPE number from name: %s (name is not of form _Lnn or _Enn)/n", name)); return_ACPI_STATUS (AE_OK); } /* Ensure that we have a valid GPE number for this GPE block */ if ((gpe_number < gpe_block->block_base_number) || (gpe_number >= (gpe_block->block_base_number + (gpe_block->register_count * 8)))) { /* * Not valid for this GPE block, just ignore it * However, it may be valid for a different GPE block, since GPE0 and GPE1 * methods both appear under /_GPE. */ return_ACPI_STATUS (AE_OK); } /* * Now we can add this information to the gpe_event_info block * for use during dispatch of this GPE. */ gpe_event_info = &gpe_block->event_info[gpe_number - gpe_block->block_base_number]; gpe_event_info->flags = type; gpe_event_info->method_node = (struct acpi_namespace_node *) obj_handle; /* Enable the GPE (SCIs should be disabled at this point) */ status = acpi_hw_enable_gpe (gpe_event_info); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Registered GPE method %s as GPE number 0x%.2X/n", name, gpe_number)); return_ACPI_STATUS (AE_OK);}
开发者ID:dduval,项目名称:kernel-rhel3,代码行数:91,
示例24: acpi_ev_match_gpe_methodacpi_statusacpi_ev_match_gpe_method(acpi_handle obj_handle, u32 level, void *context, void **return_value){ struct acpi_namespace_node *method_node = ACPI_CAST_PTR(struct acpi_namespace_node, obj_handle); struct acpi_gpe_walk_info *walk_info = ACPI_CAST_PTR(struct acpi_gpe_walk_info, context); struct acpi_gpe_event_info *gpe_event_info; u32 gpe_number; char name[ACPI_NAME_SIZE + 1]; u8 type; ACPI_FUNCTION_TRACE(ev_match_gpe_method); /* Check if requested owner_id matches this owner_id */ if ((walk_info->execute_by_owner_id) && (method_node->owner_id != walk_info->owner_id)) { return_ACPI_STATUS(AE_OK); } /* * Match and decode the _Lxx and _Exx GPE method names * * 1) Extract the method name and null terminate it */ ACPI_MOVE_32_TO_32(name, &method_node->name.integer); name[ACPI_NAME_SIZE] = 0; /* 2) Name must begin with an underscore */ if (name[0] != '_') { return_ACPI_STATUS(AE_OK); /* Ignore this method */ } /* * 3) Edge/Level determination is based on the 2nd character * of the method name */ switch (name[1]) { case 'L': type = ACPI_GPE_LEVEL_TRIGGERED; break; case 'E': type = ACPI_GPE_EDGE_TRIGGERED; break; default: /* Unknown method type, just ignore it */ ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "Ignoring unknown GPE method type: %s " "(name not of form _Lxx or _Exx)", name)); return_ACPI_STATUS(AE_OK); } /* 4) The last two characters of the name are the hex GPE Number */ gpe_number = ACPI_STRTOUL(&name[2], NULL, 16); if (gpe_number == ACPI_UINT32_MAX) { /* Conversion failed; invalid method, just ignore it */ ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "Could not extract GPE number from name: %s " "(name is not of form _Lxx or _Exx)", name)); return_ACPI_STATUS(AE_OK); } /* Ensure that we have a valid GPE number for this GPE block */ gpe_event_info = acpi_ev_low_get_gpe_info(gpe_number, walk_info->gpe_block); if (!gpe_event_info) { /* * This gpe_number is not valid for this GPE block, just ignore it. * However, it may be valid for a different GPE block, since GPE0 * and GPE1 methods both appear under /_GPE. */ return_ACPI_STATUS(AE_OK); } if ((ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) == ACPI_GPE_DISPATCH_HANDLER) || (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) == ACPI_GPE_DISPATCH_RAW_HANDLER)) { /* If there is already a handler, ignore this GPE method */ return_ACPI_STATUS(AE_OK); } if (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) == ACPI_GPE_DISPATCH_METHOD) { /*//.........这里部分代码省略.........
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:101,
示例25: acpi_ev_save_method_infostatic acpi_statusacpi_ev_save_method_info(acpi_handle obj_handle, u32 level, void *obj_desc, void **return_value){ struct acpi_gpe_block_info *gpe_block = (void *)obj_desc; struct acpi_gpe_event_info *gpe_event_info; u32 gpe_number; char name[ACPI_NAME_SIZE + 1]; u8 type; acpi_status status; ACPI_FUNCTION_TRACE(ev_save_method_info); /* * _Lxx and _Exx GPE method support * * 1) Extract the name from the object and convert to a string */ ACPI_MOVE_32_TO_32(name, &((struct acpi_namespace_node *)obj_handle)->name. integer); name[ACPI_NAME_SIZE] = 0; /* * 2) Edge/Level determination is based on the 2nd character * of the method name * * NOTE: Default GPE type is RUNTIME. May be changed later to WAKE * if a _PRW object is found that points to this GPE. */ switch (name[1]) { case 'L': type = ACPI_GPE_LEVEL_TRIGGERED; break; case 'E': type = ACPI_GPE_EDGE_TRIGGERED; break; default: /* Unknown method type, just ignore it! */ ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "Ignoring unknown GPE method type: %s (name not of form _Lxx or _Exx)", name)); return_ACPI_STATUS(AE_OK); } /* Convert the last two characters of the name to the GPE Number */ gpe_number = ACPI_STRTOUL(&name[2], NULL, 16); if (gpe_number == ACPI_UINT32_MAX) { /* Conversion failed; invalid method, just ignore it */ ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "Could not extract GPE number from name: %s (name is not of form _Lxx or _Exx)", name)); return_ACPI_STATUS(AE_OK); } /* Ensure that we have a valid GPE number for this GPE block */ if ((gpe_number < gpe_block->block_base_number) || (gpe_number >= (gpe_block->block_base_number + (gpe_block->register_count * 8)))) { /* * Not valid for this GPE block, just ignore it * However, it may be valid for a different GPE block, since GPE0 and GPE1 * methods both appear under /_GPE. */ return_ACPI_STATUS(AE_OK); } /* * Now we can add this information to the gpe_event_info block * for use during dispatch of this GPE. Default type is RUNTIME, although * this may change when the _PRW methods are executed later. */ gpe_event_info = &gpe_block->event_info[gpe_number - gpe_block->block_base_number]; gpe_event_info->flags = (u8) (type | ACPI_GPE_DISPATCH_METHOD | ACPI_GPE_TYPE_RUNTIME); gpe_event_info->dispatch.method_node = (struct acpi_namespace_node *)obj_handle; /* Update enable mask, but don't enable the HW GPE as of yet */ status = acpi_ev_enable_gpe(gpe_event_info, FALSE); ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "Registered GPE method %s as GPE number 0x%.2X/n", name, gpe_number)); return_ACPI_STATUS(status);}
开发者ID:274914765,项目名称:C,代码行数:98,
示例26: AcpiEvMatchGpeMethodACPI_STATUSAcpiEvMatchGpeMethod ( ACPI_HANDLE ObjHandle, UINT32 Level, void *Context, void **ReturnValue){ ACPI_NAMESPACE_NODE *MethodNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle); ACPI_GPE_WALK_INFO *WalkInfo = ACPI_CAST_PTR (ACPI_GPE_WALK_INFO, Context); ACPI_GPE_EVENT_INFO *GpeEventInfo; ACPI_NAMESPACE_NODE *GpeDevice; ACPI_STATUS Status; UINT32 GpeNumber; char Name[ACPI_NAME_SIZE + 1]; UINT8 Type; ACPI_FUNCTION_TRACE (EvMatchGpeMethod); /* Check if requested OwnerId matches this OwnerId */ if ((WalkInfo->ExecuteByOwnerId) && (MethodNode->OwnerId != WalkInfo->OwnerId)) { return_ACPI_STATUS (AE_OK); } /* * Match and decode the _Lxx and _Exx GPE method names * * 1) Extract the method name and null terminate it */ ACPI_MOVE_32_TO_32 (Name, &MethodNode->Name.Integer); Name[ACPI_NAME_SIZE] = 0; /* 2) Name must begin with an underscore */ if (Name[0] != '_') { return_ACPI_STATUS (AE_OK); /* Ignore this method */ } /* * 3) Edge/Level determination is based on the 2nd character * of the method name * * NOTE: Default GPE type is RUNTIME only. Later, if a _PRW object is * found that points to this GPE, the ACPI_GPE_CAN_WAKE flag is set. */ switch (Name[1]) { case 'L': Type = ACPI_GPE_LEVEL_TRIGGERED; break; case 'E': Type = ACPI_GPE_EDGE_TRIGGERED; break; default: /* Unknown method type, just ignore it */ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Ignoring unknown GPE method type: %s " "(name not of form _Lxx or _Exx)", Name)); return_ACPI_STATUS (AE_OK); } /* 4) The last two characters of the name are the hex GPE Number */ GpeNumber = ACPI_STRTOUL (&Name[2], NULL, 16); if (GpeNumber == ACPI_UINT32_MAX) { /* Conversion failed; invalid method, just ignore it */ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Could not extract GPE number from name: %s " "(name is not of form _Lxx or _Exx)", Name)); return_ACPI_STATUS (AE_OK); } /* Ensure that we have a valid GPE number for this GPE block */ GpeEventInfo = AcpiEvLowGetGpeInfo (GpeNumber, WalkInfo->GpeBlock); if (!GpeEventInfo) { /* * This GpeNumber is not valid for this GPE block, just ignore it. * However, it may be valid for a different GPE block, since GPE0 * and GPE1 methods both appear under /_GPE. */ return_ACPI_STATUS (AE_OK); } if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_HANDLER) { /* If there is already a handler, ignore this GPE method *///.........这里部分代码省略.........
开发者ID:0xffea,项目名称:MINIX3,代码行数:101,
注:本文中的ACPI_STRTOUL函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ACPI_SUCCESS函数代码示例 C++ ACPI_STRNCPY函数代码示例 |