这篇教程C++ ACPI_STRCMP函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ACPI_STRCMP函数的典型用法代码示例。如果您正苦于以下问题:C++ ACPI_STRCMP函数的具体用法?C++ ACPI_STRCMP怎么用?C++ ACPI_STRCMP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ACPI_STRCMP函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: whilestruct acpi_interface_info *acpi_ut_get_interface(acpi_string interface_name){ struct acpi_interface_info *next_interface; next_interface = acpi_gbl_supported_interfaces; while (next_interface) { if (!ACPI_STRCMP(interface_name, next_interface->name)) { return (next_interface); } next_interface = next_interface->next; } return (NULL);}
开发者ID:Adjustxx,项目名称:Savaged-Zen,代码行数:15,
示例2: acpi_ut_remove_interfaceacpi_status acpi_ut_remove_interface(acpi_string interface_name){ struct acpi_interface_info *previous_interface; struct acpi_interface_info *next_interface; previous_interface = next_interface = acpi_gbl_supported_interfaces; while (next_interface) { if (!ACPI_STRCMP(interface_name, next_interface->name)) { /* Found: name is in either the static list or was added at runtime */ if (next_interface->flags & ACPI_OSI_DYNAMIC) { /* Interface was added dynamically, remove and free it */ if (previous_interface == next_interface) { acpi_gbl_supported_interfaces = next_interface->next; } else { previous_interface->next = next_interface->next; } ACPI_FREE(next_interface->name); ACPI_FREE(next_interface); } else { /* * Interface is in static list. If marked invalid, then it * does not actually exist. Else, mark it invalid. */ if (next_interface->flags & ACPI_OSI_INVALID) { return (AE_NOT_EXIST); } next_interface->flags |= ACPI_OSI_INVALID; } return (AE_OK); } previous_interface = next_interface; next_interface = next_interface->next; } /* Interface was not found */ return (AE_NOT_EXIST);}
开发者ID:bjayesh,项目名称:chandra,代码行数:48,
示例3: AcpiAhMatchHardwareIdconst AH_DEVICE_ID *AcpiAhMatchHardwareId ( char *HardwareId){ const AH_DEVICE_ID *Info; for (Info = AslDeviceIds; Info->Name; Info++) { if (!ACPI_STRCMP (HardwareId, Info->Name)) { return (Info); } } return (NULL);}
开发者ID:LauraBerry,项目名称:A2cpsc457,代码行数:17,
示例4: acpi_ut_remove_interfaceacpi_status acpi_ut_remove_interface(acpi_string interface_name){ struct acpi_interface_info *previous_interface; struct acpi_interface_info *next_interface; previous_interface = next_interface = acpi_gbl_supported_interfaces; while (next_interface) { if (!ACPI_STRCMP(interface_name, next_interface->name)) { if (next_interface->flags & ACPI_OSI_DYNAMIC) { if (previous_interface == next_interface) { acpi_gbl_supported_interfaces = next_interface->next; } else { previous_interface->next = next_interface->next; } ACPI_FREE(next_interface->name); ACPI_FREE(next_interface); } else { if (next_interface->flags & ACPI_OSI_INVALID) { return (AE_NOT_EXIST); } next_interface->flags |= ACPI_OSI_INVALID; } return (AE_OK); } previous_interface = next_interface; next_interface = next_interface->next; } return (AE_NOT_EXIST);}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:44,
示例5: AcpiUtGetInterfaceACPI_INTERFACE_INFO *AcpiUtGetInterface ( ACPI_STRING InterfaceName){ ACPI_INTERFACE_INFO *NextInterface; NextInterface = AcpiGbl_SupportedInterfaces; while (NextInterface) { if (!ACPI_STRCMP (InterfaceName, NextInterface->Name)) { return (NextInterface); } NextInterface = NextInterface->Next; } return (NULL);}
开发者ID:alexandermerritt,项目名称:dragonfly,代码行数:20,
示例6: acpi_ut_osi_implementationacpi_statusacpi_ut_osi_implementation ( struct acpi_walk_state *walk_state){ union acpi_operand_object *string_desc; union acpi_operand_object *return_desc; acpi_native_uint i; ACPI_FUNCTION_TRACE ("ut_osi_implementation"); /* Validate the string input argument */ string_desc = walk_state->arguments[0].object; if (!string_desc || (string_desc->common.type != ACPI_TYPE_STRING)) { return_ACPI_STATUS (AE_TYPE); } /* Create a return object (Default value = 0) */ return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER); if (!return_desc) { return_ACPI_STATUS (AE_NO_MEMORY); } /* Compare input string to table of supported strings */ for (i = 0; i < ACPI_NUM_OSI_STRINGS; i++) { if (!ACPI_STRCMP (string_desc->string.pointer, (char *) acpi_gbl_valid_osi_strings[i])) { /* This string is supported */ return_desc->integer.value = 0xFFFFFFFF; break; } } walk_state->return_desc = return_desc; return_ACPI_STATUS (AE_CTRL_TERMINATE);}
开发者ID:GodFox,项目名称:magx_kernel_xpixl,代码行数:41,
示例7: AcpiDbDisplayResourcesvoidAcpiDbDisplayResources ( char *ObjectArg){ ACPI_NAMESPACE_NODE *Node; AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT); AcpiDbgLevel |= ACPI_LV_RESOURCES; /* Asterisk means "display resources for all devices" */ if (!ACPI_STRCMP (ObjectArg, "*")) { (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, AcpiDbDeviceResources, NULL, NULL, NULL); } else { /* Convert string to object pointer */ Node = AcpiDbConvertToNode (ObjectArg); if (Node) { if (Node->Type != ACPI_TYPE_DEVICE) { AcpiOsPrintf ("%4.4s: Name is not a device object (%s)/n", Node->Name.Ascii, AcpiUtGetTypeName (Node->Type)); } else { (void) AcpiDbDeviceResources (Node, 0, NULL, NULL); } } } AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);}
开发者ID:dmarion,项目名称:freebsd-armv6-sys,代码行数:38,
示例8: DtTrimstatic char *DtTrim ( char *String){ char *Start; char *End; char *ReturnString; ACPI_SIZE Length; /* Skip lines that start with a space */ if (!ACPI_STRCMP (String, " ")) { ReturnString = UtLocalCalloc (1); return (ReturnString); } /* Setup pointers to start and end of input string */ Start = String; End = String + ACPI_STRLEN (String) - 1; /* Find first non-whitespace character */ while ((Start <= End) && ((*Start == ' ') || (*Start == '/t'))) { Start++; } /* Find last non-space character */ while (End >= Start) { if (*End == '/r' || *End == '/n') { End--; continue; } if (*End != ' ') { break; } End--; } /* Remove any quotes around the string */ if (*Start == '/"') { Start++; } if (*End == '/"') { End--; } /* Create the trimmed return string */ Length = ACPI_PTR_DIFF (End, Start) + 1; ReturnString = UtLocalCalloc (Length + 1); if (ACPI_STRLEN (Start)) { ACPI_STRNCPY (ReturnString, Start, Length); } ReturnString[Length] = 0; return (ReturnString);}
开发者ID:BillTheBest,项目名称:libuinet,代码行数:71,
示例9: AcpiUtDumpAllocationsvoidAcpiUtDumpAllocations ( UINT32 Component, const char *Module){ ACPI_DEBUG_MEM_BLOCK *Element; ACPI_DESCRIPTOR *Descriptor; UINT32 NumOutstanding = 0; UINT8 DescriptorType; ACPI_FUNCTION_TRACE (UtDumpAllocations); /* * Walk the allocation list. */ if (ACPI_FAILURE (AcpiUtAcquireMutex (ACPI_MTX_MEMORY))) { return; } Element = AcpiGbl_GlobalList->ListHead; while (Element) { if ((Element->Component & Component) && ((Module == NULL) || (0 == ACPI_STRCMP (Module, Element->Module)))) { Descriptor = ACPI_CAST_PTR (ACPI_DESCRIPTOR, &Element->UserSpace); if (Element->Size < sizeof (ACPI_COMMON_DESCRIPTOR)) { AcpiOsPrintf ("%p Length 0x%04X %9.9s-%d " "[Not a Descriptor - too small]/n", Descriptor, Element->Size, Element->Module, Element->Line); } else { /* Ignore allocated objects that are in a cache */ if (ACPI_GET_DESCRIPTOR_TYPE (Descriptor) != ACPI_DESC_TYPE_CACHED) { AcpiOsPrintf ("%p Length 0x%04X %9.9s-%d [%s] ", Descriptor, Element->Size, Element->Module, Element->Line, AcpiUtGetDescriptorName (Descriptor)); /* Validate the descriptor type using Type field and length */ DescriptorType = 0; /* Not a valid descriptor type */ switch (ACPI_GET_DESCRIPTOR_TYPE (Descriptor)) { case ACPI_DESC_TYPE_OPERAND: if (Element->Size == sizeof (ACPI_DESC_TYPE_OPERAND)) { DescriptorType = ACPI_DESC_TYPE_OPERAND; } break; case ACPI_DESC_TYPE_PARSER: if (Element->Size == sizeof (ACPI_DESC_TYPE_PARSER)) { DescriptorType = ACPI_DESC_TYPE_PARSER; } break; case ACPI_DESC_TYPE_NAMED: if (Element->Size == sizeof (ACPI_DESC_TYPE_NAMED)) { DescriptorType = ACPI_DESC_TYPE_NAMED; } break; default: break; } /* Display additional info for the major descriptor types */ switch (DescriptorType) { case ACPI_DESC_TYPE_OPERAND: AcpiOsPrintf ("%12.12s RefCount 0x%04X/n", AcpiUtGetTypeName (Descriptor->Object.Common.Type), Descriptor->Object.Common.ReferenceCount); break; case ACPI_DESC_TYPE_PARSER: AcpiOsPrintf ("AmlOpcode 0x%04hX/n", Descriptor->Op.Asl.AmlOpcode); break; case ACPI_DESC_TYPE_NAMED: AcpiOsPrintf ("%4.4s/n", AcpiUtGetNodeName (&Descriptor->Node)); break; default: AcpiOsPrintf ( "/n");//.........这里部分代码省略.........
开发者ID:luciang,项目名称:haiku,代码行数:101,
示例10: acpi_ns_root_initialize/******************************************************************************* * * FUNCTION: acpi_ns_root_initialize * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Allocate and initialize the default root named objects * * MUTEX: Locks namespace for entire execution * ******************************************************************************/acpi_status acpi_ns_root_initialize(void){ acpi_status status; const struct acpi_predefined_names *init_val = NULL; struct acpi_namespace_node *new_node; union acpi_operand_object *obj_desc; acpi_string val = NULL; ACPI_FUNCTION_TRACE(ns_root_initialize); status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } /* * The global root ptr is initially NULL, so a non-NULL value indicates * that acpi_ns_root_initialize() has already been called; just return. */ if (acpi_gbl_root_node) { status = AE_OK; goto unlock_and_exit; } /* * Tell the rest of the subsystem that the root is initialized * (This is OK because the namespace is locked) */ acpi_gbl_root_node = &acpi_gbl_root_node_struct; /* Enter the pre-defined names in the name table */ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Entering predefined entries into namespace/n")); for (init_val = acpi_gbl_pre_defined_names; init_val->name; init_val++) { /* _OSI is optional for now, will be permanent later */ if (!ACPI_STRCMP(init_val->name, "_OSI") && !acpi_gbl_create_osi_method) { continue; } status = acpi_ns_lookup(NULL, init_val->name, init_val->type, ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH, NULL, &new_node); if (ACPI_FAILURE(status) || (!new_node)) { /* Must be on same line for code converter */ ACPI_EXCEPTION((AE_INFO, status, "Could not create predefined name %s", init_val->name)); } /* * Name entered successfully. * If entry in pre_defined_names[] specifies an * initial value, create the initial value. */ if (init_val->val) { status = acpi_os_predefined_override(init_val, &val); if (ACPI_FAILURE(status)) { ACPI_ERROR((AE_INFO, "Could not override predefined %s", init_val->name)); } if (!val) { val = init_val->val; } /* * Entry requests an initial value, allocate a * descriptor for it. */ obj_desc = acpi_ut_create_internal_object(init_val->type); if (!obj_desc) { status = AE_NO_MEMORY; goto unlock_and_exit; } /* * Convert value string from table entry to * internal representation. Only types actually * used for initial values are implemented here. *///.........这里部分代码省略.........
开发者ID:10x-Amin,项目名称:x10_Th_kernel,代码行数:101,
示例11: AcpiDmCreateNewExternalstatic ACPI_STATUSAcpiDmCreateNewExternal ( char *ExternalPath, char *InternalPath, UINT8 Type, UINT32 Value, UINT16 Flags){ ACPI_EXTERNAL_LIST *NewExternal; ACPI_EXTERNAL_LIST *NextExternal; ACPI_EXTERNAL_LIST *PrevExternal = NULL; ACPI_FUNCTION_TRACE (DmCreateNewExternal); /* Check all existing externals to ensure no duplicates */ NextExternal = AcpiGbl_ExternalList; while (NextExternal) { if (!ACPI_STRCMP (ExternalPath, NextExternal->Path)) { /* Duplicate method, check that the Value (ArgCount) is the same */ if ((NextExternal->Type == ACPI_TYPE_METHOD) && (NextExternal->Value != Value) && (Value > 0)) { ACPI_ERROR ((AE_INFO, "External method arg count mismatch %s: Current %u, attempted %u", NextExternal->Path, NextExternal->Value, Value)); } /* Allow upgrade of type from ANY */ else if (NextExternal->Type == ACPI_TYPE_ANY) { NextExternal->Type = Type; NextExternal->Value = Value; } return_ACPI_STATUS (AE_ALREADY_EXISTS); } NextExternal = NextExternal->Next; } /* Allocate and init a new External() descriptor */ NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST)); if (!NewExternal) { return_ACPI_STATUS (AE_NO_MEMORY); } ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Adding external reference node (%s) type [%s]/n", ExternalPath, AcpiUtGetTypeName (Type))); NewExternal->Flags = Flags; NewExternal->Value = Value; NewExternal->Path = ExternalPath; NewExternal->Type = Type; NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath); NewExternal->InternalPath = InternalPath; /* Link the new descriptor into the global list, alphabetically ordered */ NextExternal = AcpiGbl_ExternalList; while (NextExternal) { if (AcpiUtStricmp (NewExternal->Path, NextExternal->Path) < 0) { if (PrevExternal) { PrevExternal->Next = NewExternal; } else { AcpiGbl_ExternalList = NewExternal; } NewExternal->Next = NextExternal; return_ACPI_STATUS (AE_OK); } PrevExternal = NextExternal; NextExternal = NextExternal->Next; } if (PrevExternal) { PrevExternal->Next = NewExternal; } else { AcpiGbl_ExternalList = NewExternal; }//.........这里部分代码省略.........
开发者ID:99corps,项目名称:runtime,代码行数:101,
示例12: DtCompileIvrsACPI_STATUSDtCompileIvrs ( void **List){ ACPI_STATUS Status; DT_SUBTABLE *Subtable; DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *SubtableStart; ACPI_DMTABLE_INFO *InfoTable; ACPI_IVRS_HEADER *IvrsHeader; UINT8 EntryType; Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrs, &Subtable, TRUE); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); while (*PFieldList) { SubtableStart = *PFieldList; Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrsHdr, &Subtable, TRUE); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); IvrsHeader = ACPI_CAST_PTR (ACPI_IVRS_HEADER, Subtable->Buffer); switch (IvrsHeader->Type) { case ACPI_IVRS_TYPE_HARDWARE: InfoTable = AcpiDmTableInfoIvrs0; break; case ACPI_IVRS_TYPE_MEMORY1: case ACPI_IVRS_TYPE_MEMORY2: case ACPI_IVRS_TYPE_MEMORY3: InfoTable = AcpiDmTableInfoIvrs1; break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IVRS"); return (AE_ERROR); } Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); if (ACPI_FAILURE (Status)) { return (Status); } ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); if (IvrsHeader->Type == ACPI_IVRS_TYPE_HARDWARE) { while (*PFieldList && !ACPI_STRCMP ((*PFieldList)->Name, "Entry Type")) { SubtableStart = *PFieldList; DtCompileInteger (&EntryType, *PFieldList, 1, 0); switch (EntryType) { /* 4-byte device entries */ case ACPI_IVRS_TYPE_PAD4: case ACPI_IVRS_TYPE_ALL: case ACPI_IVRS_TYPE_SELECT: case ACPI_IVRS_TYPE_START: case ACPI_IVRS_TYPE_END: InfoTable = AcpiDmTableInfoIvrs4; break; /* 8-byte entries, type A */ case ACPI_IVRS_TYPE_ALIAS_SELECT: case ACPI_IVRS_TYPE_ALIAS_START: InfoTable = AcpiDmTableInfoIvrs8a; break; /* 8-byte entries, type B */ case ACPI_IVRS_TYPE_PAD8: case ACPI_IVRS_TYPE_EXT_SELECT: case ACPI_IVRS_TYPE_EXT_START://.........这里部分代码省略.........
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:101,
示例13: AnMethodAnalysisWalkBegin//.........这里部分代码省略......... } break; case PARSEOP_BREAK: case PARSEOP_CONTINUE: Next = Op->Asl.Parent; while (Next) { if (Next->Asl.ParseOpcode == PARSEOP_WHILE) { break; } Next = Next->Asl.Parent; } if (!Next) { AslError (ASL_ERROR, ASL_MSG_NO_WHILE, Op, NULL); } break; case PARSEOP_STALL: /* We can range check if the argument is an integer */ if ((Op->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER) && (Op->Asl.Child->Asl.Value.Integer > ACPI_UINT8_MAX)) { AslError (ASL_ERROR, ASL_MSG_INVALID_TIME, Op, NULL); } break; case PARSEOP_DEVICE: case PARSEOP_EVENT: case PARSEOP_MUTEX: case PARSEOP_OPERATIONREGION: case PARSEOP_POWERRESOURCE: case PARSEOP_PROCESSOR: case PARSEOP_THERMALZONE: /* * The first operand is a name to be created in the namespace. * Check against the reserved list. */ i = ApCheckForPredefinedName (Op, Op->Asl.NameSeg); if (i < ACPI_VALID_RESERVED_NAME_MAX) { AslError (ASL_ERROR, ASL_MSG_RESERVED_USE, Op, Op->Asl.ExternalName); } break; case PARSEOP_NAME: /* Typecheck any predefined names statically defined with Name() */ ApCheckForPredefinedObject (Op, Op->Asl.NameSeg); /* Special typechecking for _HID */ if (!ACPI_STRCMP (METHOD_NAME__HID, Op->Asl.NameSeg)) { Next = Op->Asl.Child->Asl.Next; AnCheckId (Next, ASL_TYPE_HID); } /* Special typechecking for _CID */ else if (!ACPI_STRCMP (METHOD_NAME__CID, Op->Asl.NameSeg)) { Next = Op->Asl.Child->Asl.Next; if ((Next->Asl.ParseOpcode == PARSEOP_PACKAGE) || (Next->Asl.ParseOpcode == PARSEOP_VAR_PACKAGE)) { Next = Next->Asl.Child; while (Next) { AnCheckId (Next, ASL_TYPE_CID); Next = Next->Asl.Next; } } else { AnCheckId (Next, ASL_TYPE_CID); } } break; default: break; } return (AE_OK);}
开发者ID:juanfra684,项目名称:DragonFlyBSD,代码行数:101,
示例14: acpi_ns_root_initializeacpi_status acpi_ns_root_initialize(void){ acpi_status status; const struct acpi_predefined_names *init_val = NULL; struct acpi_namespace_node *new_node; union acpi_operand_object *obj_desc; acpi_string val = NULL; ACPI_FUNCTION_TRACE(ns_root_initialize); status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } if (acpi_gbl_root_node) { status = AE_OK; goto unlock_and_exit; } acpi_gbl_root_node = &acpi_gbl_root_node_struct; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Entering predefined entries into namespace/n")); for (init_val = acpi_gbl_pre_defined_names; init_val->name; init_val++) { if (!ACPI_STRCMP(init_val->name, "_OSI") && !acpi_gbl_create_osi_method) { continue; } status = acpi_ns_lookup(NULL, init_val->name, init_val->type, ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH, NULL, &new_node); if (ACPI_FAILURE(status) || (!new_node)) { ACPI_EXCEPTION((AE_INFO, status, "Could not create predefined name %s", init_val->name)); } if (init_val->val) { status = acpi_os_predefined_override(init_val, &val); if (ACPI_FAILURE(status)) { ACPI_ERROR((AE_INFO, "Could not override predefined %s", init_val->name)); } if (!val) { val = init_val->val; } obj_desc = acpi_ut_create_internal_object(init_val->type); if (!obj_desc) { status = AE_NO_MEMORY; goto unlock_and_exit; } switch (init_val->type) { case ACPI_TYPE_METHOD: obj_desc->method.param_count = (u8) ACPI_TO_INTEGER(val); obj_desc->common.flags |= AOPOBJ_DATA_VALID;#if defined (ACPI_ASL_COMPILER) new_node->value = obj_desc->method.param_count;#else obj_desc->method.info_flags = ACPI_METHOD_INTERNAL_ONLY; obj_desc->method.dispatch.implementation = acpi_ut_osi_implementation;#endif break; case ACPI_TYPE_INTEGER: obj_desc->integer.value = ACPI_TO_INTEGER(val); break; case ACPI_TYPE_STRING: obj_desc->string.length = (u32) ACPI_STRLEN(val); obj_desc->string.pointer = val; obj_desc->common.flags |= AOPOBJ_STATIC_POINTER; break;//.........这里部分代码省略.........
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:101,
示例15: AcpiDbTestStringTypestatic ACPI_STATUSAcpiDbTestStringType ( ACPI_NAMESPACE_NODE *Node, UINT32 ByteLength){ ACPI_OBJECT *Temp1 = NULL; ACPI_OBJECT *Temp2 = NULL; ACPI_OBJECT *Temp3 = NULL; char *ValueToWrite = "Test String from AML Debugger"; ACPI_OBJECT WriteValue; ACPI_STATUS Status; /* Read the original value */ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_STRING, &Temp1); if (ACPI_FAILURE (Status)) { return (Status); } AcpiOsPrintf (" (%4.4X/%3.3X) /"%s/"", (Temp1->String.Length * 8), Temp1->String.Length, Temp1->String.Pointer); /* Write a new value */ WriteValue.Type = ACPI_TYPE_STRING; WriteValue.String.Length = ACPI_STRLEN (ValueToWrite); WriteValue.String.Pointer = ValueToWrite; Status = AcpiDbWriteToObject (Node, &WriteValue); if (ACPI_FAILURE (Status)) { goto Exit; } /* Ensure that we can read back the new value */ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_STRING, &Temp2); if (ACPI_FAILURE (Status)) { goto Exit; } if (ACPI_STRCMP (Temp2->String.Pointer, ValueToWrite)) { AcpiOsPrintf (" MISMATCH 2: %s, expecting %s", Temp2->String.Pointer, ValueToWrite); } /* Write back the original value */ WriteValue.String.Length = ACPI_STRLEN (Temp1->String.Pointer); WriteValue.String.Pointer = Temp1->String.Pointer; Status = AcpiDbWriteToObject (Node, &WriteValue); if (ACPI_FAILURE (Status)) { goto Exit; } /* Ensure that we can read back the original value */ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_STRING, &Temp3); if (ACPI_FAILURE (Status)) { goto Exit; } if (ACPI_STRCMP (Temp1->String.Pointer, Temp3->String.Pointer)) { AcpiOsPrintf (" MISMATCH 3: %s, expecting %s", Temp3->String.Pointer, Temp1->String.Pointer); }Exit: if (Temp1) {AcpiOsFree (Temp1);} if (Temp2) {AcpiOsFree (Temp2);} if (Temp3) {AcpiOsFree (Temp3);} return (Status);}
开发者ID:99corps,项目名称:runtime,代码行数:81,
示例16: AcpiGetoptintAcpiGetopt( int argc, char **argv, char *opts){ int CurrentChar; char *OptsPtr; if (CurrentCharPtr == 1) { if (AcpiGbl_Optind >= argc || argv[AcpiGbl_Optind][0] != '-' || argv[AcpiGbl_Optind][1] == '/0') { return (ACPI_OPT_END); } else if (ACPI_STRCMP (argv[AcpiGbl_Optind], "--") == 0) { AcpiGbl_Optind++; return (ACPI_OPT_END); } } /* Get the option */ CurrentChar = argv[AcpiGbl_Optind][CurrentCharPtr]; /* Make sure that the option is legal */ if (CurrentChar == ':' || (OptsPtr = ACPI_STRCHR (opts, CurrentChar)) == NULL) { ACPI_OPTION_ERROR ("Illegal option: -", CurrentChar); if (argv[AcpiGbl_Optind][++CurrentCharPtr] == '/0') { AcpiGbl_Optind++; CurrentCharPtr = 1; } return ('?'); } /* Option requires an argument? */ if (*++OptsPtr == ':') { if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '/0') { AcpiGbl_Optarg = &argv[AcpiGbl_Optind++][(int) (CurrentCharPtr+1)]; } else if (++AcpiGbl_Optind >= argc) { ACPI_OPTION_ERROR ("Option requires an argument: -", CurrentChar); CurrentCharPtr = 1; return ('?'); } else { AcpiGbl_Optarg = argv[AcpiGbl_Optind++]; } CurrentCharPtr = 1; } /* Option has an optional argument? */ else if (*OptsPtr == '+') { if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '/0') { AcpiGbl_Optarg = &argv[AcpiGbl_Optind++][(int) (CurrentCharPtr+1)]; } else if (++AcpiGbl_Optind >= argc) { AcpiGbl_Optarg = NULL; } else { AcpiGbl_Optarg = argv[AcpiGbl_Optind++]; } CurrentCharPtr = 1; } /* Option has optional single-char arguments? */ else if (*OptsPtr == '^') { if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '/0') { AcpiGbl_Optarg = &argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)]; } else { AcpiGbl_Optarg = "^"; }//.........这里部分代码省略.........
开发者ID:LauraBerry,项目名称:A2cpsc457,代码行数:101,
示例17: AcpiNsGetDeviceCallbackstatic ACPI_STATUSAcpiNsGetDeviceCallback ( ACPI_HANDLE ObjHandle, UINT32 NestingLevel, void *Context, void **ReturnValue){ ACPI_GET_DEVICES_INFO *Info = Context; ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node; UINT32 Flags; ACPI_DEVICE_ID *Hid; ACPI_DEVICE_ID_LIST *Cid; UINT32 i; BOOLEAN Found; int NoMatch; Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { return (Status); } Node = AcpiNsValidateHandle (ObjHandle); Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { return (Status); } if (!Node) { return (AE_BAD_PARAMETER); } /* Run _STA to determine if device is present */ Status = AcpiUtExecute_STA (Node, &Flags); if (ACPI_FAILURE (Status)) { return (AE_CTRL_DEPTH); } if (!(Flags & ACPI_STA_DEVICE_PRESENT) && !(Flags & ACPI_STA_DEVICE_FUNCTIONING)) { /* * Don't examine the children of the device only when the * device is neither present nor functional. See ACPI spec, * description of _STA for more information. */ return (AE_CTRL_DEPTH); } /* Filter based on device HID & CID */ if (Info->Hid != NULL) { Status = AcpiUtExecute_HID (Node, &Hid); if (Status == AE_NOT_FOUND) { return (AE_OK); } else if (ACPI_FAILURE (Status)) { return (AE_CTRL_DEPTH); } NoMatch = ACPI_STRCMP (Hid->String, Info->Hid); ACPI_FREE (Hid); if (NoMatch) { /* * HID does not match, attempt match within the * list of Compatible IDs (CIDs) */ Status = AcpiUtExecute_CID (Node, &Cid); if (Status == AE_NOT_FOUND) { return (AE_OK); } else if (ACPI_FAILURE (Status)) { return (AE_CTRL_DEPTH); } /* Walk the CID list */ Found = FALSE; for (i = 0; i < Cid->Count; i++) { if (ACPI_STRCMP (Cid->Ids[i].String, Info->Hid) == 0) { /* Found a matching CID */ Found = TRUE; break; }//.........这里部分代码省略.........
开发者ID:ExpressOS,项目名称:third_party-l4re,代码行数:101,
示例18: AcpiDmAddToExternalListvoidAcpiDmAddToExternalList ( ACPI_PARSE_OBJECT *Op, char *Path, UINT8 Type, UINT32 Value){ char *ExternalPath; char *Fullpath = NULL; ACPI_EXTERNAL_LIST *NewExternal; ACPI_EXTERNAL_LIST *NextExternal; ACPI_EXTERNAL_LIST *PrevExternal = NULL; ACPI_STATUS Status; BOOLEAN Resolved = FALSE; if (!Path) { return; } if (Type == ACPI_TYPE_METHOD) { if (Value & 0x80) { Resolved = TRUE; } Value &= 0x07; } /* * We don't want External() statements to contain a leading '/'. * This prevents duplicate external statements of the form: * * External (/ABCD) * External (ABCD) * * This would cause a compile time error when the disassembled * output file is recompiled. */ if ((*Path == AML_ROOT_PREFIX) && (Path[1])) { Path++; } /* Externalize the ACPI pathname */ Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path, NULL, &ExternalPath); if (ACPI_FAILURE (Status)) { return; } /* * Get the full pathname from the root if "Path" has one or more * parent prefixes (^). Note: path will not contain a leading '/'. */ if (*Path == (UINT8) AML_PARENT_PREFIX) { Fullpath = AcpiDmNormalizeParentPrefix (Op, ExternalPath); if (Fullpath) { /* Set new external path */ ACPI_FREE (ExternalPath); ExternalPath = Fullpath; } } /* Check all existing externals to ensure no duplicates */ NextExternal = AcpiGbl_ExternalList; while (NextExternal) { if (!ACPI_STRCMP (ExternalPath, NextExternal->Path)) { /* Duplicate method, check that the Value (ArgCount) is the same */ if ((NextExternal->Type == ACPI_TYPE_METHOD) && (NextExternal->Value != Value)) { ACPI_ERROR ((AE_INFO, "External method arg count mismatch %s: Current %u, attempted %u", NextExternal->Path, NextExternal->Value, Value)); } /* Allow upgrade of type from ANY */ else if (NextExternal->Type == ACPI_TYPE_ANY) { NextExternal->Type = Type; NextExternal->Value = Value; } ACPI_FREE (ExternalPath); return; } NextExternal = NextExternal->Next;//.........这里部分代码省略.........
开发者ID:DonCN,项目名称:haiku,代码行数:101,
示例19: DtCreateTemplatesACPI_STATUSDtCreateTemplates ( char *Signature){ ACPI_DMTABLE_DATA *TableData; ACPI_STATUS Status; AslInitializeGlobals (); /* Default (no signature) is DSDT */ if (!Signature) { Signature = "DSDT"; goto GetTemplate; } AcpiUtStrupr (Signature); if (!ACPI_STRCMP (Signature, "ALL") || !ACPI_STRCMP (Signature, "*")) { /* Create all available/known templates */ Status = DtCreateAllTemplates (); return (Status); } /* * Validate signature and get the template data: * 1) Signature must be 4 characters * 2) Signature must be a recognized ACPI table * 3) There must be a template associated with the signature */ if (strlen (Signature) != ACPI_NAME_SIZE) { fprintf (stderr, "%s: Invalid ACPI table signature (length must be 4 characters)/n", Signature); return (AE_ERROR); } /* * Some slack for the two strange tables whose name is different than * their signatures: MADT->APIC and FADT->FACP. */ if (!strcmp (Signature, "MADT")) { Signature = "APIC"; } else if (!strcmp (Signature, "FADT")) { Signature = "FACP"; }GetTemplate: TableData = AcpiDmGetTableData (Signature); if (TableData) { if (!TableData->Template) { fprintf (stderr, "%4.4s: No template available/n", Signature); return (AE_ERROR); } } else if (!AcpiUtIsSpecialTable (Signature)) { fprintf (stderr, "%4.4s: Unrecognized ACPI table signature/n", Signature); return (AE_ERROR); } Status = AdInitialize (); if (ACPI_FAILURE (Status)) { return (Status); } Status = DtCreateOneTemplate (Signature, TableData); return (Status);}
开发者ID:99corps,项目名称:runtime,代码行数:81,
示例20: DtCompileIntegervoidDtCompileInteger ( UINT8 *Buffer, DT_FIELD *Field, UINT32 ByteLength, UINT8 Flags){ UINT64 Value; UINT64 MaxValue; ACPI_STATUS Status; /* Output buffer byte length must be in range 1-8 */ if ((ByteLength > 8) || (ByteLength == 0)) { DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid internal Byte length"); return; } /* Resolve integer expression to a single integer value */ Status = DtResolveIntegerExpression (Field, &Value); if (ACPI_FAILURE (Status)) { return; } /* Ensure that reserved fields are set to zero */ /* TBD: should we set to zero, or just make this an ERROR? */ /* TBD: Probably better to use a flag */ if (!ACPI_STRCMP (Field->Name, "Reserved") && (Value != 0)) { DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field, "Setting to zero"); Value = 0; } /* Check if the value must be non-zero */ if ((Value == 0) && (Flags & DT_NON_ZERO)) { DtError (ASL_ERROR, ASL_MSG_ZERO_VALUE, Field, NULL); } /* * Generate the maximum value for the data type (ByteLength) * Note: construct chosen for maximum portability */ MaxValue = ((UINT64) (-1)) >> (64 - (ByteLength * 8)); /* Validate that the input value is within range of the target */ if (Value > MaxValue) { snprintf (MsgBuffer, sizeof(MsgBuffer), "%8.8X%8.8X - max %u bytes", ACPI_FORMAT_UINT64 (Value), ByteLength); DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer); } ACPI_MEMCPY (Buffer, &Value, ByteLength); return;}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:66,
示例21: AcpiDmAddToExternalListvoidAcpiDmAddToExternalList ( ACPI_PARSE_OBJECT *Op, char *Path, UINT8 Type, UINT32 Value){ char *ExternalPath; char *Fullpath = NULL; ACPI_EXTERNAL_LIST *NewExternal; ACPI_EXTERNAL_LIST *NextExternal; ACPI_EXTERNAL_LIST *PrevExternal = NULL; ACPI_STATUS Status; if (!Path) { return; } /* Externalize the ACPI path */ Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path, NULL, &ExternalPath); if (ACPI_FAILURE (Status)) { return; } /* Get the full pathname from root if "Path" has a parent prefix */ if (*Path == (UINT8) AML_PARENT_PREFIX) { Fullpath = AcpiDmNormalizeParentPrefix (Op, ExternalPath); if (Fullpath) { /* Set new external path */ ACPI_FREE (ExternalPath); ExternalPath = Fullpath; } } /* Check all existing externals to ensure no duplicates */ NextExternal = AcpiGbl_ExternalList; while (NextExternal) { if (!ACPI_STRCMP (ExternalPath, NextExternal->Path)) { /* Duplicate method, check that the Value (ArgCount) is the same */ if ((NextExternal->Type == ACPI_TYPE_METHOD) && (NextExternal->Value != Value)) { ACPI_ERROR ((AE_INFO, "Argument count mismatch for method %s %u %u", NextExternal->Path, NextExternal->Value, Value)); } /* Allow upgrade of type from ANY */ else if (NextExternal->Type == ACPI_TYPE_ANY) { NextExternal->Type = Type; NextExternal->Value = Value; } ACPI_FREE (ExternalPath); return; } NextExternal = NextExternal->Next; } /* Allocate and init a new External() descriptor */ NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST)); if (!NewExternal) { ACPI_FREE (ExternalPath); return; } NewExternal->Path = ExternalPath; NewExternal->Type = Type; NewExternal->Value = Value; NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath); /* Was the external path with parent prefix normalized to a fullpath? */ if (Fullpath == ExternalPath) { /* Get new internal path */ Status = AcpiNsInternalizeName (ExternalPath, &Path); if (ACPI_FAILURE (Status)) { ACPI_FREE (ExternalPath); ACPI_FREE (NewExternal);//.........这里部分代码省略.........
开发者ID:ErfanBagheri,项目名称:haiku,代码行数:101,
示例22: AcpiGetHandleACPI_STATUSAcpiGetHandle ( ACPI_HANDLE Parent, ACPI_STRING Pathname, ACPI_HANDLE *RetHandle){ ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node = NULL; ACPI_NAMESPACE_NODE *PrefixNode = NULL; ACPI_FUNCTION_ENTRY (); /* Parameter Validation */ if (!RetHandle || !Pathname) { return (AE_BAD_PARAMETER); } /* Convert a parent handle to a prefix node */ if (Parent) { PrefixNode = AcpiNsMapHandleToNode (Parent); if (!PrefixNode) { return (AE_BAD_PARAMETER); } } /* * Valid cases are: * 1) Fully qualified pathname * 2) Parent + Relative pathname * * Error for <null Parent + relative path> */ if (AcpiNsValidRootPrefix (Pathname[0])) { /* Pathname is fully qualified (starts with '/') */ /* Special case for root-only, since we can't search for it */ if (!ACPI_STRCMP (Pathname, ACPI_NS_ROOT_PATH)) { *RetHandle = AcpiNsConvertEntryToHandle (AcpiGbl_RootNode); return (AE_OK); } } else if (!PrefixNode) { /* Relative path with null prefix is disallowed */ return (AE_BAD_PARAMETER); } /* Find the Node and convert to a handle */ Status = AcpiNsGetNode (PrefixNode, Pathname, ACPI_NS_NO_UPSEARCH, &Node); if (ACPI_SUCCESS (Status)) { *RetHandle = AcpiNsConvertEntryToHandle (Node); } return (Status);}
开发者ID:samueldotj,项目名称:AceOS,代码行数:68,
示例23: AcpiDmAddToExternalListFromFilestatic voidAcpiDmAddToExternalListFromFile ( char *Path, UINT8 Type, UINT32 Value){ char *InternalPath; char *ExternalPath; ACPI_EXTERNAL_LIST *NewExternal; ACPI_EXTERNAL_LIST *NextExternal; ACPI_EXTERNAL_LIST *PrevExternal = NULL; ACPI_STATUS Status; BOOLEAN Resolved = FALSE; if (!Path) { return; } /* TBD: Add a flags parameter */ if (Type == ACPI_TYPE_METHOD) { if (Value & 0x80) { Resolved = TRUE; } Value &= 0x07; } /* * We don't want External() statements to contain a leading '/'. * This prevents duplicate external statements of the form: * * External (/ABCD) * External (ABCD) * * This would cause a compile time error when the disassembled * output file is recompiled. */ if ((*Path == AML_ROOT_PREFIX) && (Path[1])) { Path++; } /* Check all existing externals to ensure no duplicates */ NextExternal = AcpiGbl_ExternalList; while (NextExternal) { if (!ACPI_STRCMP (Path, NextExternal->Path)) { /* Duplicate method, check that the Value (ArgCount) is the same */ if ((NextExternal->Type == ACPI_TYPE_METHOD) && (NextExternal->Value != Value)) { ACPI_ERROR ((AE_INFO, "(File) External method arg count mismatch %s: Current %u, override to %u", NextExternal->Path, NextExternal->Value, Value)); /* Override, since new value came from external reference file */ NextExternal->Value = Value; } /* Allow upgrade of type from ANY */ else if (NextExternal->Type == ACPI_TYPE_ANY) { NextExternal->Type = Type; NextExternal->Value = Value; } return; } NextExternal = NextExternal->Next; } /* Get the internal pathname (AML format) */ Status = AcpiNsInternalizeName (Path, &InternalPath); if (ACPI_FAILURE (Status)) { return; } /* Allocate and init a new External() descriptor */ NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST)); if (!NewExternal) { ACPI_FREE (InternalPath); return; } /* Must copy and normalize the input path *///.........这里部分代码省略.........
开发者ID:DonCN,项目名称:haiku,代码行数:101,
示例24: DtCompileIntegervoidDtCompileInteger ( UINT8 *Buffer, DT_FIELD *Field, UINT32 ByteLength, UINT8 Flags){ UINT64 Value; UINT64 MaxValue; ACPI_STATUS Status; /* Output buffer byte length must be in range 1-8 */ if ((ByteLength > 8) || (ByteLength == 0)) { DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid internal Byte length"); return; } /* Resolve integer expression to a single integer value */ Status = DtResolveIntegerExpression (Field, &Value); if (ACPI_FAILURE (Status)) { return; } /* * Ensure that reserved fields are set properly. Note: uses * the DT_NON_ZERO flag to indicate that the reserved value * must be exactly one. Otherwise, the value must be zero. * This is sufficient for now. */ /* TBD: Should use a flag rather than compare "Reserved" */ if (!ACPI_STRCMP (Field->Name, "Reserved")) { if (Flags & DT_NON_ZERO) { if (Value != 1) { DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field, "Must be one, setting to one"); Value = 1; } } else if (Value != 0) { DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field, "Must be zero, setting to zero"); Value = 0; } } /* Check if the value must be non-zero */ else if ((Flags & DT_NON_ZERO) && (Value == 0)) { DtError (ASL_ERROR, ASL_MSG_ZERO_VALUE, Field, NULL); } /* * Generate the maximum value for the data type (ByteLength) * Note: construct chosen for maximum portability */ MaxValue = ((UINT64) (-1)) >> (64 - (ByteLength * 8)); /* Validate that the input value is within range of the target */ if (Value > MaxValue) { sprintf (MsgBuffer, "%8.8X%8.8X - max %u bytes", ACPI_FORMAT_UINT64 (Value), ByteLength); DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer); } ACPI_MEMCPY (Buffer, &Value, ByteLength); return;}
开发者ID:coyizumi,项目名称:cs111,代码行数:82,
示例25: acpi_ns_get_device_callback/******************************************************************************* * * FUNCTION: acpi_ns_get_device_callback * * PARAMETERS: Callback from acpi_get_device * * RETURN: Status * * DESCRIPTION: Takes callbacks from walk_namespace and filters out all non- * present devices, or if they specified a HID, it filters based * on that. * ******************************************************************************/static acpi_statusacpi_ns_get_device_callback(acpi_handle obj_handle, u32 nesting_level, void *context, void **return_value){ struct acpi_get_devices_info *info = context; acpi_status status; struct acpi_namespace_node *node; u32 flags; struct acpi_pnp_device_id *hid; struct acpi_pnp_device_id_list *cid; u32 i; u8 found; int no_match; status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); if (ACPI_FAILURE(status)) { return (status); } node = acpi_ns_validate_handle(obj_handle); status = acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); if (ACPI_FAILURE(status)) { return (status); } if (!node) { return (AE_BAD_PARAMETER); } /* * First, filter based on the device HID and CID. * * 01/2010: For this case where a specific HID is requested, we don't * want to run _STA until we have an actual HID match. Thus, we will * not unnecessarily execute _STA on devices for which the caller * doesn't care about. Previously, _STA was executed unconditionally * on all devices found here. * * A side-effect of this change is that now we will continue to search * for a matching HID even under device trees where the parent device * would have returned a _STA that indicates it is not present or * not functioning (thus aborting the search on that branch). */ if (info->hid != NULL) { status = acpi_ut_execute_HID(node, &hid); if (status == AE_NOT_FOUND) { return (AE_OK); } else if (ACPI_FAILURE(status)) { return (AE_CTRL_DEPTH); } no_match = ACPI_STRCMP(hid->string, info->hid); ACPI_FREE(hid); if (no_match) { /* * HID does not match, attempt match within the * list of Compatible IDs (CIDs) */ status = acpi_ut_execute_CID(node, &cid); if (status == AE_NOT_FOUND) { return (AE_OK); } else if (ACPI_FAILURE(status)) { return (AE_CTRL_DEPTH); } /* Walk the CID list */ found = FALSE; for (i = 0; i < cid->count; i++) { if (ACPI_STRCMP(cid->ids[i].string, info->hid) == 0) { /* Found a matching CID */ found = TRUE; break; } } ACPI_FREE(cid); if (!found) { return (AE_OK); } } }//.........这里部分代码省略.........
开发者ID:0x000000FF,项目名称:Linux4Edison,代码行数:101,
示例26: AcpiNsGetDeviceCallbackstatic ACPI_STATUSAcpiNsGetDeviceCallback ( ACPI_HANDLE ObjHandle, UINT32 NestingLevel, void *Context, void **ReturnValue){ ACPI_GET_DEVICES_INFO *Info = Context; ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node; UINT32 Flags; ACPI_PNP_DEVICE_ID *Hid; ACPI_PNP_DEVICE_ID_LIST *Cid; UINT32 i; BOOLEAN Found; int NoMatch; Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { return (Status); } Node = AcpiNsValidateHandle (ObjHandle); Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { return (Status); } if (!Node) { return (AE_BAD_PARAMETER); } /* * First, filter based on the device HID and CID. * * 01/2010: For this case where a specific HID is requested, we don't * want to run _STA until we have an actual HID match. Thus, we will * not unnecessarily execute _STA on devices for which the caller * doesn't care about. Previously, _STA was executed unconditionally * on all devices found here. * * A side-effect of this change is that now we will continue to search * for a matching HID even under device trees where the parent device * would have returned a _STA that indicates it is not present or * not functioning (thus aborting the search on that branch). */ if (Info->Hid != NULL) { Status = AcpiUtExecute_HID (Node, &Hid); if (Status == AE_NOT_FOUND) { return (AE_OK); } else if (ACPI_FAILURE (Status)) { return (AE_CTRL_DEPTH); } NoMatch = ACPI_STRCMP (Hid->String, Info->Hid); ACPI_FREE (Hid); if (NoMatch) { /* * HID does not match, attempt match within the * list of Compatible IDs (CIDs) */ Status = AcpiUtExecute_CID (Node, &Cid); if (Status == AE_NOT_FOUND) { return (AE_OK); } else if (ACPI_FAILURE (Status)) { return (AE_CTRL_DEPTH); } /* Walk the CID list */ Found = FALSE; for (i = 0; i < Cid->Count; i++) { if (ACPI_STRCMP (Cid->Ids[i].String, Info->Hid) == 0) { /* Found a matching CID */ Found = TRUE; break; } } ACPI_FREE (Cid); if (!Found) { return (AE_OK); }//.........这里部分代码省略.........
开发者ID:cloudius-systems,项目名称:acpica,代码行数:101,
示例27: DtCompileTableACPI_STATUSDtCompileTable ( DT_FIELD **Field, ACPI_DMTABLE_INFO *Info, DT_SUBTABLE **RetSubtable, BOOLEAN Required){ DT_FIELD *LocalField; UINT32 Length; DT_SUBTABLE *Subtable; DT_SUBTABLE *InlineSubtable; UINT32 FieldLength = 0; UINT8 FieldType; UINT8 *Buffer; UINT8 *FlagBuffer = NULL; UINT32 CurrentFlagByteOffset = 0; ACPI_STATUS Status; if (!Field || !*Field) { return (AE_BAD_PARAMETER); } /* Ignore optional subtable if name does not match */ if ((Info->Flags & DT_OPTIONAL) && ACPI_STRCMP ((*Field)->Name, Info->Name)) { *RetSubtable = NULL; return (AE_OK); } Length = DtGetSubtableLength (*Field, Info); if (Length == ASL_EOF) { return (AE_ERROR); } Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE)); if (Length > 0) { Subtable->Buffer = UtLocalCalloc (Length); } Subtable->Length = Length; Subtable->TotalLength = Length; Buffer = Subtable->Buffer; LocalField = *Field; /* * Main loop walks the info table for this ACPI table or subtable */ for (; Info->Name; Info++) { if (Info->Opcode == ACPI_DMT_EXTRA_TEXT) { continue; } if (!LocalField) { sprintf (MsgBuffer, "Found NULL field - Field name /"%s/" needed", Info->Name); DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer); Status = AE_BAD_DATA; goto Error; } /* Maintain table offsets */ LocalField->TableOffset = Gbl_CurrentTableOffset; FieldLength = DtGetFieldLength (LocalField, Info); Gbl_CurrentTableOffset += FieldLength; FieldType = DtGetFieldType (Info); Gbl_InputFieldCount++; switch (FieldType) { case DT_FIELD_TYPE_FLAGS_INTEGER: /* * Start of the definition of a flags field. * This master flags integer starts at value zero, in preparation * to compile and insert the flag fields from the individual bits */ LocalField = LocalField->Next; *Field = LocalField; FlagBuffer = Buffer; CurrentFlagByteOffset = Info->Offset; break; case DT_FIELD_TYPE_FLAG: /* Individual Flag field, can be multiple bits */ if (FlagBuffer) {//.........这里部分代码省略.........
开发者ID:zenny,项目名称:DragonFlyBSD,代码行数:101,
示例28: AcpiNsRootInitializeACPI_STATUSAcpiNsRootInitialize ( void){ ACPI_STATUS Status; const ACPI_PREDEFINED_NAMES *InitVal = NULL; ACPI_NAMESPACE_NODE *NewNode; ACPI_OPERAND_OBJECT *ObjDesc; ACPI_STRING Val = NULL; ACPI_FUNCTION_TRACE (NsRootInitialize); Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* * The global root ptr is initially NULL, so a non-NULL value indicates * that AcpiNsRootInitialize() has already been called; just return. */ if (AcpiGbl_RootNode) { Status = AE_OK; goto UnlockAndExit; } /* * Tell the rest of the subsystem that the root is initialized * (This is OK because the namespace is locked) */ AcpiGbl_RootNode = &AcpiGbl_RootNodeStruct; /* Enter the pre-defined names in the name table */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Entering predefined entries into namespace/n")); for (InitVal = AcpiGbl_PreDefinedNames; InitVal->Name; InitVal++) { /* _OSI is optional for now, will be permanent later */ if (!ACPI_STRCMP (InitVal->Name, "_OSI") && !AcpiGbl_CreateOsiMethod) { continue; } Status = AcpiNsLookup (NULL, __UNCONST(InitVal->Name), InitVal->Type, ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH, NULL, &NewNode); if (ACPI_FAILURE (Status) || (!NewNode)) /* Must be on same line for code converter */ { ACPI_EXCEPTION ((AE_INFO, Status, "Could not create predefined name %s", InitVal->Name)); } /* * Name entered successfully. If entry in PreDefinedNames[] specifies * an initial value, create the initial value. */ if (InitVal->Val) { Status = AcpiOsPredefinedOverride (InitVal, &Val); if (ACPI_FAILURE (Status)) { ACPI_ERROR ((AE_INFO, "Could not override predefined %s", InitVal->Name)); } if (!Val) { Val = __UNCONST(InitVal->Val); } /* * Entry requests an initial value, allocate a * descriptor for it. */ ObjDesc = AcpiUtCreateInternalObject (InitVal->Type); if (!ObjDesc) { Status = AE_NO_MEMORY; goto UnlockAndExit; } /* * Convert value string from table entry to * internal representation. Only types actually * used for initial values are implemented here. */ switch (InitVal->Type) { case ACPI_TYPE_METHOD: ObjDesc->Method.ParamCount = (UINT8) ACPI_TO_INTEGER (Val);//.........这里部分代码省略.........
开发者ID:RyanLucchese,项目名称:rumpkernel-netbsd-src,代码行数:101,
注:本文中的ACPI_STRCMP函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ACPI_STRCPY函数代码示例 C++ ACPI_SERIAL_END函数代码示例 |