这篇教程C++ ACPI_STRLEN函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ACPI_STRLEN函数的典型用法代码示例。如果您正苦于以下问题:C++ ACPI_STRLEN函数的具体用法?C++ ACPI_STRLEN怎么用?C++ ACPI_STRLEN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ACPI_STRLEN函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AcpiDbAddToHistoryvoidAcpiDbAddToHistory ( char *CommandLine){ UINT16 CmdLen; UINT16 BufferLen; /* Put command into the next available slot */ CmdLen = (UINT16) ACPI_STRLEN (CommandLine); if (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command != NULL) { BufferLen = (UINT16) ACPI_STRLEN ( AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command); if (CmdLen > BufferLen) { AcpiOsFree (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex]. Command); AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command = AcpiOsAllocate (CmdLen + 1); } } else { AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command = AcpiOsAllocate (CmdLen + 1); } ACPI_STRCPY (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command, CommandLine); AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].CmdNum = AcpiGbl_NextCmdNum; /* Adjust indexes */ if ((AcpiGbl_NumHistory == HISTORY_SIZE) && (AcpiGbl_NextHistoryIndex == AcpiGbl_LoHistory)) { AcpiGbl_LoHistory++; if (AcpiGbl_LoHistory >= HISTORY_SIZE) { AcpiGbl_LoHistory = 0; } } AcpiGbl_NextHistoryIndex++; if (AcpiGbl_NextHistoryIndex >= HISTORY_SIZE) { AcpiGbl_NextHistoryIndex = 0; } AcpiGbl_NextCmdNum++; if (AcpiGbl_NumHistory < HISTORY_SIZE) { AcpiGbl_NumHistory++; }}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:58,
示例2: acpi_tb_find_tableacpi_statusacpi_tb_find_table(char *signature, char *oem_id, char *oem_table_id, struct acpi_table_header ** table_ptr){ acpi_status status; struct acpi_table_header *table; ACPI_FUNCTION_TRACE("tb_find_table"); /* Validate string lengths */ if ((ACPI_STRLEN(signature) > ACPI_NAME_SIZE) || (ACPI_STRLEN(oem_id) > sizeof(table->oem_id)) || (ACPI_STRLEN(oem_table_id) > sizeof(table->oem_table_id))) { return_ACPI_STATUS(AE_AML_STRING_LIMIT); } if (!ACPI_STRNCMP(signature, DSDT_SIG, ACPI_NAME_SIZE)) { /* * The DSDT pointer is contained in the FADT, not the RSDT. * This code should suffice, because the only code that would perform * a "find" on the DSDT is the data_table_region() AML opcode -- in * which case, the DSDT is guaranteed to be already loaded. * If this becomes insufficient, the FADT will have to be found first. */ if (!acpi_gbl_DSDT) { return_ACPI_STATUS(AE_NO_ACPI_TABLES); } table = acpi_gbl_DSDT; } else { /* Find the table */ status = acpi_get_firmware_table(signature, 1, ACPI_LOGICAL_ADDRESSING, &table); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } } /* Check oem_id and oem_table_id */ if ((oem_id[0] && ACPI_STRNCMP(oem_id, table->oem_id, sizeof(table->oem_id))) || (oem_table_id[0] && ACPI_STRNCMP(oem_table_id, table->oem_table_id, sizeof(table->oem_table_id)))) { return_ACPI_STATUS(AE_AML_NAME_NOT_FOUND); } ACPI_DEBUG_PRINT((ACPI_DB_TABLES, "Found table [%4.4s]/n", table->signature)); *table_ptr = table; return_ACPI_STATUS(AE_OK);}
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:56,
示例3: acpi_ut_safe_strcatu8 acpi_ut_safe_strcat(char *dest, acpi_size dest_size, char *source){ if ((ACPI_STRLEN(dest) + ACPI_STRLEN(source)) >= dest_size) { return (TRUE); } ACPI_STRCAT(dest, source); return (FALSE);}
开发者ID:7799,项目名称:linux,代码行数:10,
示例4: AcpiUtSafeStrcatBOOLEANAcpiUtSafeStrcat ( char *Dest, ACPI_SIZE DestSize, char *Source){ if ((ACPI_STRLEN (Dest) + ACPI_STRLEN (Source)) >= DestSize) { return (TRUE); } ACPI_STRCAT (Dest, Source); return (FALSE);}
开发者ID:zenny,项目名称:DragonFlyBSD,代码行数:15,
示例5: AcpiDbFindNameInNamespaceACPI_STATUSAcpiDbFindNameInNamespace ( char *NameArg){ char AcpiName[5] = "____"; char *AcpiNamePtr = AcpiName; if (ACPI_STRLEN (NameArg) > 4) { AcpiOsPrintf ("Name must be no longer than 4 characters/n"); return (AE_OK); } /* Pad out name with underscores as necessary to create a 4-char name */ AcpiUtStrupr (NameArg); while (*NameArg) { *AcpiNamePtr = *NameArg; AcpiNamePtr++; NameArg++; } /* Walk the namespace from the root */ (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, AcpiDbWalkAndMatchName, NULL, AcpiName, NULL); AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT); return (AE_OK);}
开发者ID:Aresthu,项目名称:ucore_plus,代码行数:32,
示例6: AcpiUtInstallInterfaceACPI_STATUSAcpiUtInstallInterface ( ACPI_STRING InterfaceName){ ACPI_INTERFACE_INFO *InterfaceInfo; /* Allocate info block and space for the name string */ InterfaceInfo = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_INTERFACE_INFO)); if (!InterfaceInfo) { return (AE_NO_MEMORY); } InterfaceInfo->Name = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (InterfaceName) + 1); if (!InterfaceInfo->Name) { ACPI_FREE (InterfaceInfo); return (AE_NO_MEMORY); } /* Initialize new info and insert at the head of the global list */ ACPI_STRCPY (InterfaceInfo->Name, InterfaceName); InterfaceInfo->Flags = ACPI_OSI_DYNAMIC; InterfaceInfo->Next = AcpiGbl_SupportedInterfaces; AcpiGbl_SupportedInterfaces = InterfaceInfo; return (AE_OK);}
开发者ID:alexandermerritt,项目名称:dragonfly,代码行数:31,
示例7: AcpiDbConvertToObjectstatic ACPI_STATUSAcpiDbConvertToObject ( ACPI_OBJECT_TYPE Type, char *String, ACPI_OBJECT *Object){ ACPI_STATUS Status = AE_OK; switch (Type) { case ACPI_TYPE_STRING: Object->Type = ACPI_TYPE_STRING; Object->String.Pointer = String; Object->String.Length = (UINT32) ACPI_STRLEN (String); break; case ACPI_TYPE_BUFFER: Status = AcpiDbConvertToBuffer (String, Object); break; case ACPI_TYPE_PACKAGE: Status = AcpiDbConvertToPackage (String, Object); break; default: Object->Type = ACPI_TYPE_INTEGER; Status = AcpiUtStrtoul64 (String, 16, &Object->Integer.Value); break; } return (Status);}
开发者ID:BillTheBest,项目名称:libuinet,代码行数:33,
示例8: acpi_ut_install_interfaceacpi_status acpi_ut_install_interface(acpi_string interface_name){ struct acpi_interface_info *interface_info; /* Allocate info block and space for the name string */ interface_info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_interface_info)); if (!interface_info) { return (AE_NO_MEMORY); } interface_info->name = ACPI_ALLOCATE_ZEROED(ACPI_STRLEN(interface_name) + 1); if (!interface_info->name) { ACPI_FREE(interface_info); return (AE_NO_MEMORY); } /* Initialize new info and insert at the head of the global list */ ACPI_STRCPY(interface_info->name, interface_name); interface_info->flags = ACPI_OSI_DYNAMIC; interface_info->next = acpi_gbl_supported_interfaces; acpi_gbl_supported_interfaces = interface_info; return (AE_OK);}
开发者ID:bjayesh,项目名称:chandra,代码行数:28,
示例9: acpi_ut_install_interfaceacpi_status acpi_ut_install_interface(acpi_string interface_name){ struct acpi_interface_info *interface_info; interface_info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_interface_info)); if (!interface_info) { return (AE_NO_MEMORY); } interface_info->name = ACPI_ALLOCATE_ZEROED(ACPI_STRLEN(interface_name) + 1); if (!interface_info->name) { ACPI_FREE(interface_info); return (AE_NO_MEMORY); } ACPI_STRCPY(interface_info->name, interface_name); interface_info->flags = ACPI_OSI_DYNAMIC; interface_info->next = acpi_gbl_supported_interfaces; acpi_gbl_supported_interfaces = interface_info; return (AE_OK);}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:28,
示例10: acpi_ut_safe_strncatu8acpi_ut_safe_strncat(char *dest, acpi_size dest_size, char *source, acpi_size max_transfer_length){ acpi_size actual_transfer_length; actual_transfer_length = ACPI_MIN(max_transfer_length, ACPI_STRLEN(source)); if ((ACPI_STRLEN(dest) + actual_transfer_length) >= dest_size) { return (TRUE); } ACPI_STRNCAT(dest, source, max_transfer_length); return (FALSE);}
开发者ID:7799,项目名称:linux,代码行数:17,
示例11: acpi_ut_safe_strcpyu8 acpi_ut_safe_strcpy(char *dest, acpi_size dest_size, char *source){ if (ACPI_STRLEN(source) >= dest_size) { return (TRUE); } ACPI_STRCPY(dest, source); return (FALSE);}
开发者ID:7799,项目名称:linux,代码行数:10,
示例12: AcpiTbFindTableACPI_STATUSAcpiTbFindTable ( char *Signature, char *OemId, char *OemTableId, ACPI_TABLE_HEADER **TablePtr){ ACPI_STATUS Status; ACPI_TABLE_HEADER *Table; ACPI_FUNCTION_TRACE ("TbFindTable"); /* Validate string lengths */ if ((ACPI_STRLEN (Signature) > ACPI_NAME_SIZE) || (ACPI_STRLEN (OemId) > sizeof (Table->OemId)) || (ACPI_STRLEN (OemTableId) > sizeof (Table->OemTableId))) { return_ACPI_STATUS (AE_AML_STRING_LIMIT); } /* Find the table */ Status = AcpiGetFirmwareTable (Signature, 1, ACPI_LOGICAL_ADDRESSING, &Table); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Check OemId and OemTableId */ if ((OemId[0] && ACPI_STRCMP (OemId, Table->OemId)) || (OemTableId[0] && ACPI_STRCMP (OemTableId, Table->OemTableId))) { return_ACPI_STATUS (AE_AML_NAME_NOT_FOUND); } *TablePtr = Table; return_ACPI_STATUS (AE_OK);}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:43,
示例13: AcpiUtSafeStrncatBOOLEANAcpiUtSafeStrncat ( char *Dest, ACPI_SIZE DestSize, char *Source, ACPI_SIZE MaxTransferLength){ ACPI_SIZE ActualTransferLength; ActualTransferLength = ACPI_MIN (MaxTransferLength, ACPI_STRLEN (Source)); if ((ACPI_STRLEN (Dest) + ActualTransferLength) >= DestSize) { return (TRUE); } ACPI_STRNCAT (Dest, Source, MaxTransferLength); return (FALSE);}
开发者ID:zenny,项目名称:DragonFlyBSD,代码行数:20,
示例14: acpi_tb_find_tableacpi_statusacpi_tb_find_table ( char *signature, char *oem_id, char *oem_table_id, struct acpi_table_header **table_ptr){ acpi_status status; struct acpi_table_header *table; ACPI_FUNCTION_TRACE ("tb_find_table"); /* Validate string lengths */ if ((ACPI_STRLEN (signature) > ACPI_NAME_SIZE) || (ACPI_STRLEN (oem_id) > sizeof (table->oem_id)) || (ACPI_STRLEN (oem_table_id) > sizeof (table->oem_table_id))) { return_ACPI_STATUS (AE_AML_STRING_LIMIT); } /* Find the table */ status = acpi_get_firmware_table (signature, 1, ACPI_LOGICAL_ADDRESSING, &table); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } /* Check oem_id and oem_table_id */ if ((oem_id[0] && ACPI_STRCMP (oem_id, table->oem_id)) || (oem_table_id[0] && ACPI_STRCMP (oem_table_id, table->oem_table_id))) { return_ACPI_STATUS (AE_AML_NAME_NOT_FOUND); } *table_ptr = table; return_ACPI_STATUS (AE_OK);}
开发者ID:iPodLinux,项目名称:linux-2.4.24-ipod,代码行数:40,
示例15: DtNormalizeBufferstatic char *DtNormalizeBuffer ( char *Buffer, UINT32 *Count){ char *NewBuffer; char *TmpBuffer; UINT32 BufferCount = 0; BOOLEAN Separator = TRUE; char c; NewBuffer = UtLocalCalloc (ACPI_STRLEN (Buffer) + 1); TmpBuffer = NewBuffer; while ((c = *Buffer++)) { switch (c) { /* Valid separators */ case '[': case ']': case ' ': case ',': Separator = TRUE; break; default: if (Separator) { /* Insert blank as the standard separator */ if (NewBuffer[0]) { *TmpBuffer++ = ' '; BufferCount++; } Separator = FALSE; } *TmpBuffer++ = c; break; } } *Count = BufferCount + 1; return (NewBuffer);}
开发者ID:coyizumi,项目名称:cs111,代码行数:52,
示例16: AcpiUtSafeStrcpyBOOLEANAcpiUtSafeStrcpy ( char *Dest, ACPI_SIZE DestSize, char *Source){ if (ACPI_STRLEN (Source) >= DestSize) { return (TRUE); } ACPI_STRCPY (Dest, Source); return (FALSE);}
开发者ID:zenny,项目名称:DragonFlyBSD,代码行数:15,
示例17: acpi_remove_interface/***************************************************************************** * * FUNCTION: acpi_remove_interface * * PARAMETERS: interface_name - The interface to remove * * RETURN: Status * * DESCRIPTION: Remove an _OSI interface from the global list * ****************************************************************************/acpi_status acpi_remove_interface(acpi_string interface_name){ acpi_status status; /* Parameter validation */ if (!interface_name || (ACPI_STRLEN(interface_name) == 0)) { return (AE_BAD_PARAMETER); } (void)acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER); status = acpi_ut_remove_interface(interface_name); acpi_os_release_mutex(acpi_gbl_osi_mutex); return (status);}
开发者ID:Adjustxx,项目名称:Savaged-Zen,代码行数:28,
示例18: AcpiDmAddToExternalFileListACPI_STATUSAcpiDmAddToExternalFileList ( char *PathList){ ACPI_EXTERNAL_FILE *ExternalFile; char *Path; char *TmpPath; if (!PathList) { return (AE_OK); } Path = strtok (PathList, ","); while (Path) { TmpPath = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (Path) + 1); if (!TmpPath) { return (AE_NO_MEMORY); } ACPI_STRCPY (TmpPath, Path); ExternalFile = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_FILE)); if (!ExternalFile) { ACPI_FREE (TmpPath); return (AE_NO_MEMORY); } ExternalFile->Path = TmpPath; if (AcpiGbl_ExternalFileList) { ExternalFile->Next = AcpiGbl_ExternalFileList; } AcpiGbl_ExternalFileList = ExternalFile; Path = strtok (NULL, ","); } return (AE_OK);}
开发者ID:DonCN,项目名称:haiku,代码行数:46,
示例19: AuValidateUuidACPI_STATUSAuValidateUuid ( char *InString){ UINT32 i; if (!InString || (ACPI_STRLEN (InString) != UUID_STRING_LENGTH)) { return (AE_BAD_PARAMETER); } /* Check all 36 characters for correct format */ for (i = 0; i < UUID_STRING_LENGTH; i++) { /* Must have 4 hyphens (dashes) in these positions: */ if ((i == UUID_HYPHEN1_OFFSET) || (i == UUID_HYPHEN2_OFFSET) || (i == UUID_HYPHEN3_OFFSET) || (i == UUID_HYPHEN4_OFFSET)) { if (InString[i] != '-') { return (AE_BAD_PARAMETER); } } /* All other positions must contain hex digits */ else { if (!isxdigit ((int) InString[i])) { return (AE_BAD_PARAMETER); } } } return (AE_OK);}
开发者ID:LauraBerry,项目名称:A2cpsc457,代码行数:42,
示例20: DtCompileStringstatic voidDtCompileString ( UINT8 *Buffer, DT_FIELD *Field, UINT32 ByteLength){ UINT32 Length; Length = ACPI_STRLEN (Field->Value); /* Check if the string is too long for the field */ if (Length > ByteLength) { sprintf (MsgBuffer, "Maximum %u characters", ByteLength); DtError (ASL_ERROR, ASL_MSG_STRING_LENGTH, Field, MsgBuffer); Length = ByteLength; } ACPI_MEMCPY (Buffer, Field->Value, Length);}
开发者ID:coyizumi,项目名称:cs111,代码行数:22,
示例21: acpi_install_interface/***************************************************************************** * * FUNCTION: acpi_install_interface * * PARAMETERS: interface_name - The interface to install * * RETURN: Status * * DESCRIPTION: Install an _OSI interface to the global list * ****************************************************************************/acpi_status acpi_install_interface(acpi_string interface_name){ acpi_status status; struct acpi_interface_info *interface_info; /* Parameter validation */ if (!interface_name || (ACPI_STRLEN(interface_name) == 0)) { return (AE_BAD_PARAMETER); } status = acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER); if (ACPI_FAILURE(status)) { return (status); } /* Check if the interface name is already in the global list */ interface_info = acpi_ut_get_interface(interface_name); if (interface_info) { /* * The interface already exists in the list. This is OK if the * interface has been marked invalid -- just clear the bit. */ if (interface_info->flags & ACPI_OSI_INVALID) { interface_info->flags &= ~ACPI_OSI_INVALID; status = AE_OK; } else { status = AE_ALREADY_EXISTS; } } else { /* New interface name, install into the global list */ status = acpi_ut_install_interface(interface_name); } acpi_os_release_mutex(acpi_gbl_osi_mutex); return (status);}
开发者ID:ravi-vid,项目名称:linux-xlnx,代码行数:50,
示例22: OpcFindNamestatic BOOLEANOpcFindName ( char **List, char *Name, UINT64 *Index){ char *Str; UINT32 i; OpcStrupr (Name); for (i = 0, Str = List[0]; Str; i++, Str = List[i]) { if (!(ACPI_STRNCMP (Str, Name, ACPI_STRLEN (Name)))) { *Index = i; return (TRUE); } } return (FALSE);}
开发者ID:LauraBerry,项目名称:A2cpsc457,代码行数:23,
示例23: DtCompileUnicodestatic voidDtCompileUnicode ( UINT8 *Buffer, DT_FIELD *Field, UINT32 ByteLength){ UINT32 Count; UINT32 i; char *AsciiString; UINT16 *UnicodeString; AsciiString = Field->Value; UnicodeString = (UINT16 *) Buffer; Count = ACPI_STRLEN (AsciiString) + 1; /* Convert to Unicode string (including null terminator) */ for (i = 0; i < Count; i++) { UnicodeString[i] = (UINT16) AsciiString[i]; }}
开发者ID:coyizumi,项目名称:cs111,代码行数:23,
示例24: DtCompileDataTablestatic ACPI_STATUSDtCompileDataTable ( DT_FIELD **FieldList){ ACPI_DMTABLE_DATA *TableData; DT_SUBTABLE *Subtable; char *Signature; ACPI_TABLE_HEADER *AcpiTableHeader; ACPI_STATUS Status; DT_FIELD *RootField = *FieldList; /* Verify that we at least have a table signature and save it */ Signature = DtGetFieldValue (*FieldList); if (!Signature) { sprintf (MsgBuffer, "Expected /"%s/"", "Signature"); DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME, *FieldList, MsgBuffer); return (AE_ERROR); } Gbl_Signature = UtLocalCalloc (ACPI_STRLEN (Signature) + 1); strcpy (Gbl_Signature, Signature); /* * Handle tables that don't use the common ACPI table header structure. * Currently, these are the FACS and RSDP. Also check for an OEMx table, * these tables have user-defined contents. */ if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS)) { Status = DtCompileFacs (FieldList); if (ACPI_FAILURE (Status)) { return (Status); } DtSetTableLength (); return (Status); } else if (ACPI_VALIDATE_RSDP_SIG (Signature)) { Status = DtCompileRsdp (FieldList); return (Status); } else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_S3PT)) { Status = DtCompileS3pt (FieldList); if (ACPI_FAILURE (Status)) { return (Status); } DtSetTableLength (); return (Status); } /* * All other tables must use the common ACPI table header. Insert the * current iASL IDs (name, version), and compile the header now. */ DtInsertCompilerIds (*FieldList); Status = DtCompileTable (FieldList, AcpiDmTableInfoHeader, &Gbl_RootTable, TRUE); if (ACPI_FAILURE (Status)) { return (Status); } DtPushSubtable (Gbl_RootTable); /* Validate the signature via the ACPI table list */ TableData = AcpiDmGetTableData (Signature); if (!TableData || Gbl_CompileGeneric) { DtCompileGeneric ((void **) FieldList); goto FinishHeader; } /* Dispatch to per-table compile */ if (TableData->CmTableHandler) { /* Complex table, has a handler */ Status = TableData->CmTableHandler ((void **) FieldList); if (ACPI_FAILURE (Status)) { return (Status); } } else if (TableData->TableInfo) { /* Simple table, just walk the info table */ Subtable = NULL;//.........这里部分代码省略.........
开发者ID:zenny,项目名称:DragonFlyBSD,代码行数:101,
示例25: AcpiDbExecutevoidAcpiDbExecute ( char *Name, char **Args, ACPI_OBJECT_TYPE *Types, UINT32 Flags){ ACPI_STATUS Status; ACPI_BUFFER ReturnObj; char *NameString;#ifdef ACPI_DEBUG_OUTPUT UINT32 PreviousAllocations; UINT32 Allocations; /* Memory allocation tracking */ PreviousAllocations = AcpiDbGetOutstandingAllocations ();#endif if (*Name == '*') { (void) AcpiWalkNamespace (ACPI_TYPE_METHOD, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, AcpiDbExecutionWalk, NULL, NULL, NULL); return; } else { NameString = ACPI_ALLOCATE (ACPI_STRLEN (Name) + 1); if (!NameString) { return; } ACPI_MEMSET (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO)); ACPI_STRCPY (NameString, Name); AcpiUtStrupr (NameString); AcpiGbl_DbMethodInfo.Name = NameString; AcpiGbl_DbMethodInfo.Args = Args; AcpiGbl_DbMethodInfo.Types = Types; AcpiGbl_DbMethodInfo.Flags = Flags; ReturnObj.Pointer = NULL; ReturnObj.Length = ACPI_ALLOCATE_BUFFER; Status = AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo); if (ACPI_FAILURE (Status)) { ACPI_FREE (NameString); return; } /* Get the NS node, determines existence also */ Status = AcpiGetHandle (NULL, AcpiGbl_DbMethodInfo.Pathname, &AcpiGbl_DbMethodInfo.Method); if (ACPI_SUCCESS (Status)) { Status = AcpiDbExecuteMethod (&AcpiGbl_DbMethodInfo, &ReturnObj); } ACPI_FREE (NameString); } /* * Allow any handlers in separate threads to complete. * (Such as Notify handlers invoked from AML executed above). */ AcpiOsSleep ((UINT64) 10);#ifdef ACPI_DEBUG_OUTPUT /* Memory allocation tracking */ Allocations = AcpiDbGetOutstandingAllocations () - PreviousAllocations; AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT); if (Allocations > 0) { AcpiOsPrintf ("0x%X Outstanding allocations after evaluation of %s/n", Allocations, AcpiGbl_DbMethodInfo.Pathname); }#endif if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Evaluation of %s failed with status %s/n", AcpiGbl_DbMethodInfo.Pathname, AcpiFormatException (Status)); } else { /* Display a return object, if any */ if (ReturnObj.Length) { AcpiOsPrintf ( "Evaluation of %s returned object %p, external buffer length %X/n",//.........这里部分代码省略.........
开发者ID:Lxg1582,项目名称:freebsd,代码行数:101,
示例26: AeExceptionHandlerstatic ACPI_STATUSAeExceptionHandler ( ACPI_STATUS AmlStatus, ACPI_NAME Name, UINT16 Opcode, UINT32 AmlOffset, void *Context){ ACPI_STATUS NewAmlStatus = AmlStatus; ACPI_STATUS Status; ACPI_BUFFER ReturnObj; ACPI_OBJECT_LIST ArgList; ACPI_OBJECT Arg[3]; const char *Exception; Exception = AcpiFormatException (AmlStatus); AcpiOsPrintf ("[AcpiExec] Exception %s during execution ", Exception); if (Name) { AcpiOsPrintf ("of method [%4.4s]", (char *) &Name); } else { AcpiOsPrintf ("at module level (table load)"); } AcpiOsPrintf (" Opcode [%s] @%X/n", AcpiPsGetOpcodeName (Opcode), AmlOffset); /* * Invoke the _ERR method if present * * Setup parameter object */ ArgList.Count = 3; ArgList.Pointer = Arg; Arg[0].Type = ACPI_TYPE_INTEGER; Arg[0].Integer.Value = AmlStatus; Arg[1].Type = ACPI_TYPE_STRING; Arg[1].String.Pointer = ACPI_CAST_PTR (char, Exception); Arg[1].String.Length = ACPI_STRLEN (Exception); Arg[2].Type = ACPI_TYPE_INTEGER; Arg[2].Integer.Value = AcpiOsGetThreadId(); /* Setup return buffer */ ReturnObj.Pointer = NULL; ReturnObj.Length = ACPI_ALLOCATE_BUFFER; Status = AcpiEvaluateObject (NULL, "//_ERR", &ArgList, &ReturnObj); if (ACPI_SUCCESS (Status)) { if (ReturnObj.Pointer) { /* Override original status */ NewAmlStatus = (ACPI_STATUS) ((ACPI_OBJECT *) ReturnObj.Pointer)->Integer.Value; /* Free a buffer created via ACPI_ALLOCATE_BUFFER */ AcpiOsFree (ReturnObj.Pointer); } } else if (Status != AE_NOT_FOUND) { AcpiOsPrintf ("[AcpiExec] Could not execute _ERR method, %s/n", AcpiFormatException (Status)); } /* Global override */ if (AcpiGbl_IgnoreErrors) { NewAmlStatus = AE_OK; } if (NewAmlStatus != AmlStatus) { AcpiOsPrintf ("[AcpiExec] Exception override, new status %s/n", AcpiFormatException (NewAmlStatus)); } return (NewAmlStatus);}
开发者ID:victoredwardocallaghan,项目名称:DragonFlyBSD,代码行数:87,
示例27: AcpiDsInitObjectFromOp//.........这里部分代码省略......... break; case AML_TYPE_LITERAL: ObjDesc->Integer.Value = Op->Common.Value.Integer;#ifndef ACPI_NO_METHOD_EXECUTION if (AcpiExTruncateFor32bitTable (ObjDesc)) { /* Warn if we found a 64-bit constant in a 32-bit table */ ACPI_WARNING ((AE_INFO, "Truncated 64-bit constant found in 32-bit table: %8.8X%8.8X => %8.8X", ACPI_FORMAT_UINT64 (Op->Common.Value.Integer), (UINT32) ObjDesc->Integer.Value)); }#endif break; default: ACPI_ERROR ((AE_INFO, "Unknown Integer type 0x%X", OpInfo->Type)); Status = AE_AML_OPERAND_TYPE; break; } break; case ACPI_TYPE_STRING: ObjDesc->String.Pointer = Op->Common.Value.String; ObjDesc->String.Length = (UINT32) ACPI_STRLEN (Op->Common.Value.String); /* * The string is contained in the ACPI table, don't ever try * to delete it */ ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER; break; case ACPI_TYPE_METHOD: break; case ACPI_TYPE_LOCAL_REFERENCE: switch (OpInfo->Type) { case AML_TYPE_LOCAL_VARIABLE: /* Local ID (0-7) is (AML opcode - base AML_LOCAL_OP) */ ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_LOCAL_OP; ObjDesc->Reference.Class = ACPI_REFCLASS_LOCAL;#ifndef ACPI_NO_METHOD_EXECUTION Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_LOCAL, ObjDesc->Reference.Value, WalkState, ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc->Reference.Object));#endif break;
开发者ID:ornarium,项目名称:freebsd,代码行数:66,
示例28: OpnDoDefinitionBlockstatic voidOpnDoDefinitionBlock ( ACPI_PARSE_OBJECT *Op){ ACPI_PARSE_OBJECT *Child; ACPI_SIZE Length; UINT32 i; char *Filename; /* * These nodes get stuffed into the table header. They are special * cased when the table is written to the output file. * * Mark all of these nodes as non-usable so they won't get output * as AML opcodes! */ /* Get AML filename. Use it if non-null */ Child = Op->Asl.Child; if (Child->Asl.Value.Buffer && *Child->Asl.Value.Buffer && (Gbl_UseDefaultAmlFilename)) { /* * We will use the AML filename that is embedded in the source file * for the output filename. */ Filename = UtStringCacheCalloc (strlen (Gbl_DirectoryPath) + strlen ((char *) Child->Asl.Value.Buffer) + 1); /* Prepend the current directory path */ strcpy (Filename, Gbl_DirectoryPath); strcat (Filename, (char *) Child->Asl.Value.Buffer); Gbl_OutputFilenamePrefix = Filename; UtConvertBackslashes (Gbl_OutputFilenamePrefix); } Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; /* Signature */ Child = Child->Asl.Next; Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; if (Child->Asl.Value.String) { Gbl_TableSignature = Child->Asl.Value.String; if (ACPI_STRLEN (Gbl_TableSignature) != 4) { AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child, "Length not exactly 4"); } for (i = 0; i < 4; i++) { if (!isalnum ((int) Gbl_TableSignature[i])) { AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child, "Contains non-alphanumeric characters"); } } } /* Revision */ Child = Child->Asl.Next; Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; /* * We used the revision to set the integer width earlier */ /* OEMID */ Child = Child->Asl.Next; Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; /* OEM TableID */ Child = Child->Asl.Next; Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; if (Child->Asl.Value.String) { Length = ACPI_STRLEN (Child->Asl.Value.String); Gbl_TableId = UtStringCacheCalloc (Length + 1); ACPI_STRCPY (Gbl_TableId, Child->Asl.Value.String); /* * Convert anything non-alphanumeric to an underscore. This * allows us to use the TableID to generate unique C symbols. */ for (i = 0; i < Length; i++) { if (!isalnum ((int) Gbl_TableId[i])) { Gbl_TableId[i] = '_'; } } }//.........这里部分代码省略.........
开发者ID:Lianguocheng,项目名称:acpica,代码行数:101,
注:本文中的ACPI_STRLEN函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ACPI_STRNCPY函数代码示例 C++ ACPI_STRCPY函数代码示例 |