diff options
author | Robert Moore <Robert.Moore@intel.com> | 2016-06-30 12:17:37 -0700 |
---|---|---|
committer | Robert Moore <Robert.Moore@intel.com> | 2016-06-30 12:17:37 -0700 |
commit | badd47cbd3a1d4b92c4b37a1fecb7d1cfebbc0fc (patch) | |
tree | b08759f3ced166659ce98cd14c7707c9121560ba | |
parent | 43fa9b91b4c4d74290664a98b54a3facb3434cd7 (diff) | |
download | acpica-badd47cbd3a1d4b92c4b37a1fecb7d1cfebbc0fc.tar.gz |
Revert "Update for local 64-bit version of strtoul"
This reverts commit 43fa9b91b4c4d74290664a98b54a3facb3434cd7.
Needs extra partitioning to handle the multiple "types" of
string-to-integer conversions defined in the ACPI spec.
-rwxr-xr-x | generate/msvc9/AcpiDump.vcproj | 4 | ||||
-rwxr-xr-x | generate/msvc9/AcpiSrc.vcproj | 4 | ||||
-rwxr-xr-x | generate/msvc9/AcpiXtract.vcproj | 4 | ||||
-rw-r--r-- | generate/unix/acpidump/Makefile | 1 | ||||
-rw-r--r-- | generate/unix/acpisrc/Makefile | 1 | ||||
-rw-r--r-- | generate/unix/acpixtract/Makefile | 1 | ||||
-rw-r--r-- | source/components/events/evgpeinit.c | 8 | ||||
-rw-r--r-- | source/components/utilities/utnonansi.c | 449 | ||||
-rw-r--r-- | source/include/acexcep.h | 6 | ||||
-rw-r--r-- | source/include/platform/acmsvc.h | 3 | ||||
-rw-r--r-- | source/tools/acpiexec/aeexec.c | 100 |
11 files changed, 297 insertions, 284 deletions
diff --git a/generate/msvc9/AcpiDump.vcproj b/generate/msvc9/AcpiDump.vcproj index 683062476..4880e7b04 100755 --- a/generate/msvc9/AcpiDump.vcproj +++ b/generate/msvc9/AcpiDump.vcproj @@ -345,10 +345,6 @@ > </File> <File - RelativePath="..\..\source\components\utilities\uthex.c" - > - </File> - <File RelativePath="..\..\source\components\utilities\utmath.c" > </File> diff --git a/generate/msvc9/AcpiSrc.vcproj b/generate/msvc9/AcpiSrc.vcproj index b3a498e3e..9f1039a20 100755 --- a/generate/msvc9/AcpiSrc.vcproj +++ b/generate/msvc9/AcpiSrc.vcproj @@ -482,10 +482,6 @@ > </File> <File - RelativePath="..\..\source\components\utilities\uthex.c" - > - </File> - <File RelativePath="..\..\source\components\utilities\utmath.c" > </File> diff --git a/generate/msvc9/AcpiXtract.vcproj b/generate/msvc9/AcpiXtract.vcproj index 0c0b4edb0..4670fc9aa 100755 --- a/generate/msvc9/AcpiXtract.vcproj +++ b/generate/msvc9/AcpiXtract.vcproj @@ -246,10 +246,6 @@ > </File> <File - RelativePath="..\..\source\components\utilities\uthex.c" - > - </File> - <File RelativePath="..\..\source\components\utilities\utmath.c" > </File> diff --git a/generate/unix/acpidump/Makefile b/generate/unix/acpidump/Makefile index 702a3a004..d6e19644c 100644 --- a/generate/unix/acpidump/Makefile +++ b/generate/unix/acpidump/Makefile @@ -44,7 +44,6 @@ OBJECTS = \ $(OBJDIR)/utdebug.o\ $(OBJDIR)/utexcep.o\ $(OBJDIR)/utglobal.o\ - $(OBJDIR)/uthex.o\ $(OBJDIR)/utmath.o\ $(OBJDIR)/utnonansi.o\ $(OBJDIR)/utprint.o\ diff --git a/generate/unix/acpisrc/Makefile b/generate/unix/acpisrc/Makefile index 91e813bcb..93a9868cf 100644 --- a/generate/unix/acpisrc/Makefile +++ b/generate/unix/acpisrc/Makefile @@ -43,7 +43,6 @@ OBJECTS = \ $(OBJDIR)/utdebug.o\ $(OBJDIR)/utexcep.o\ $(OBJDIR)/utglobal.o\ - $(OBJDIR)/uthex.o\ $(OBJDIR)/utmath.o\ $(OBJDIR)/utnonansi.o\ $(OBJDIR)/utprint.o\ diff --git a/generate/unix/acpixtract/Makefile b/generate/unix/acpixtract/Makefile index 4b29e6741..272cbd091 100644 --- a/generate/unix/acpixtract/Makefile +++ b/generate/unix/acpixtract/Makefile @@ -37,7 +37,6 @@ OBJECTS = \ $(OBJDIR)/utdebug.o\ $(OBJDIR)/utexcep.o\ $(OBJDIR)/utglobal.o\ - $(OBJDIR)/uthex.o\ $(OBJDIR)/utmath.o\ $(OBJDIR)/utnonansi.o\ $(OBJDIR)/utprint.o\ diff --git a/source/components/events/evgpeinit.c b/source/components/events/evgpeinit.c index b3f7c7a6e..2ad478513 100644 --- a/source/components/events/evgpeinit.c +++ b/source/components/events/evgpeinit.c @@ -408,9 +408,7 @@ AcpiEvMatchGpeMethod ( 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_STATUS Status; UINT32 GpeNumber; - UINT64 TempGpeNumber; char Name[ACPI_NAME_SIZE + 1]; UINT8 Type; @@ -469,9 +467,8 @@ AcpiEvMatchGpeMethod ( /* 4) The last two characters of the name are the hex GPE Number */ - Status = AcpiUtStrtoul64 (&Name[2], 16, ACPI_MAX32_BYTE_WIDTH, - &TempGpeNumber); - if (ACPI_FAILURE (Status)) + GpeNumber = strtoul (&Name[2], NULL, 16); + if (GpeNumber == ACPI_UINT32_MAX) { /* Conversion failed; invalid method, just ignore it */ @@ -483,7 +480,6 @@ AcpiEvMatchGpeMethod ( /* Ensure that we have a valid GPE number for this GPE block */ - GpeNumber = (UINT32) TempGpeNumber; GpeEventInfo = AcpiEvLowGetGpeInfo (GpeNumber, WalkInfo->GpeBlock); if (!GpeEventInfo) { diff --git a/source/components/utilities/utnonansi.c b/source/components/utilities/utnonansi.c index aea4cfc1b..1e6512ea2 100644 --- a/source/components/utilities/utnonansi.c +++ b/source/components/utilities/utnonansi.c @@ -120,20 +120,6 @@ #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utnonansi") -/* Local prototypes */ - -static ACPI_STATUS -AcpiUtStrtoulBase10 ( - char *String, - UINT32 MaxIntegerByteWidth, - UINT64 *RetInteger); - -static ACPI_STATUS -AcpiUtStrtoulBase16 ( - char *String, - UINT32 MaxIntegerByteWidth, - UINT64 *RetInteger); - /* * Non-ANSI C library functions - strlwr, strupr, stricmp, and a 64-bit @@ -330,10 +316,10 @@ AcpiUtSafeStrncat ( * * FUNCTION: AcpiUtStrtoul64 * - * PARAMETERS: String - Null terminated input string + * PARAMETERS: String - Null terminated string * Base - Radix of the string: 16 or 10 or * ACPI_ANY_BASE - * MaxIntegerByteWidth - Maximum allowable integer, in bytes: + * MaxIntegerByteWidth - Maximum allowable integer,in bytes: * 4 or 8 (32 or 64 bits) * RetInteger - Where the converted integer is * returned @@ -347,24 +333,13 @@ AcpiUtSafeStrncat ( * NOTES: Negative numbers are not supported, as they are not supported * by ACPI. * - * Supports only base 16 or base 10 strings/values. Does not - * support Octal strings, not needed at this time. - * * AcpiGbl_IntegerByteWidth should be set to the proper width. * For the core ACPICA code, this width depends on the DSDT * version. For iASL, the default byte width is always 8 for the * parser, but error checking is performed later to flag cases * where a 64-bit constant is defined in a 32-bit DSDT/SSDT. * - * Unlike Clib, this function aborts with an error for any - * malformed input string. - * - * Currently used by: - * iASL/Preprocessor - Expression evaluation - * iASL/DataTableCompiler - Expression evaluation - * Debugger - input string conversion - * Interpreter - Implicit and explicit conversions - * Tools - acpidump, acpiexec + * Does not support Octal strings, not needed at this time. * ******************************************************************************/ @@ -375,52 +350,58 @@ AcpiUtStrtoul64 ( UINT32 MaxIntegerByteWidth, UINT64 *RetInteger) { - ACPI_FUNCTION_TRACE_STR (UtStrtoul64, String); + UINT32 ThisDigit = 0; + UINT64 ReturnValue = 0; + UINT64 Quotient; + UINT64 Dividend; + UINT8 ValidDigits = 0; + UINT8 SignOf0x = 0; + UINT8 Term = 0; - /* Parameter validation */ + ACPI_FUNCTION_TRACE_STR (UtStrtoul64, String); - if (!String || !RetInteger) - { - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - if ((Base != ACPI_ANY_BASE) && - (Base != 10) && - (Base != 16)) + switch (Base) { + case ACPI_ANY_BASE: + case 10: + case 16: + + break; + + default: + /* Invalid Base */ return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* Skip over any white space at start of string */ - - while (isspace ((int) *String)) + if (!String) { - String++; + goto ErrorExit; } - if (*String == 0) + /* Skip over any white space in the buffer */ + + while ((*String) && (isspace ((int) *String) || *String == '\t')) { - return_ACPI_STATUS (AE_BAD_PARAMETER); + String++; } - /* Determine base if necessary (10 or 16) */ - if (Base == ACPI_ANY_BASE) { /* - * (Base == ACPI_ANY_BASE) means "Either decimal or hex"; - * determine which one. - * NOTE: there is no octal or arbitary base support. + * Base equal to ACPI_ANY_BASE means 'Either decimal or hex'. + * We need to determine if it is decimal or hexadecimal. */ - if ((*String == '0') && - (tolower ((int) *(String + 1)) == 'x')) + if ((*String == '0') && (tolower ((int) *(String + 1)) == 'x')) { - /* Found a "0x" prefix -- the string is hex */ - + SignOf0x = 1; Base = 16; + + /* Skip over the leading '0x' */ + String += 2; } else { @@ -428,175 +409,331 @@ AcpiUtStrtoul64 ( } } - /* Perform the base 16 or 10 conversion */ + /* Any string left? Check that '0x' is not followed by white space. */ - if (Base == 16) + if (!(*String) || isspace ((int) *String) || *String == '\t') { - return (AcpiUtStrtoulBase16 (String, MaxIntegerByteWidth, RetInteger)); - } - else - { - return (AcpiUtStrtoulBase10 (String, MaxIntegerByteWidth, RetInteger)); + if (Base == ACPI_ANY_BASE) + { + goto ErrorExit; + } + else + { + goto AllDone; + } } -} + /* + * Perform a 32-bit or 64-bit conversion, depending upon the input + * byte width + */ + Dividend = (MaxIntegerByteWidth <= ACPI_MAX32_BYTE_WIDTH) ? + ACPI_UINT32_MAX : ACPI_UINT64_MAX; -/******************************************************************************* - * - * FUNCTION: AcpiUtStrtoulBase10 - * - * PARAMETERS: String - Null terminated input string - * MaxIntegerByteWidth - Maximum allowable integer, in bytes: - * 4 or 8 (32 or 64 bits) - * RetInteger - Where the converted integer is - * returned - * - * RETURN: Status - * - * DESCRIPTION: Performs a base 10 conversion of the input string to an - * integer value, either 32 or 64 bits. - * Note: String must be valid and non-null. - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiUtStrtoulBase10 ( - char *String, - UINT32 MaxIntegerByteWidth, - UINT64 *RetInteger) -{ - UINT32 ThisDigit; - UINT32 ValidDigits = 0; - UINT64 ReturnValue = 0; - UINT64 NextValue; - - - /* Main loop: convert each ASCII byte in the input string */ + /* Main loop: convert the string to a 32- or 64-bit integer */ while (*String) { - /* Skip all leading zeros */ + if (isdigit ((int) *String)) + { + /* Convert ASCII 0-9 to Decimal value */ + + ThisDigit = ((UINT8) *String) - '0'; + } + else if (Base == 10) + { + /* Digit is out of range; possible in ToInteger case only */ - if ((ValidDigits == 0) && (*String == ACPI_ASCII_ZERO)) + Term = 1; + } + else { + ThisDigit = (UINT8) toupper ((int) *String); + if (isxdigit ((int) ThisDigit)) + { + /* Convert ASCII Hex char to value */ + + ThisDigit = ThisDigit - 'A' + 10; + } + else + { + Term = 1; + } + } + + if (Term) + { + if (Base == ACPI_ANY_BASE) + { + goto ErrorExit; + } + else + { + break; + } + } + else if ((ValidDigits == 0) && (ThisDigit == 0) && !SignOf0x) + { + /* Skip zeros */ String++; continue; } - ThisDigit = (UINT8) toupper ((int) *String); - if (!isdigit ((int) ThisDigit)) - { - /* Not ASCII 0-9, terminate */ + ValidDigits++; - return (AE_BAD_DECIMAL_CONSTANT); + if (SignOf0x && ((ValidDigits > 16) || + ((ValidDigits > 8) && (MaxIntegerByteWidth <= ACPI_MAX32_BYTE_WIDTH)))) + { + /* + * This is ToInteger operation case. + * No restrictions for string-to-integer conversion, + * see ACPI spec. + */ + goto ErrorExit; } - /* Convert and insert(add) the decimal digit */ - - NextValue = (ReturnValue * 10) + (ThisDigit - '0'); + /* Divide the digit into the correct position */ - /* Check for overflow (32 or 64 bit) */ + (void) AcpiUtShortDivide ( + (Dividend - (UINT64) ThisDigit), Base, &Quotient, NULL); - if (((MaxIntegerByteWidth <= ACPI_MAX32_BYTE_WIDTH) && - (NextValue > ACPI_UINT32_MAX)) || - (NextValue < ReturnValue)) /* 64-bit overflow case */ + if (ReturnValue > Quotient) { - return (AE_CONVERSION_OVERFLOW); + if (Base == ACPI_ANY_BASE) + { + goto ErrorExit; + } + else + { + break; + } } - ReturnValue = NextValue; + ReturnValue *= Base; + ReturnValue += ThisDigit; String++; - ValidDigits++; } + /* All done, normal exit */ + +AllDone: + + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Converted value: %8.8X%8.8X\n", + ACPI_FORMAT_UINT64 (ReturnValue))); + *RetInteger = ReturnValue; - return (AE_OK); + return_ACPI_STATUS (AE_OK); + + +ErrorExit: + + /* Base was set/validated above (10 or 16) */ + + if (Base == 10) + { + return_ACPI_STATUS (AE_BAD_DECIMAL_CONSTANT); + } + else + { + return_ACPI_STATUS (AE_BAD_HEX_CONSTANT); + } } +#ifdef _OBSOLETE_FUNCTIONS +/* Removed: 01/2016 */ + /******************************************************************************* * - * FUNCTION: AcpiUtStrtoulBase16 + * FUNCTION: strtoul64 * - * PARAMETERS: String - Null terminated input string - * MaxIntegerByteWidth - Maximum allowable integer, in bytes: - * 4 or 8 (32 or 64 bits) - * RetInteger - Where the converted integer is - * returned + * PARAMETERS: String - Null terminated string + * Terminater - Where a pointer to the terminating byte + * is returned + * Base - Radix of the string * - * RETURN: Status + * RETURN: Converted value * - * DESCRIPTION: Performs a base 16 conversion of the input string to an - * integer value, either 32 or 64 bits. - * Note: String must be valid and non-null. + * DESCRIPTION: Convert a string into an unsigned value. * ******************************************************************************/ -static ACPI_STATUS -AcpiUtStrtoulBase16 ( +ACPI_STATUS +strtoul64 ( char *String, - UINT32 MaxIntegerByteWidth, + UINT32 Base, UINT64 *RetInteger) { - UINT32 ThisDigit; - UINT32 ValidDigits = 0; + UINT32 Index; + UINT32 Sign; UINT64 ReturnValue = 0; + ACPI_STATUS Status = AE_OK; + + + *RetInteger = 0; + + switch (Base) + { + case 0: + case 8: + case 10: + case 16: + + break; + + default: + /* + * The specified Base parameter is not in the domain of + * this function: + */ + return (AE_BAD_PARAMETER); + } + /* Skip over any white space in the buffer: */ + + while (isspace ((int) *String) || *String == '\t') + { + ++String; + } - /* Allow "0x" prefix for all hex constants */ + /* + * The buffer may contain an optional plus or minus sign. + * If it does, then skip over it but remember what is was: + */ + if (*String == '-') + { + Sign = ACPI_SIGN_NEGATIVE; + ++String; + } + else if (*String == '+') + { + ++String; + Sign = ACPI_SIGN_POSITIVE; + } + else + { + Sign = ACPI_SIGN_POSITIVE; + } - if ((*String == '0') && - (tolower ((int) *(String + 1)) == 'x')) + /* + * If the input parameter Base is zero, then we need to + * determine if it is octal, decimal, or hexadecimal: + */ + if (Base == 0) { - String += 2; /* Go past the 0x */ - if (*String == 0) + if (*String == '0') + { + if (tolower ((int) *(++String)) == 'x') + { + Base = 16; + ++String; + } + else + { + Base = 8; + } + } + else { - return (AE_BAD_HEX_CONSTANT); + Base = 10; } } - /* Main loop: convert each ASCII byte in the input string */ + /* + * For octal and hexadecimal bases, skip over the leading + * 0 or 0x, if they are present. + */ + if (Base == 8 && *String == '0') + { + String++; + } + + if (Base == 16 && + *String == '0' && + tolower ((int) *(++String)) == 'x') + { + String++; + } + + /* Main loop: convert the string to an unsigned long */ while (*String) { - /* Skip all leading zeros */ + if (isdigit ((int) *String)) + { + Index = ((UINT8) *String) - '0'; + } + else + { + Index = (UINT8) toupper ((int) *String); + if (isupper ((int) Index)) + { + Index = Index - 'A' + 10; + } + else + { + goto ErrorExit; + } + } - if ((ValidDigits == 0) && (*String == ACPI_ASCII_ZERO)) + if (Index >= Base) { - String++; - continue; + goto ErrorExit; } - /* Check for overflow (32 or 64 bit) */ + /* Check to see if value is out of range: */ - if ((ValidDigits > 16) || - ((ValidDigits > 8) && (MaxIntegerByteWidth <= ACPI_MAX32_BYTE_WIDTH))) + if (ReturnValue > ((ACPI_UINT64_MAX - (UINT64) Index) / + (UINT64) Base)) { - /* - * This is ToInteger operation case. - * No restrictions for string-to-integer conversion, - * see ACPI spec. - */ - return (AE_CONVERSION_OVERFLOW); + goto ErrorExit; } - - ThisDigit = (UINT8) toupper ((int) *String); - if (!isxdigit ((int) ThisDigit)) + else { - /* Not Hex ASCII A-F or 0-9, terminate */ - - return (AE_BAD_HEX_CONSTANT); + ReturnValue *= Base; + ReturnValue += Index; } - /* Convert and insert the hex digit */ + ++String; + } - ThisDigit = AcpiUtAsciiCharToHex (ThisDigit); - ReturnValue = (ReturnValue << 4) | ThisDigit; - String++; - ValidDigits++; + /* If a minus sign was present, then "the conversion is negated": */ + + if (Sign == ACPI_SIGN_NEGATIVE) + { + ReturnValue = (ACPI_UINT32_MAX - ReturnValue) + 1; } *RetInteger = ReturnValue; - return (AE_OK); + return (Status); + + +ErrorExit: + switch (Base) + { + case 8: + + Status = AE_BAD_OCTAL_CONSTANT; + break; + + case 10: + + Status = AE_BAD_DECIMAL_CONSTANT; + break; + + case 16: + + Status = AE_BAD_HEX_CONSTANT; + break; + + default: + + /* Base validated above */ + + break; + } + + return (Status); } +#endif diff --git a/source/include/acexcep.h b/source/include/acexcep.h index 4ab007d1b..c5217295d 100644 --- a/source/include/acexcep.h +++ b/source/include/acexcep.h @@ -201,9 +201,8 @@ typedef struct acpi_exception_info #define AE_NOT_CONFIGURED EXCEP_ENV (0x001C) #define AE_ACCESS EXCEP_ENV (0x001D) #define AE_IO_ERROR EXCEP_ENV (0x001E) -#define AE_CONVERSION_OVERFLOW EXCEP_ENV (0x001F) -#define AE_CODE_ENV_MAX 0x001F +#define AE_CODE_ENV_MAX 0x001E /* @@ -337,8 +336,7 @@ static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Env[] = EXCEP_TXT ("AE_OWNER_ID_LIMIT", "There are no more Owner IDs available for ACPI tables or control methods"), EXCEP_TXT ("AE_NOT_CONFIGURED", "The interface is not part of the current subsystem configuration"), EXCEP_TXT ("AE_ACCESS", "Permission denied for the requested operation"), - EXCEP_TXT ("AE_IO_ERROR", "An I/O error occurred"), - EXCEP_TXT ("AE_CONVERSION_OVERFLOW", "Overflow during string-to-integer conversion") + EXCEP_TXT ("AE_IO_ERROR", "An I/O error occurred") }; static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Pgm[] = diff --git a/source/include/platform/acmsvc.h b/source/include/platform/acmsvc.h index 3b982ffed..133f449ef 100644 --- a/source/include/platform/acmsvc.h +++ b/source/include/platform/acmsvc.h @@ -221,9 +221,6 @@ /* warn C4131: uses old-style declarator (iASL compiler only) */ #pragma warning(disable:4131) -/* warn C4310: cast truncates constant value */ -#pragma warning(disable:4310) - #if _MSC_VER > 1200 /* Versions above VC++ 6 */ #pragma warning( disable : 4295 ) /* needed for acpredef.h array */ #endif diff --git a/source/tools/acpiexec/aeexec.c b/source/tools/acpiexec/aeexec.c index 84df25caf..452943dc3 100644 --- a/source/tools/acpiexec/aeexec.c +++ b/source/tools/acpiexec/aeexec.c @@ -160,10 +160,6 @@ static void AeTestSleepData ( void); -static void -AeTestStringConversions ( - void); - #if (!ACPI_REDUCED_HARDWARE) static void AfInstallGpeBlock ( @@ -662,98 +658,6 @@ AeTestSleepData ( } } -/****************************************************************************** - * - * FUNCTION: AeTestStringConversions - * - * DESCRIPTION: Exercise AcpiUtStrtoul64 - * - *****************************************************************************/ - -static void -AeTestStringConversions ( - void) -{ - UINT64 TempGpeNumber; - UINT64 Value; - ACPI_STATUS Status; - - - /* Check for GPE 2-digit values (_Lxx and _Exx) */ - - Status = AcpiUtStrtoul64 ("JK", 16, ACPI_MAX32_BYTE_WIDTH, - &TempGpeNumber); - ACPI_CHECK_STATUS (AcpiUtStrtoul64, Status, AE_BAD_HEX_CONSTANT); - - Status = AcpiUtStrtoul64 ("44", 16, ACPI_MAX32_BYTE_WIDTH, - &TempGpeNumber); - ACPI_CHECK_OK (AcpiUtStrtoul64, Status); - - Status = AcpiUtStrtoul64 ("8B", 16, ACPI_MAX32_BYTE_WIDTH, - &TempGpeNumber); - ACPI_CHECK_OK (AcpiUtStrtoul64, Status); - - Status = AcpiUtStrtoul64 ("CC", 16, ACPI_MAX32_BYTE_WIDTH, - &TempGpeNumber); - ACPI_CHECK_OK (AcpiUtStrtoul64, Status); - - Status = AcpiUtStrtoul64 ("DY", 16, ACPI_MAX32_BYTE_WIDTH, - &TempGpeNumber); - ACPI_CHECK_STATUS (AcpiUtStrtoul64, Status, AE_BAD_HEX_CONSTANT); - - /* Normal conversions */ - - Status = AcpiUtStrtoul64 ("0x", 0, ACPI_MAX64_BYTE_WIDTH, &Value); - ACPI_CHECK_STATUS (AcpiUtStrtoul64, Status, AE_BAD_HEX_CONSTANT); - - Status = AcpiUtStrtoul64 (" utututututu", 16, ACPI_MAX64_BYTE_WIDTH, &Value); - ACPI_CHECK_STATUS (AcpiUtStrtoul64, Status, AE_BAD_HEX_CONSTANT); - - Status = AcpiUtStrtoul64 (" ", 0, ACPI_MAX64_BYTE_WIDTH, &Value); - ACPI_CHECK_STATUS (AcpiUtStrtoul64, Status, AE_BAD_PARAMETER); - - Status = AcpiUtStrtoul64 ("", 0, ACPI_MAX64_BYTE_WIDTH, &Value); - ACPI_CHECK_STATUS (AcpiUtStrtoul64, Status, AE_BAD_PARAMETER); - - Status = AcpiUtStrtoul64 (NULL, 0, ACPI_MAX64_BYTE_WIDTH, &Value); - ACPI_CHECK_STATUS (AcpiUtStrtoul64, Status, AE_BAD_PARAMETER); - - Status = AcpiUtStrtoul64 ("0x 012345678AAAAAAAyyyy", 0, ACPI_MAX64_BYTE_WIDTH, &Value); - ACPI_CHECK_STATUS (AcpiUtStrtoul64, Status, AE_BAD_HEX_CONSTANT); - - Status = AcpiUtStrtoul64 ("0x012345678AAAAAAAyyyy", 0, ACPI_MAX64_BYTE_WIDTH, &Value); - ACPI_CHECK_STATUS (AcpiUtStrtoul64, Status, AE_BAD_HEX_CONSTANT); - - Status = AcpiUtStrtoul64 ("0123456789ABCDEF", 16, ACPI_MAX64_BYTE_WIDTH, &Value); - ACPI_CHECK_OK (AcpiUtStrtoul64, Status); - - Status = AcpiUtStrtoul64 ("0x0123456789ABCDEF", 0, ACPI_MAX64_BYTE_WIDTH, &Value); - ACPI_CHECK_OK (AcpiUtStrtoul64, Status); - - Status = AcpiUtStrtoul64 ("0x01WXYZ", 0, ACPI_MAX64_BYTE_WIDTH, &Value); - ACPI_CHECK_STATUS (AcpiUtStrtoul64, Status, AE_BAD_HEX_CONSTANT); - - Status = AcpiUtStrtoul64 ("0x01234567", 0, ACPI_MAX32_BYTE_WIDTH, &Value); - ACPI_CHECK_OK (AcpiUtStrtoul64, Status); - - Status = AcpiUtStrtoul64 ("012345678", 0, ACPI_MAX64_BYTE_WIDTH, &Value); - ACPI_CHECK_OK (AcpiUtStrtoul64, Status); - - Status = AcpiUtStrtoul64 ("012345678", 10, ACPI_MAX64_BYTE_WIDTH, &Value); - ACPI_CHECK_OK (AcpiUtStrtoul64, Status); - - /* Overflow */ - - Status = AcpiUtStrtoul64 ("01234567877777777777777777777777777", 10, ACPI_MAX32_BYTE_WIDTH, &Value); - ACPI_CHECK_STATUS (AcpiUtStrtoul64, Status, AE_CONVERSION_OVERFLOW); - - Status = AcpiUtStrtoul64 ("0x12345678AAAAAAAAAAAAAAAAAAAA", 16, ACPI_MAX64_BYTE_WIDTH, &Value); - ACPI_CHECK_STATUS (AcpiUtStrtoul64, Status, AE_CONVERSION_OVERFLOW); - - Status = AcpiUtStrtoul64 ("0x0000000012345678BBBBCCCC", 16, ACPI_MAX64_BYTE_WIDTH, &Value); - ACPI_CHECK_OK (AcpiUtStrtoul64, Status); -} - /****************************************************************************** * @@ -1032,9 +936,5 @@ AeMiscellaneousTests ( Status = AcpiReleaseGlobalLock (LockHandle2); ACPI_CHECK_OK (AcpiReleaseGlobalLock, Status); - /* Test conversion routines */ - - AeTestStringConversions (); - #endif /* !ACPI_REDUCED_HARDWARE */ } |