void AhFindAslAndAmlOperators ( char *Name) { UINT32 MatchCount; MatchCount = AhFindAslOperators (Name); if (MatchCount == 1) { AhFindAmlOpcode (Name); } }
void AhDecodeAmlOpcode ( char *OpcodeString) { const AH_AML_OPCODE *Op; UINT32 Opcode; UINT8 Prefix; if (!OpcodeString) { AhFindAmlOpcode (NULL); return; } Opcode = ACPI_STRTOUL (OpcodeString, NULL, 16); if (Opcode > ACPI_UINT16_MAX) { printf ("Invalid opcode (more than 16 bits)\n"); return; } /* Only valid opcode extension is 0x5B */ Prefix = (Opcode & 0x0000FF00) >> 8; if (Prefix && (Prefix != 0x5B)) { printf ("Invalid opcode (invalid extension prefix 0x%X)\n", Prefix); return; } /* Find/Display the opcode. May fall within an opcode range */ for (Op = AmlOpcodeInfo; Op->OpcodeString; Op++) { if ((Opcode >= Op->OpcodeRangeStart) && (Opcode <= Op->OpcodeRangeEnd)) { AhDisplayAmlOpcode (Op); } } }
int ACPI_SYSTEM_XFACE main ( int argc, char *argv[]) { char *Name; UINT32 DecodeType; int j; AcpiOsInitialize (); ACPI_DEBUG_INITIALIZE (); /* For debug version only */ printf (ACPI_COMMON_SIGNON (AH_UTILITY_NAME)); DecodeType = AH_DECODE_DEFAULT; if (argc < 2) { AhDisplayUsage (); return (0); } /* Command line options */ while ((j = AcpiGetopt (argc, argv, AH_SUPPORTED_OPTIONS)) != ACPI_OPT_END) switch (j) { case 'a': DecodeType = AH_DECODE_ASL_AML; break; case 'e': DecodeType = AH_DECODE_EXCEPTION; break; case 'i': DecodeType = AH_DISPLAY_DEVICE_IDS; break; case 'k': DecodeType = AH_DECODE_ASL_KEYWORD; break; case 'm': DecodeType = AH_DECODE_AML; break; case 'o': DecodeType = AH_DECODE_AML_OPCODE; break; case 'p': DecodeType = AH_DECODE_PREDEFINED_NAME; break; case 's': DecodeType = AH_DECODE_ASL; break; case 'u': DecodeType = AH_DISPLAY_UUIDS; break; case 'v': /* -v: (Version): signon already emitted, just exit */ return (0); case 'h': default: AhDisplayUsage (); return (-1); } /* Missing (null) name means "display all" */ Name = argv[AcpiGbl_Optind]; switch (DecodeType) { case AH_DECODE_ASL_AML: AhFindAslAndAmlOperators (Name); break; case AH_DECODE_AML: AhFindAmlOpcode (Name); break; case AH_DECODE_AML_OPCODE: AhDecodeAmlOpcode (Name); break; case AH_DECODE_PREDEFINED_NAME: AhFindPredefinedNames (Name); break; case AH_DECODE_ASL: AhFindAslOperators (Name); break; case AH_DECODE_ASL_KEYWORD: AhFindAslKeywords (Name); break; case AH_DISPLAY_DEVICE_IDS: AhDisplayDeviceIds (Name); break; case AH_DECODE_EXCEPTION: AhDecodeException (Name); break; case AH_DISPLAY_UUIDS: AhDisplayUuids (); break; default: if (!Name) { AhFindAslOperators (Name); break; } if (*Name == '_') { AhFindPredefinedNames (Name); } else { AhFindAslAndAmlOperators (Name); } break; } return (0); }
int ACPI_SYSTEM_XFACE main ( int argc, char *argv[]) { char *Name; UINT32 DecodeType; int j; ACPI_DEBUG_INITIALIZE (); /* For debug version only */ printf (ACPI_COMMON_SIGNON ("ACPI Help Utility")); DecodeType = AH_DECODE_DEFAULT; if (argc < 2) { AhDisplayUsage (); return (0); } /* Command line options */ while ((j = AcpiGetopt (argc, argv, "ehikmops")) != EOF) switch (j) { case 'e': DecodeType = AH_DECODE_EXCEPTION; break; case 'i': DecodeType = AH_DISPLAY_DEVICE_IDS; break; case 'k': DecodeType = AH_DECODE_ASL_KEYWORD; break; case 'm': DecodeType = AH_DECODE_AML; break; case 'o': DecodeType = AH_DECODE_AML_OPCODE; break; case 'p': DecodeType = AH_DECODE_PREDEFINED_NAME; break; case 's': DecodeType = AH_DECODE_ASL; break; case 'h': default: AhDisplayUsage (); return (-1); } /* Missing (null) name means "display all" */ Name = argv[AcpiGbl_Optind]; switch (DecodeType) { case AH_DECODE_AML: AhFindAmlOpcode (Name); break; case AH_DECODE_AML_OPCODE: AhDecodeAmlOpcode (Name); break; case AH_DECODE_PREDEFINED_NAME: AhFindPredefinedNames (Name); break; case AH_DECODE_ASL: AhFindAslOperators (Name); break; case AH_DECODE_ASL_KEYWORD: AhFindAslKeywords (Name); break; case AH_DISPLAY_DEVICE_IDS: AhDisplayDeviceIds (); break; case AH_DECODE_EXCEPTION: AhDecodeException (Name); break; default: if (!Name) { AhFindAslOperators (Name); break; } if (*Name == '_') { AhFindPredefinedNames (Name); } else { AhFindAslOperators (Name); } break; } return (0); }