diff options
Diffstat (limited to 'source/components/utilities')
-rw-r--r-- | source/components/utilities/utdebug.c | 40 | ||||
-rw-r--r-- | source/components/utilities/uteval.c | 4 | ||||
-rw-r--r-- | source/components/utilities/utglobal.c | 55 | ||||
-rw-r--r-- | source/components/utilities/utmisc.c | 2 | ||||
-rw-r--r-- | source/components/utilities/utnonansi.c | 61 | ||||
-rw-r--r-- | source/components/utilities/utprint.c | 6 | ||||
-rw-r--r-- | source/components/utilities/uttrack.c | 2 | ||||
-rw-r--r-- | source/components/utilities/utxfinit.c | 47 |
8 files changed, 122 insertions, 95 deletions
diff --git a/source/components/utilities/utdebug.c b/source/components/utilities/utdebug.c index ccdca57bff578..b6ae2c73356b6 100644 --- a/source/components/utilities/utdebug.c +++ b/source/components/utilities/utdebug.c @@ -53,15 +53,9 @@ #ifdef ACPI_DEBUG_OUTPUT -static ACPI_THREAD_ID AcpiGbl_PrevThreadId = (ACPI_THREAD_ID) 0xFFFFFFFF; -static char *AcpiGbl_FnEntryStr = "----Entry"; -static char *AcpiGbl_FnExitStr = "----Exit-"; - -/* Local prototypes */ - -static const char * -AcpiUtTrimFunctionName ( - const char *FunctionName); +static ACPI_THREAD_ID AcpiGbl_PreviousThreadId = (ACPI_THREAD_ID) 0xFFFFFFFF; +static const char *AcpiGbl_FunctionEntryPrefix = "----Entry"; +static const char *AcpiGbl_FunctionExitPrefix = "----Exit-"; /******************************************************************************* @@ -201,16 +195,16 @@ AcpiDebugPrint ( * Thread tracking and context switch notification */ ThreadId = AcpiOsGetThreadId (); - if (ThreadId != AcpiGbl_PrevThreadId) + if (ThreadId != AcpiGbl_PreviousThreadId) { if (ACPI_LV_THREADS & AcpiDbgLevel) { AcpiOsPrintf ( "\n**** Context Switch from TID %u to TID %u ****\n\n", - (UINT32) AcpiGbl_PrevThreadId, (UINT32) ThreadId); + (UINT32) AcpiGbl_PreviousThreadId, (UINT32) ThreadId); } - AcpiGbl_PrevThreadId = ThreadId; + AcpiGbl_PreviousThreadId = ThreadId; AcpiGbl_NestingLevel = 0; } @@ -325,7 +319,7 @@ AcpiUtTrace ( { AcpiDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, FunctionName, ModuleName, ComponentId, - "%s\n", AcpiGbl_FnEntryStr); + "%s\n", AcpiGbl_FunctionEntryPrefix); } } @@ -355,7 +349,7 @@ AcpiUtTracePtr ( const char *FunctionName, const char *ModuleName, UINT32 ComponentId, - void *Pointer) + const void *Pointer) { AcpiGbl_NestingLevel++; @@ -367,7 +361,7 @@ AcpiUtTracePtr ( { AcpiDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, FunctionName, ModuleName, ComponentId, - "%s %p\n", AcpiGbl_FnEntryStr, Pointer); + "%s %p\n", AcpiGbl_FunctionEntryPrefix, Pointer); } } @@ -395,7 +389,7 @@ AcpiUtTraceStr ( const char *FunctionName, const char *ModuleName, UINT32 ComponentId, - char *String) + const char *String) { AcpiGbl_NestingLevel++; @@ -407,7 +401,7 @@ AcpiUtTraceStr ( { AcpiDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, FunctionName, ModuleName, ComponentId, - "%s %s\n", AcpiGbl_FnEntryStr, String); + "%s %s\n", AcpiGbl_FunctionEntryPrefix, String); } } @@ -447,7 +441,7 @@ AcpiUtTraceU32 ( { AcpiDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, FunctionName, ModuleName, ComponentId, - "%s %08X\n", AcpiGbl_FnEntryStr, Integer); + "%s %08X\n", AcpiGbl_FunctionEntryPrefix, Integer); } } @@ -482,7 +476,7 @@ AcpiUtExit ( { AcpiDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, FunctionName, ModuleName, ComponentId, - "%s\n", AcpiGbl_FnExitStr); + "%s\n", AcpiGbl_FunctionExitPrefix); } if (AcpiGbl_NestingLevel) @@ -528,14 +522,14 @@ AcpiUtStatusExit ( { AcpiDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, FunctionName, ModuleName, ComponentId, - "%s %s\n", AcpiGbl_FnExitStr, + "%s %s\n", AcpiGbl_FunctionExitPrefix, AcpiFormatException (Status)); } else { AcpiDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, FunctionName, ModuleName, ComponentId, - "%s ****Exception****: %s\n", AcpiGbl_FnExitStr, + "%s ****Exception****: %s\n", AcpiGbl_FunctionExitPrefix, AcpiFormatException (Status)); } } @@ -581,7 +575,7 @@ AcpiUtValueExit ( { AcpiDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, FunctionName, ModuleName, ComponentId, - "%s %8.8X%8.8X\n", AcpiGbl_FnExitStr, + "%s %8.8X%8.8X\n", AcpiGbl_FunctionExitPrefix, ACPI_FORMAT_UINT64 (Value)); } @@ -626,7 +620,7 @@ AcpiUtPtrExit ( { AcpiDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, FunctionName, ModuleName, ComponentId, - "%s %p\n", AcpiGbl_FnExitStr, Ptr); + "%s %p\n", AcpiGbl_FunctionExitPrefix, Ptr); } if (AcpiGbl_NestingLevel) diff --git a/source/components/utilities/uteval.c b/source/components/utilities/uteval.c index bdde513884c07..d4864f3813c4a 100644 --- a/source/components/utilities/uteval.c +++ b/source/components/utilities/uteval.c @@ -72,7 +72,7 @@ ACPI_STATUS AcpiUtEvaluateObject ( ACPI_NAMESPACE_NODE *PrefixNode, - char *Path, + const char *Path, UINT32 ExpectedReturnBtypes, ACPI_OPERAND_OBJECT **ReturnDesc) { @@ -219,7 +219,7 @@ Cleanup: ACPI_STATUS AcpiUtEvaluateNumericObject ( - char *ObjectName, + const char *ObjectName, ACPI_NAMESPACE_NODE *DeviceNode, UINT64 *Value) { diff --git a/source/components/utilities/utglobal.c b/source/components/utilities/utglobal.c index ed3a171eeb066..0d8dff88c912e 100644 --- a/source/components/utilities/utglobal.c +++ b/source/components/utilities/utglobal.c @@ -87,6 +87,12 @@ const char *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS] = }; +/* Hex-to-ascii */ + +const char AcpiGbl_LowerHexDigits[] = "0123456789abcdef"; +const char AcpiGbl_UpperHexDigits[] = "0123456789ABCDEF"; + + /******************************************************************************* * * Namespace globals @@ -179,6 +185,55 @@ ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] = }; #endif /* !ACPI_REDUCED_HARDWARE */ + +#if defined (ACPI_DISASSEMBLER) || defined (ACPI_ASL_COMPILER) + +/* ToPld macro: compile/disassemble strings */ + +const char *AcpiGbl_PldPanelList[] = +{ + "TOP", + "BOTTOM", + "LEFT", + "RIGHT", + "FRONT", + "BACK", + "UNKNOWN", + NULL +}; + +const char *AcpiGbl_PldVerticalPositionList[] = +{ + "UPPER", + "CENTER", + "LOWER", + NULL +}; + +const char *AcpiGbl_PldHorizontalPositionList[] = +{ + "LEFT", + "CENTER", + "RIGHT", + NULL +}; + +const char *AcpiGbl_PldShapeList[] = +{ + "ROUND", + "OVAL", + "SQUARE", + "VERTICALRECTANGLE", + "HORIZONTALRECTANGLE", + "VERTICALTRAPEZOID", + "HORIZONTALTRAPEZOID", + "UNKNOWN", + "CHAMFERED", + NULL +}; +#endif + + /* Public globals */ ACPI_EXPORT_SYMBOL (AcpiGbl_FADT) diff --git a/source/components/utilities/utmisc.c b/source/components/utilities/utmisc.c index e35a0ef502ef7..ce8f25426d7f0 100644 --- a/source/components/utilities/utmisc.c +++ b/source/components/utilities/utmisc.c @@ -401,7 +401,7 @@ void AcpiUtDisplayInitPathname ( UINT8 Type, ACPI_NAMESPACE_NODE *ObjHandle, - char *Path) + const char *Path) { ACPI_STATUS Status; ACPI_BUFFER Buffer; diff --git a/source/components/utilities/utnonansi.c b/source/components/utilities/utnonansi.c index 572d24a6b6c3c..70fb33e64c0c8 100644 --- a/source/components/utilities/utnonansi.c +++ b/source/components/utilities/utnonansi.c @@ -244,41 +244,44 @@ AcpiUtSafeStrncat ( * * FUNCTION: AcpiUtStrtoul64 * - * PARAMETERS: String - Null terminated string - * Base - Radix of the string: 16 or ACPI_ANY_BASE; - * ACPI_ANY_BASE means 'in behalf of ToInteger' - * RetInteger - Where the converted integer is returned + * PARAMETERS: String - Null terminated string + * Base - Radix of the string: 16 or 10 or + * ACPI_ANY_BASE + * MaxIntegerByteWidth - Maximum allowable integer,in bytes: + * 4 or 8 (32 or 64 bits) + * RetInteger - Where the converted integer is + * returned * * RETURN: Status and Converted value * * DESCRIPTION: Convert a string into an unsigned value. Performs either a - * 32-bit or 64-bit conversion, depending on the current mode - * of the interpreter. + * 32-bit or 64-bit conversion, depending on the input integer + * size (often the current mode of the interpreter). * - * NOTES: AcpiGbl_IntegerByteWidth should be set to the proper width. + * NOTES: Negative numbers are not supported, as they are not supported + * by ACPI. + * + * 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. + * 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. * * Does not support Octal strings, not needed at this time. * - * There is an earlier version of the function after this one, - * below. It is slightly different than this one, and the two - * may eventually may need to be merged. (01/2016). - * ******************************************************************************/ ACPI_STATUS AcpiUtStrtoul64 ( char *String, UINT32 Base, + UINT32 MaxIntegerByteWidth, UINT64 *RetInteger) { UINT32 ThisDigit = 0; UINT64 ReturnValue = 0; UINT64 Quotient; UINT64 Dividend; - UINT32 ToIntegerOp = (Base == ACPI_ANY_BASE); - UINT32 Mode32 = (AcpiGbl_IntegerByteWidth == 4); UINT8 ValidDigits = 0; UINT8 SignOf0x = 0; UINT8 Term = 0; @@ -290,6 +293,7 @@ AcpiUtStrtoul64 ( switch (Base) { case ACPI_ANY_BASE: + case 10: case 16: break; @@ -313,10 +317,10 @@ AcpiUtStrtoul64 ( String++; } - if (ToIntegerOp) + if (Base == ACPI_ANY_BASE) { /* - * Base equal to ACPI_ANY_BASE means 'ToInteger operation case'. + * 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')) @@ -337,7 +341,7 @@ AcpiUtStrtoul64 ( if (!(*String) || isspace ((int) *String) || *String == '\t') { - if (ToIntegerOp) + if (Base == ACPI_ANY_BASE) { goto ErrorExit; } @@ -348,10 +352,11 @@ AcpiUtStrtoul64 ( } /* - * Perform a 32-bit or 64-bit conversion, depending upon the current - * execution mode of the interpreter + * Perform a 32-bit or 64-bit conversion, depending upon the input + * byte width */ - Dividend = (Mode32) ? ACPI_UINT32_MAX : ACPI_UINT64_MAX; + Dividend = (MaxIntegerByteWidth <= ACPI_MAX32_BYTE_WIDTH) ? + ACPI_UINT32_MAX : ACPI_UINT64_MAX; /* Main loop: convert the string to a 32- or 64-bit integer */ @@ -386,7 +391,7 @@ AcpiUtStrtoul64 ( if (Term) { - if (ToIntegerOp) + if (Base == ACPI_ANY_BASE) { goto ErrorExit; } @@ -404,11 +409,12 @@ AcpiUtStrtoul64 ( ValidDigits++; - if (SignOf0x && ((ValidDigits > 16) || ((ValidDigits > 8) && Mode32))) + if (SignOf0x && ((ValidDigits > 16) || + ((ValidDigits > 8) && (MaxIntegerByteWidth <= ACPI_MAX32_BYTE_WIDTH)))) { /* * This is ToInteger operation case. - * No any restrictions for string-to-integer conversion, + * No restrictions for string-to-integer conversion, * see ACPI spec. */ goto ErrorExit; @@ -421,7 +427,7 @@ AcpiUtStrtoul64 ( if (ReturnValue > Quotient) { - if (ToIntegerOp) + if (Base == ACPI_ANY_BASE) { goto ErrorExit; } @@ -448,7 +454,8 @@ AllDone: ErrorExit: - /* Base was set/validated above */ + + /* Base was set/validated above (10 or 16) */ if (Base == 10) { @@ -460,9 +467,9 @@ ErrorExit: } } + #ifdef _OBSOLETE_FUNCTIONS -/* TBD: use version in ACPICA main code base? */ -/* DONE: 01/2016 */ +/* Removed: 01/2016 */ /******************************************************************************* * diff --git a/source/components/utilities/utprint.c b/source/components/utilities/utprint.c index 7656924d0f4d7..e01f1734a94ff 100644 --- a/source/components/utilities/utprint.c +++ b/source/components/utilities/utprint.c @@ -88,12 +88,6 @@ AcpiUtPutNumber ( BOOLEAN Upper); -/* Module globals */ - -static const char AcpiGbl_LowerHexDigits[] = "0123456789abcdef"; -static const char AcpiGbl_UpperHexDigits[] = "0123456789ABCDEF"; - - /******************************************************************************* * * FUNCTION: AcpiUtBoundStringLength diff --git a/source/components/utilities/uttrack.c b/source/components/utilities/uttrack.c index b6d6a33639bc6..9efa9d6ec75d8 100644 --- a/source/components/utilities/uttrack.c +++ b/source/components/utilities/uttrack.c @@ -100,7 +100,7 @@ AcpiUtRemoveAllocation ( ACPI_STATUS AcpiUtCreateList ( - char *ListName, + const char *ListName, UINT16 ObjectSize, ACPI_MEMORY_LIST **ReturnCache) { diff --git a/source/components/utilities/utxfinit.c b/source/components/utilities/utxfinit.c index a8ea3fdf49f45..2a518bc82d99f 100644 --- a/source/components/utilities/utxfinit.c +++ b/source/components/utilities/utxfinit.c @@ -168,25 +168,6 @@ AcpiEnableSubsystem ( */ AcpiGbl_EarlyInitialization = FALSE; - /* - * Install the default operation region handlers. These are the - * handlers that are defined by the ACPI specification to be - * "always accessible" -- namely, SystemMemory, SystemIO, and - * PCI_Config. This also means that no _REG methods need to be - * run for these address spaces. We need to have these handlers - * installed before any AML code can be executed, especially any - * module-level code (11/2015). - */ - if (!AcpiGbl_GroupModuleLevelCode) - { - Status = AcpiEvInstallRegionHandlers (); - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, "During Region initialization")); - return_ACPI_STATUS (Status); - } - } - #if (!ACPI_REDUCED_HARDWARE) /* Enable ACPI mode */ @@ -315,27 +296,23 @@ AcpiInitializeObjects ( if (AcpiGbl_GroupModuleLevelCode) { AcpiNsExecModuleCodeList (); - } - /* - * Initialize the objects that remain uninitialized. This runs the - * executable AML that may be part of the declaration of these objects: - * OperationRegions, BufferFields, Buffers, and Packages. - */ - if (!(Flags & ACPI_NO_OBJECT_INIT)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "[Init] Completing Initialization of ACPI Objects\n")); - - Status = AcpiNsInitializeObjects (); - if (ACPI_FAILURE (Status)) + /* + * Initialize the objects that remain uninitialized. This + * runs the executable AML that may be part of the + * declaration of these objects: + * OperationRegions, BufferFields, Buffers, and Packages. + */ + if (!(Flags & ACPI_NO_OBJECT_INIT)) { - return_ACPI_STATUS (Status); + Status = AcpiNsInitializeObjects (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } } } - AcpiGbl_NamespaceInitialized = TRUE; - /* * Initialize all device/region objects in the namespace. This runs * the device _STA and _INI methods and region _REG methods. |