From ffb9a5e13aeed0b2dea490b2f4f68ce8ac51d204 Mon Sep 17 00:00:00 2001 From: Al Stone Date: Nov 25 2013 22:29:01 +0000 Subject: Imported Upstream version 20131115 --- diff --git a/changes.txt b/changes.txt index a0a5931..4a8bb6b 100755 --- a/changes.txt +++ b/changes.txt @@ -1,4 +1,79 @@ ---------------------------------------- +15 November 2013. Summary of changes for version 20131115: + +This release is available at https://acpica.org/downloads + + +1) ACPICA kernel-resident subsystem: + +Resource Manager: Fixed loop termination for the "get AML length" +function. The loop previously had an error termination on a NULL resource +pointer, which can never happen since the loop simply increments a valid +resource pointer. This fix changes the loop to terminate with an error on +an invalid end-of-buffer condition. The problem can be seen as an +infinite loop by callers to AcpiSetCurrentResources with an invalid or +corrupted resource descriptor, or a resource descriptor that is missing +an END_TAG descriptor. Reported by Dan Carpenter +. Lv Zheng, Bob Moore. + +Table unload and ACPICA termination: Delete all attached data objects +during namespace node deletion. This fix updates namespace node deletion +to delete the entire list of attached objects (attached via +AcpiAttachObject) instead of just one of the attached items. ACPICA BZ +1024. Tomasz Nowicki (tomasz.nowicki@linaro.org). + +ACPICA termination: Added support to delete all objects attached to the +root namespace node. This fix deletes any and all objects that have been +attached to the root node via AcpiAttachData. Previously, none of these +objects were deleted. Reported by Tomasz Nowicki. ACPICA BZ 1026. + +Debug output: Do not emit the function nesting level for the in-kernel +build. The nesting level is really only useful during a single-thread +execution. Therefore, only enable this output for the AcpiExec utility. +Also, only emit the thread ID when executing under AcpiExec (Context +switches are still always detected and a message is emitted). ACPICA BZ +972. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 95.9K Code, 27.0K Data, 122.9K Total + Debug Version: 185.1K Code, 77.2K Data, 262.3K Total + Previous Release: + Non-Debug Version: 95.8K Code, 27.0K Data, 122.8K Total + Debug Version: 185.2K Code, 77.2K Data, 262.4K Total + + +2) iASL Compiler/Disassembler and Tools: + +AcpiExec/Unix-OSL: Use instead of . This is the +correct portable POSIX header for terminal control functions. + +Disassembler: Fixed control method invocation issues related to the use +of the CondRefOf() operator. The problem is seen in the disassembly where +control method invocations may not be disassembled properly if the +control method name has been used previously as an argument to CondRefOf. +The solution is to not attempt to emit an external declaration for the +CondRefOf target (it is not necessary in the first place). This prevents +disassembler object type confusion. ACPICA BZ 988. + +Unix Makefiles: Added an option to disable compiler optimizations and the +_FORTIFY_SOURCE flag. Some older compilers have problems compiling ACPICA +with optimizations (reportedly, gcc 4.4 for example). This change adds a +command line option for make (NOOPT) that disables all compiler +optimizations and the _FORTIFY_SOURCE compiler flag. The default +optimization is -O2 with the _FORTIFY_SOURCE flag specified. ACPICA BZ +1034. Lv Zheng, Bob Moore. + +Tests/ASLTS: Added options to specify individual test cases and modes. +This allows testers running aslts.sh to optionally specify individual +test modes and test cases. Also added an option to disable the forced +generation of the ACPICA tools from source if desired. Lv Zheng. + +---------------------------------------- 27 September 2013. Summary of changes for version 20130927: This release is available at https://acpica.org/downloads @@ -7,8 +82,10 @@ This release is available at https://acpica.org/downloads 1) ACPICA kernel-resident subsystem: Fixed a problem with store operations to reference objects. This change -fixes a problem where a Store operation to an ArgX object that contained a -reference to a field object did not complete the automatic dereference and +fixes a problem where a Store operation to an ArgX object that contained +a +reference to a field object did not complete the automatic dereference +and then write to the actual field object. Instead, the object type of the field object was inadvertently changed to match the type of the source operand. The new behavior will actually write to the field object (buffer @@ -26,10 +103,12 @@ Hardcoded the access width for the FADT-defined reset register. The ACPI specification requires the reset register width to be 8 bits. ACPICA now hardcodes the width to 8 and ignores the FADT width value. This provides compatibility with other ACPI implementations that have allowed BIOS code -with bad register width values to go unnoticed. Matthew Garett, Bob Moore, +with bad register width values to go unnoticed. Matthew Garett, Bob +Moore, Lv Zheng. -Changed the position/use of the ACPI_PRINTF_LIKE macro. This macro is used +Changed the position/use of the ACPI_PRINTF_LIKE macro. This macro is +used in the OSL header (acpiosxf). The change modifies the position of this macro in each instance where it is used (AcpiDebugPrint, etc.) to avoid build issues if the OSL defines the implementation of the interface to be @@ -42,12 +121,14 @@ additional or different processing for these functions. Changed from ACPI_EXPORT_SYMBOL to ACPI_EXPORT_SYMBOL_INIT for these functions. Lv Zheng, Bob Moore. -Cleaned up the memory allocation macros for configurability. In the common +Cleaned up the memory allocation macros for configurability. In the +common case, the ACPI_ALLOCATE and related macros now resolve directly to their respective AcpiOs* OSL interfaces. Two options: 1) The ACPI_ALLOCATE_ZEROED macro uses a simple local implementation by default, unless overridden by the USE_NATIVE_ALLOCATE_ZEROED define. -2) For AcpiExec (and for debugging), the macros can optionally be resolved +2) For AcpiExec (and for debugging), the macros can optionally be +resolved to the local ACPICA interfaces that track each allocation (local tracking is used to immediately detect memory leaks). Lv Zheng. @@ -73,7 +154,8 @@ has a much larger code and data size. 2) iASL Compiler/Disassembler and Tools: iASL: Implemented wildcard support for the -e option. This simplifies use -when there are many SSDTs that must be included to resolve external method +when there are many SSDTs that must be included to resolve external +method declarations. ACPICA BZ 1041. Example: iasl -e ssdt*.dat -d dsdt.dat @@ -81,7 +163,8 @@ AcpiExec: Add history/line-editing for Unix/Linux systems. This change adds a portable module that implements full history and limited line editing for Unix and Linux systems. It does not use readline() due to portability issues. Instead it uses the POSIX termio interface to put the -terminal in raw input mode so that the various special keys can be trapped +terminal in raw input mode so that the various special keys can be +trapped (such as up/down-arrow for history support and left/right-arrow for line editing). Uses the existing debugger history mechanism. ACPICA BZ 1036. diff --git a/generate/unix/Makefile.config b/generate/unix/Makefile.config index dc9fcae..3a52735 100644 --- a/generate/unix/Makefile.config +++ b/generate/unix/Makefile.config @@ -118,15 +118,17 @@ ACPICA_HEADERS = \ # # Common compiler flags +# The _GNU_SOURCE symbol is required for many hosts. # -# Flags/option notes: -# Global optimization flags (such as -O2, -Os) are not used, -# since they cause issues on some compilers (such as gcc 4.4) -# The _GNU_SOURCE symbol is required for many hosts. +OPT_CFLAGS ?= $(CWARNINGFLAGS) + +# +# Optionally disable optimizations. Optimization causes problems on +# some compilers such as gcc 4.4 # -OPT_CFLAGS ?= \ - -D_FORTIFY_SOURCE=2\ - $(CWARNINGFLAGS) +ifneq ($(NOOPT),TRUE) +OPT_CFLAGS += -O2 -D_FORTIFY_SOURCE=2 +endif CFLAGS += \ -D$(HOST)\ diff --git a/generate/unix/acpiexec/Makefile b/generate/unix/acpiexec/Makefile index 278287b..1625978 100644 --- a/generate/unix/acpiexec/Makefile +++ b/generate/unix/acpiexec/Makefile @@ -224,6 +224,11 @@ CFLAGS += \ -DACPI_EXEC_APP\ -I$(ACPIEXEC) +ifeq ($(ASLTS),TRUE) +CFLAGS += \ + -DACPI_CHECKSUM_ABORT=TRUE +endif + LDFLAGS += -lpthread ifneq ($(HOST),_APPLE) diff --git a/source/common/adfile.c b/source/common/adfile.c index 48ff89f..dd5abee 100644 --- a/source/common/adfile.c +++ b/source/common/adfile.c @@ -329,6 +329,7 @@ FlSplitInputPathname ( if (!Filename) { + ACPI_FREE (DirectoryPath); return (AE_NO_MEMORY); } @@ -337,6 +338,9 @@ FlSplitInputPathname ( if (OutFilename) { *OutFilename = Filename; + return (AE_OK); } + + ACPI_FREE (Filename); return (AE_OK); } diff --git a/source/common/adwalk.c b/source/common/adwalk.c index 2fb42fd..5b04859 100644 --- a/source/common/adwalk.c +++ b/source/common/adwalk.c @@ -820,17 +820,18 @@ AcpiDmXrefDescendingOp ( { if (Status == AE_NOT_FOUND) { - AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType, 0); - /* - * We could install this into the namespace, but we catch duplicate - * externals when they are added to the list. + * Add this symbol as an external declaration, except if the + * parent is a CondRefOf operator. For this operator, we do not + * need an external, nor do we want one, since this can cause + * disassembly problems if the symbol is actually a control + * method. */ -#if 0 - Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY, - ACPI_IMODE_LOAD_PASS1, ACPI_NS_DONT_OPEN_SCOPE, - WalkState, &Node); -#endif + if (!(Op->Asl.Parent && + (Op->Asl.Parent->Asl.AmlOpcode == AML_COND_REF_OF_OP))) + { + AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType, 0); + } } } diff --git a/source/components/debugger/dbcmds.c b/source/components/debugger/dbcmds.c index be35763..7a41715 100644 --- a/source/components/debugger/dbcmds.c +++ b/source/components/debugger/dbcmds.c @@ -830,7 +830,7 @@ AcpiDmTestResourceConversion ( /* Convert internal resource list to external AML resource template */ - Status = AcpiRsCreateAmlResources (ResourceBuffer.Pointer, &NewAml); + Status = AcpiRsCreateAmlResources (&ResourceBuffer, &NewAml); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("AcpiRsCreateAmlResources failed: %s\n", @@ -842,8 +842,8 @@ AcpiDmTestResourceConversion ( OriginalAml = ReturnBuffer.Pointer; - AcpiDmCompareAmlResources ( - OriginalAml->Buffer.Pointer, (ACPI_RSDESC_SIZE) OriginalAml->Buffer.Length, + AcpiDmCompareAmlResources (OriginalAml->Buffer.Pointer, + (ACPI_RSDESC_SIZE) OriginalAml->Buffer.Length, NewAml.Pointer, (ACPI_RSDESC_SIZE) NewAml.Length); /* Cleanup and exit */ @@ -1042,7 +1042,7 @@ GetCrs: } EndCrs: - ACPI_FREE_BUFFER (ReturnBuffer); + ACPI_FREE (ReturnBuffer.Pointer); } diff --git a/source/components/namespace/nsalloc.c b/source/components/namespace/nsalloc.c index 09b42f5..38ce8fc 100644 --- a/source/components/namespace/nsalloc.c +++ b/source/components/namespace/nsalloc.c @@ -121,6 +121,7 @@ AcpiNsDeleteNode ( ACPI_NAMESPACE_NODE *Node) { ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_OPERAND_OBJECT *NextDesc; ACPI_FUNCTION_NAME (NsDeleteNode); @@ -131,12 +132,13 @@ AcpiNsDeleteNode ( AcpiNsDetachObject (Node); /* - * Delete an attached data object if present (an object that was created - * and attached via AcpiAttachData). Note: After any normal object is - * detached above, the only possible remaining object is a data object. + * Delete an attached data object list if present (objects that were + * attached via AcpiAttachData). Note: After any normal object is + * detached above, the only possible remaining object(s) are data + * objects, in a linked list. */ ObjDesc = Node->Object; - if (ObjDesc && + while (ObjDesc && (ObjDesc->Common.Type == ACPI_TYPE_LOCAL_DATA)) { /* Invoke the attached data deletion handler if present */ @@ -146,7 +148,16 @@ AcpiNsDeleteNode ( ObjDesc->Data.Handler (Node, ObjDesc->Data.Pointer); } + NextDesc = ObjDesc->Common.NextObject; AcpiUtRemoveReference (ObjDesc); + ObjDesc = NextDesc; + } + + /* Special case for the statically allocated root node */ + + if (Node == AcpiGbl_RootNode) + { + return; } /* Now we can delete the node */ diff --git a/source/components/namespace/nsutils.c b/source/components/namespace/nsutils.c index f2cf74f..ccecd6d 100644 --- a/source/components/namespace/nsutils.c +++ b/source/components/namespace/nsutils.c @@ -693,27 +693,29 @@ void AcpiNsTerminate ( void) { - ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_STATUS Status; ACPI_FUNCTION_TRACE (NsTerminate); /* - * 1) Free the entire namespace -- all nodes and objects - * - * Delete all object descriptors attached to namepsace nodes + * Free the entire namespace -- all nodes and all objects + * attached to the nodes */ AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode); - /* Detach any objects attached to the root */ + /* Delete any objects attached to the root node */ - ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode); - if (ObjDesc) + Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (Status)) { - AcpiNsDetachObject (AcpiGbl_RootNode); + return_VOID; } + AcpiNsDeleteNode (AcpiGbl_RootNode); + (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Namespace freed\n")); return_VOID; } diff --git a/source/components/resources/rscalc.c b/source/components/resources/rscalc.c index a6e8b38..a5a8e5a 100644 --- a/source/components/resources/rscalc.c +++ b/source/components/resources/rscalc.c @@ -197,6 +197,7 @@ AcpiRsStreamOptionLength ( * FUNCTION: AcpiRsGetAmlLength * * PARAMETERS: Resource - Pointer to the resource linked list + * ResourceListSize - Size of the resource linked list * SizeNeeded - Where the required size is returned * * RETURN: Status @@ -210,9 +211,11 @@ AcpiRsStreamOptionLength ( ACPI_STATUS AcpiRsGetAmlLength ( ACPI_RESOURCE *Resource, + ACPI_SIZE ResourceListSize, ACPI_SIZE *SizeNeeded) { ACPI_SIZE AmlSizeNeeded = 0; + ACPI_RESOURCE *ResourceEnd; ACPI_RS_LENGTH TotalSize; @@ -221,7 +224,8 @@ AcpiRsGetAmlLength ( /* Traverse entire list of internal resource descriptors */ - while (Resource) + ResourceEnd = ACPI_ADD_PTR (ACPI_RESOURCE, Resource, ResourceListSize); + while (Resource < ResourceEnd) { /* Validate the descriptor type */ diff --git a/source/components/resources/rscreate.c b/source/components/resources/rscreate.c index 209b503..fa6b4aa 100644 --- a/source/components/resources/rscreate.c +++ b/source/components/resources/rscreate.c @@ -435,23 +435,22 @@ AcpiRsCreatePciRoutingTable ( * * FUNCTION: AcpiRsCreateAmlResources * - * PARAMETERS: LinkedListBuffer - Pointer to the resource linked list - * OutputBuffer - Pointer to the user's buffer + * PARAMETERS: ResourceList - Pointer to the resource list buffer + * OutputBuffer - Where the AML buffer is returned * * RETURN: Status AE_OK if okay, else a valid ACPI_STATUS code. * If the OutputBuffer is too small, the error will be * AE_BUFFER_OVERFLOW and OutputBuffer->Length will point * to the size buffer needed. * - * DESCRIPTION: Takes the linked list of device resources and - * creates a bytestream to be used as input for the - * _SRS control method. + * DESCRIPTION: Converts a list of device resources to an AML bytestream + * to be used as input for the _SRS control method. * ******************************************************************************/ ACPI_STATUS AcpiRsCreateAmlResources ( - ACPI_RESOURCE *LinkedListBuffer, + ACPI_BUFFER *ResourceList, ACPI_BUFFER *OutputBuffer) { ACPI_STATUS Status; @@ -461,17 +460,15 @@ AcpiRsCreateAmlResources ( ACPI_FUNCTION_TRACE (RsCreateAmlResources); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "LinkedListBuffer = %p\n", - LinkedListBuffer)); + /* Params already validated, no need to re-validate here */ - /* - * Params already validated, so we don't re-validate here - * - * Pass the LinkedListBuffer into a module that calculates - * the buffer size needed for the byte stream. - */ - Status = AcpiRsGetAmlLength (LinkedListBuffer, - &AmlSizeNeeded); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ResourceList Buffer = %p\n", + ResourceList->Pointer)); + + /* Get the buffer size needed for the AML byte stream */ + + Status = AcpiRsGetAmlLength (ResourceList->Pointer, + ResourceList->Length, &AmlSizeNeeded); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n", (UINT32) AmlSizeNeeded, AcpiFormatException (Status))); @@ -490,14 +487,14 @@ AcpiRsCreateAmlResources ( /* Do the conversion */ - Status = AcpiRsConvertResourcesToAml (LinkedListBuffer, AmlSizeNeeded, - OutputBuffer->Pointer); + Status = AcpiRsConvertResourcesToAml (ResourceList->Pointer, + AmlSizeNeeded, OutputBuffer->Pointer); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "OutputBuffer %p Length %X\n", - OutputBuffer->Pointer, (UINT32) OutputBuffer->Length)); + OutputBuffer->Pointer, (UINT32) OutputBuffer->Length)); return_ACPI_STATUS (AE_OK); } diff --git a/source/components/resources/rsutils.c b/source/components/resources/rsutils.c index 04591d9..eb0d93c 100644 --- a/source/components/resources/rsutils.c +++ b/source/components/resources/rsutils.c @@ -827,7 +827,7 @@ AcpiRsSetSrsMethodData ( * Convert the linked list into a byte stream */ Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiRsCreateAmlResources (InBuffer->Pointer, &Buffer); + Status = AcpiRsCreateAmlResources (InBuffer, &Buffer); if (ACPI_FAILURE (Status)) { goto Cleanup; diff --git a/source/components/utilities/utdebug.c b/source/components/utilities/utdebug.c index ab16236..87dbf53 100644 --- a/source/components/utilities/utdebug.c +++ b/source/components/utilities/utdebug.c @@ -211,6 +211,7 @@ AcpiDebugPrint ( } AcpiGbl_PrevThreadId = ThreadId; + AcpiGbl_NestingLevel = 0; } /* @@ -219,13 +220,22 @@ AcpiDebugPrint ( */ AcpiOsPrintf ("%9s-%04ld ", ModuleName, LineNumber); +#ifdef ACPI_EXEC_APP + /* + * For AcpiExec only, emit the thread ID and nesting level. + * Note: nesting level is really only useful during a single-thread + * execution. Otherwise, multiple threads will keep resetting the + * level. + */ if (ACPI_LV_THREADS & AcpiDbgLevel) { AcpiOsPrintf ("[%u] ", (UINT32) ThreadId); } - AcpiOsPrintf ("[%02ld] %-22.22s: ", - AcpiGbl_NestingLevel, AcpiUtTrimFunctionName (FunctionName)); + AcpiOsPrintf ("[%02ld] ", AcpiGbl_NestingLevel); +#endif + + AcpiOsPrintf ("%-22.22s: ", AcpiUtTrimFunctionName (FunctionName)); va_start (args, Format); AcpiOsVprintf (Format, args); @@ -475,7 +485,10 @@ AcpiUtExit ( "%s\n", AcpiGbl_FnExitStr); } - AcpiGbl_NestingLevel--; + if (AcpiGbl_NestingLevel) + { + AcpiGbl_NestingLevel--; + } } ACPI_EXPORT_SYMBOL (AcpiUtExit) @@ -527,7 +540,10 @@ AcpiUtStatusExit ( } } - AcpiGbl_NestingLevel--; + if (AcpiGbl_NestingLevel) + { + AcpiGbl_NestingLevel--; + } } ACPI_EXPORT_SYMBOL (AcpiUtStatusExit) @@ -569,7 +585,10 @@ AcpiUtValueExit ( ACPI_FORMAT_UINT64 (Value)); } - AcpiGbl_NestingLevel--; + if (AcpiGbl_NestingLevel) + { + AcpiGbl_NestingLevel--; + } } ACPI_EXPORT_SYMBOL (AcpiUtValueExit) @@ -610,7 +629,10 @@ AcpiUtPtrExit ( "%s %p\n", AcpiGbl_FnExitStr, Ptr); } - AcpiGbl_NestingLevel--; + if (AcpiGbl_NestingLevel) + { + AcpiGbl_NestingLevel--; + } } #endif diff --git a/source/components/utilities/utxface.c b/source/components/utilities/utxface.c index 3087d67..a093ec6 100644 --- a/source/components/utilities/utxface.c +++ b/source/components/utilities/utxface.c @@ -43,6 +43,7 @@ #define __UTXFACE_C__ +#define EXPORT_ACPI_INTERFACES #include "acpi.h" #include "accommon.h" diff --git a/source/components/utilities/utxfinit.c b/source/components/utilities/utxfinit.c index a9d9251..b395c15 100644 --- a/source/components/utilities/utxfinit.c +++ b/source/components/utilities/utxfinit.c @@ -43,6 +43,7 @@ #define __UTXFINIT_C__ +#define EXPORT_ACPI_INTERFACES #include "acpi.h" #include "accommon.h" diff --git a/source/include/acconfig.h b/source/include/acconfig.h index 48f220b..4846445 100644 --- a/source/include/acconfig.h +++ b/source/include/acconfig.h @@ -84,7 +84,9 @@ * Should the subsystem abort the loading of an ACPI table if the * table checksum is incorrect? */ +#ifndef ACPI_CHECKSUM_ABORT #define ACPI_CHECKSUM_ABORT FALSE +#endif /* * Generate a version of ACPICA that only supports "reduced hardware" diff --git a/source/include/acpixf.h b/source/include/acpixf.h index cba3e56..15273ad 100644 --- a/source/include/acpixf.h +++ b/source/include/acpixf.h @@ -47,7 +47,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20130927 +#define ACPI_CA_VERSION 0x20131115 #include "acconfig.h" #include "actypes.h" diff --git a/source/include/acresrc.h b/source/include/acresrc.h index dbe90df..98f650b 100644 --- a/source/include/acresrc.h +++ b/source/include/acresrc.h @@ -197,7 +197,7 @@ AcpiRsCreateResourceList ( ACPI_STATUS AcpiRsCreateAmlResources ( - ACPI_RESOURCE *LinkedListBuffer, + ACPI_BUFFER *ResourceList, ACPI_BUFFER *OutputBuffer); ACPI_STATUS @@ -251,7 +251,8 @@ AcpiRsGetListLength ( ACPI_STATUS AcpiRsGetAmlLength ( - ACPI_RESOURCE *LinkedListBuffer, + ACPI_RESOURCE *ResourceList, + ACPI_SIZE ResourceListSize, ACPI_SIZE *SizeNeeded); ACPI_STATUS diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h index b6a7e17..f56aff1 100644 --- a/source/include/platform/aclinux.h +++ b/source/include/platform/aclinux.h @@ -58,11 +58,13 @@ #include #include #include -#include -#include +#include #include #include -#include +#ifdef EXPORT_ACPI_INTERFACES +#include +#endif +#include /* Host-dependent types and defines for in-kernel ACPICA */ @@ -85,7 +87,7 @@ /* Host-dependent types and defines for user-space ACPICA */ #define ACPI_FLUSH_CPU_CACHE() -#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (pthread)) +#define ACPI_CAST_PTHREAD_T(Pthread) ((ACPI_THREAD_ID) (Pthread)) #if defined(__ia64__) || defined(__x86_64__) || defined(__aarch64__) #define ACPI_MACHINE_WIDTH 64 @@ -110,24 +112,31 @@ #ifdef __KERNEL__ + +/* + * FIXME: Inclusion of actypes.h + * Linux kernel need this before defining inline OSL interfaces as + * actypes.h need to be included to find ACPICA type definitions. + * Since from ACPICA's perspective, the actypes.h should be included after + * acenv.h (aclinux.h), this leads to a inclusion mis-ordering issue. + */ #include +/* + * Overrides for in-kernel ACPICA + */ ACPI_STATUS __init AcpiOsInitialize ( void); -#define ACPI_USE_NATIVE_DECLARED_AcpiOsInitialize +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInitialize -ACPI_STATUS __exit AcpiOsTerminate ( +ACPI_STATUS AcpiOsTerminate ( void); -#define ACPI_USE_NATIVE_DECLARED_AcpiOsTerminate +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTerminate /* * Memory allocation/deallocation */ -/* Use native linux version of acpi_os_allocate_zeroed */ - -#define USE_NATIVE_ALLOCATE_ZEROED - /* * The irqs_disabled() check is for resume from RAM. * Interrupts are off during resume, just like they are for boot. @@ -140,7 +149,9 @@ AcpiOsAllocate ( { return kmalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL); } -#define ACPI_USE_NATIVE_DECLARED_AcpiOsAllocate +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocate + +/* Use native linux version of AcpiOsAllocateZeroed */ static inline void * AcpiOsAllocateZeroed ( @@ -148,7 +159,8 @@ AcpiOsAllocateZeroed ( { return kzalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL); } -#define ACPI_USE_NATIVE_DECLARED_AcpiOsAllocateZeroed +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocateZeroed +#define USE_NATIVE_ALLOCATE_ZEROED static inline void AcpiOsFree ( @@ -156,7 +168,7 @@ AcpiOsFree ( { kfree (Memory); } -#define ACPI_USE_NATIVE_DECLARED_AcpiOsFree +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsFree static inline void * AcpiOsAcquireObject ( @@ -165,20 +177,18 @@ AcpiOsAcquireObject ( return kmem_cache_zalloc (Cache, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL); } -#define ACPI_USE_NATIVE_DECLARED_AcpiOsAcquireObject +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireObject -/* - * Overrides for in-kernel ACPICA - */ static inline ACPI_THREAD_ID AcpiOsGetThreadId ( void) { return (ACPI_THREAD_ID) (unsigned long) current; } -#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetThreadId +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetThreadId #ifndef CONFIG_PREEMPT + /* * Used within ACPICA to show where it is safe to preempt execution * when CONFIG_PREEMPT=n @@ -188,6 +198,7 @@ AcpiOsGetThreadId ( if (!irqs_disabled()) \ cond_resched(); \ } while (0) + #endif /* @@ -198,47 +209,66 @@ AcpiOsGetThreadId ( * prevents lockdep from reporting false positives for ACPICA locks. */ #define AcpiOsCreateLock(__Handle) \ -({ \ - spinlock_t *Lock = ACPI_ALLOCATE(sizeof(*Lock)); \ - if (Lock) { \ - *(__Handle) = Lock; \ - spin_lock_init(*(__Handle)); \ - } \ - Lock ? AE_OK : AE_NO_MEMORY; \ -}) -#define ACPI_USE_NATIVE_DECLARED_AcpiOsCreateLock + ({ \ + spinlock_t *Lock = ACPI_ALLOCATE(sizeof(*Lock)); \ + if (Lock) { \ + *(__Handle) = Lock; \ + spin_lock_init(*(__Handle)); \ + } \ + Lock ? AE_OK : AE_NO_MEMORY; \ + }) +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateLock void __iomem * AcpiOsMapMemory ( ACPI_PHYSICAL_ADDRESS Where, ACPI_SIZE Length); -#define ACPI_USE_NATIVE_DECLARED_AcpiOsMapMemory +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsMapMemory void AcpiOsUnmapMemory ( void __iomem *LogicalAddress, ACPI_SIZE Size); -#define ACPI_USE_NATIVE_DECLARED_AcpiOsUnmapMemory +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsUnmapMemory + +/* + * OSL interfaces used by debugger/disassembler + */ +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadable +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritable + +/* + * OSL interfaces used by utilities + */ +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetLine +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenDirectory +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetNextFilename +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseDirectory -/* OSL interfaces used by debugger/disassembler */ -#define ACPI_USE_NATIVE_DECLARED_AcpiOsReadable -#define ACPI_USE_NATIVE_DECLARED_AcpiOsWritable +/* + * OSL interfaces added by Linux + */ +void +EarlyAcpiOsUnmapMemory ( + void __iomem *Virt, + ACPI_SIZE Size); -/* OSL interfaces used by utilities */ -#define ACPI_USE_NATIVE_DECLARED_AcpiOsRedirectOutput -#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetLine -#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetTableByName -#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetTableByIndex -#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetTableByAddress -#define ACPI_USE_NATIVE_DECLARED_AcpiOsOpenDirectory -#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetNextFilename -#define ACPI_USE_NATIVE_DECLARED_AcpiOsCloseDirectory +void +AcpiOsGpeCount ( + UINT32 GpeNumber); -/* OSL interfaces added by Linux */ +void +AcpiOsFixedEventCount ( + UINT32 FixedEventNumber); -#ifdef EXPORT_ACPI_INTERFACES -#include -#endif +ACPI_STATUS +AcpiOsHotplugExecute ( + ACPI_OSD_EXEC_CALLBACK Function, + void *Context); #endif /* __KERNEL__ */ diff --git a/source/os_specific/service_layers/osunixxf.c b/source/os_specific/service_layers/osunixxf.c index fee51a6..74c4c24 100644 --- a/source/os_specific/service_layers/osunixxf.c +++ b/source/os_specific/service_layers/osunixxf.c @@ -91,7 +91,7 @@ typedef void* (*PTHREAD_CALLBACK) (void *); /* Terminal support for AcpiExec only */ #ifdef ACPI_EXEC_APP -#include +#include struct termios OriginalTermAttributes; diff --git a/source/tools/acpiexec/aehandlers.c b/source/tools/acpiexec/aehandlers.c index aad2705..2447414 100644 --- a/source/tools/acpiexec/aehandlers.c +++ b/source/tools/acpiexec/aehandlers.c @@ -98,6 +98,11 @@ AeAttachedDataHandler ( ACPI_HANDLE Object, void *Data); +static void +AeAttachedDataHandler2 ( + ACPI_HANDLE Object, + void *Data); + static UINT32 AeInterfaceHandler ( ACPI_STRING InterfaceName, @@ -605,7 +610,29 @@ AeAttachedDataHandler ( ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Data); - AcpiOsPrintf ("Received an attached data deletion on %4.4s\n", + AcpiOsPrintf ("Received an attached data deletion (1) on %4.4s\n", + Node->Name.Ascii); +} + + +/****************************************************************************** + * + * FUNCTION: AeAttachedDataHandler2 + * + * DESCRIPTION: Handler for deletion of nodes with attached data (attached via + * AcpiAttachData) + * + *****************************************************************************/ + +static void +AeAttachedDataHandler2 ( + ACPI_HANDLE Object, + void *Data) +{ + ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Data); + + + AcpiOsPrintf ("Received an attached data deletion (2) on %4.4s\n", Node->Name.Ascii); } @@ -1022,8 +1049,23 @@ AeInstallEarlyHandlers ( Status = AcpiDetachData (Handle, AeAttachedDataHandler); AE_CHECK_OK (AcpiDetachData, Status); + /* Test attach data at the root object */ + + Status = AcpiAttachData (ACPI_ROOT_OBJECT, AeAttachedDataHandler, + AcpiGbl_RootNode); + AE_CHECK_OK (AcpiAttachData, Status); + + Status = AcpiAttachData (ACPI_ROOT_OBJECT, AeAttachedDataHandler2, + AcpiGbl_RootNode); + AE_CHECK_OK (AcpiAttachData, Status); + + /* Test support for multiple attaches */ + Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle); AE_CHECK_OK (AcpiAttachData, Status); + + Status = AcpiAttachData (Handle, AeAttachedDataHandler2, Handle); + AE_CHECK_OK (AcpiAttachData, Status); } else { diff --git a/tests/aslts.sh b/tests/aslts.sh index bf6be0b..33a2c99 100755 --- a/tests/aslts.sh +++ b/tests/aslts.sh @@ -2,14 +2,36 @@ # # aslts - execute ASL test suite # -# optional parameters: -# # Will build temporary versions of iASL and acpiexec postfix=`date +%H%M%S` tmp_iasl=/tmp/iasl-$postfix tmp_acpiexec=/tmp/acpiexec-$postfix +TEST_CASES= +TEST_MODES= +REBUILD_TOOLS=yes + +usage() { + + echo "Usage:" + echo "`basename $0` [-c case] [-m mode] [-u]" + echo "Where:" + echo " -c: Specify individual test cases (can be used multiple times)" + echo " -m: Specify individual test modes (can be used multiple times)" + echo " -u: Do not force rebuilding of ACPICA utilities (acpiexec, iasl)" + echo "" + + echo "Available test modes:" + echo " n32 32-bit normal mode" + echo " n64 64-bit normal mode" + echo " s32 32-bit slack mode" + echo " s64 64-bit slack mode" + echo "" + + Do 3 + exit 1 +} # Setup environment and variables. # Need a path to ASLTS and iasl,acpiexec generation dir @@ -52,9 +74,14 @@ build_acpi_tools() { rm -f $tmp_iasl $tmp_acpiexec # Build native-width iASL compiler and acpiexec - make clean - make iasl - make acpiexec + if [ ! -e bin/iasl -o ! -e bin/acpiexec ]; then + REBUILD_TOOLS=yes + fi + if [ "x$REBUILD_TOOLS" = "xyes" ]; then + make clean + make iasl ASLTS=TRUE + make acpiexec ASLTS=TRUE + fi if [ -d "bin" ] && [ -f "bin/iasl" ]; then echo "Installing ACPICA tools" @@ -85,14 +112,23 @@ run_aslts() { version=`$ASL | grep version | awk '{print $5}'` rm -rf $ASLTSDIR/tmp/aml/$version - # Compile all ASL test modules - Do 0 aslts + if [ "x$TEST_CASES" = "x" ]; then + # Compile all ASL test modules + Do 0 aslts + else + Do 0 $TEST_CASES + fi # Execute the test suite echo "" echo "ASL Test Suite Started: `date`" start_time=$(date) - Do 1 + + if [ "x$TEST_MODES" = "x" ]; then + TEST_MODES="n32 n64 s32 s64" + fi + Do 1 $TEST_MODES $TEST_CASES + echo "" echo "ASL Test Suite Finished: `date`" echo " Started: $start_time" @@ -100,16 +136,47 @@ run_aslts() { rm -f $tmp_iasl $tmp_acpiexec } -NPARAM=$# - -# Main - arguments are optional - -if [ $NPARAM -eq 2 ]; then - setup_environment $1 $2 -else - setup_environment aslts ../generate/unix -fi - +SRCDIR=`(cd \`dirname $0\`; cd ..; pwd)` +setup_environment $SRCDIR/tests/aslts $SRCDIR/generate/unix + +# To use common utilities +. $SRCDIR/tests/aslts/bin/common +. $SRCDIR/tests/aslts/bin/settings +RESET_SETTINGS +INIT_ALL_AVAILABLE_CASES +INIT_ALL_AVAILABLE_MODES + +while getopts "c:m:u" opt +do + case $opt in + c) + get_collection_opcode "$OPTARG" + if [ $? -eq $COLLS_NUM ]; then + echo "Invalid test case: $OPTARG" + usage + else + TEST_CASES="$OPTARG $TEST_CASES" + fi + ;; + m) + check_mode_id "$OPTARG" + if [ $? -eq 1 ]; then + echo "Invalid test mode: $OPTARG" + usage + else + TEST_MODES="$OPTARG $TEST_MODES" + fi + ;; + u) + REBUILD_TOOLS=no + ;; + ?) + echo "Invalid argument: $opt" + usage + ;; + esac +done +shift $(($OPTIND - 1)) build_acpi_tools run_aslts diff --git a/tests/aslts/Makefile.def b/tests/aslts/Makefile.def index 63cdd0b..00dd9fd 100644 --- a/tests/aslts/Makefile.def +++ b/tests/aslts/Makefile.def @@ -45,7 +45,7 @@ empty_all: FORCE # aslversion is determined dynamically. ${SETOF_AMLDIRS:%=$(TOP)/tmp/aml/$(aslversion)/%}: - $(INST.dir) + @$(INST.dir) # Make-install one particular Test Case for all modes diff --git a/tests/aslts/bin/Do b/tests/aslts/bin/Do index 87d9df6..6a3cc22 100755 --- a/tests/aslts/bin/Do +++ b/tests/aslts/bin/Do @@ -309,7 +309,7 @@ make_install_1() cd "$dir" echo "Running make install from $dir" - make install + make install > /dev/null cd "$restore_dir" } @@ -338,7 +338,7 @@ do_test_cases_make_install() if [ $3 != 0 ]; then cd "$dir" - make install + make install > /dev/null if [ $? -ne 0 ]; then errors=1 fi @@ -389,7 +389,7 @@ do_collections_make_install() if [ $3 != 0 ]; then cd "$dir" - make install + make install > /dev/null if [ $? -ne 0 ]; then errors=1 fi @@ -575,7 +575,8 @@ PATH=$PATH:$BUG_STATE_DIR # Init available tests RESET_SETTINGS -INIT_ALL_AVAILABLE_TESTS +INIT_ALL_AVAILABLE_CASES +INIT_ALL_AVAILABLE_MODES # Only report available test cases @@ -599,16 +600,29 @@ if [ $CMD == $ASLCOMPILE ]; then elif [ $CMD == $RUNTESTS ]; then - if [ $NPARAM != 1 ]; then - bad_param_number $CMD $NPARAM 1 - fi - # Check access to AcpiExec utility if [ ! -f "$acpiexec" ]; then do_exit 1 "Undefined acpiexec variable! Set it to pathname of AcpiExec utility." fi + shift 1 + ASLTSRUN_PARAMS= + + ENABLED_TMODES= + while : + do + check_mode_id $1 + if [ $? -eq 1 ]; then + break + fi + ENABLED_TMODES="$1 $ENABLED_TMODES" + shift 1 + done + export ENABLED_TMODES + + export ENABLED_TCASES="$@" + asltsrun elif [ $CMD == $DIFFRESULTS ]; then diff --git a/tests/aslts/bin/asltsrun b/tests/aslts/bin/asltsrun index 5e397ce..e0b8d46 100755 --- a/tests/aslts/bin/asltsrun +++ b/tests/aslts/bin/asltsrun @@ -190,6 +190,13 @@ run_test_case() commandline=ex fi + echo "" + echo "acpiexec options to reproduce:" + echo " $options -b\"$commandline,$method\"" + echo "ASLTS aml tables to reproduce:" + echo " $amlcodepath" + echo "" + "$acpiexec" $options -b"$commandline,$method" "$amlcodepath" TEST_RET=$? fi @@ -833,9 +840,10 @@ NUM_DISABLED_BRANCHES= # - init log out results of runs RESET_SETTINGS -INIT_ALL_AVAILABLE_TESTS +INIT_ALL_AVAILABLE_CASES +INIT_ALL_AVAILABLE_MODES INIT_SET_OF_TEST_CASES -INIT_RUN_MODES +INIT_SET_OF_TEST_MODES INIT_LOG_RESULTS INIT_MEM_STAT @@ -875,6 +883,7 @@ if [ $ENABLELOG != 0 ]; then MULTIPATH="$ASLTSDIR/tmp/RESULTS/$MULTINAME" check_dir "$MULTIPATH" + echo "Generating ASLTS log into directory $MULTIPATH" COMMONLOGFILE="$MULTIPATH/Summary" echo "# Trace and summary of $MULTINAME bunch of test runs." > "$COMMONLOGFILE" diff --git a/tests/aslts/bin/common b/tests/aslts/bin/common index a8c39f7..a67aa43 100755 --- a/tests/aslts/bin/common +++ b/tests/aslts/bin/common @@ -161,6 +161,18 @@ get_mode_id() echo "$BITMODE:$SLMODE" } +# check if mode id is valid +check_mode_id() { + local m + + for m in $ALL_AVAILABLE_TEST_MODES; do + if [ "x$m" = "x$1" ]; then + return 0 + fi + done + return 1 +} + # Echo the name of collection # arg1 - opcode of collection get_collection_name() @@ -596,8 +608,8 @@ convert_string_to_centisecond_units() return 3 fi - sec0=$[ (1$s0 - 100) + (1$m0 - 100) * 60 + (1$h0 - 100) * 3600 ] - total0=$[ (1$csec0 - 100) + $sec0 * 100 ] + sec0=$[ $s0 + $m0 * 60 + $h0 * 3600 ] + total0=$[ $csec0 + $sec0 * 100 ] echo "$total0" diff --git a/tests/aslts/bin/diffproc b/tests/aslts/bin/diffproc index 96b8621..6c550ac 100755 --- a/tests/aslts/bin/diffproc +++ b/tests/aslts/bin/diffproc @@ -74,12 +74,12 @@ report_run_time_cmp() if [ $ret -eq 2 ] ; then # 2 means arg1 is greater than arg2 - percent=$[ ($diff01 * 100) / $t1 ] + percent=$[ ($diff01 * 10000) / ($t1 * 100 + 1) ] echo "WARNING, TOTAL, time of tests run grown from $2 to $1, (+$diff01str, $percent% of $2)" rval=2 elif [ $ret -eq 1 ] ; then # 1 means arg1 is less than arg2 - percent=$[ ($diff01 * 100) / $t0 ] + percent=$[ ($diff01 * 10000) / ($t0 * 100 + 1) ] echo "INFO, TOTAL, time of tests run reduced from "$2" to "$1", (-$diff01str, $percent% of $2)" rval=1 fi diff --git a/tests/aslts/bin/settings b/tests/aslts/bin/settings index d1bafa8..899591c 100755 --- a/tests/aslts/bin/settings +++ b/tests/aslts/bin/settings @@ -7,7 +7,7 @@ # Initialize all the AVAILABLE test cases # and collections (all which are). # -INIT_ALL_AVAILABLE_TESTS() +INIT_ALL_AVAILABLE_CASES() { # Functional test collection @@ -58,6 +58,16 @@ INIT_ALL_AVAILABLE_TESTS() } # +# Initialize all the AVAILABLE test modes +# +INIT_ALL_AVAILABLE_MODES() +{ + # All test modes + + ALL_AVAILABLE_TEST_MODES="n32 n64 s32 s64" +} + +# # Report all the available test cases # echo_available_test_cases() @@ -139,63 +149,88 @@ INIT_SET_OF_TEST_CASES() # The test cases to be processed by run and compare utilities: -# ENABLED_TCASES="$func $compl $excep $bdemo $serv" -# ENABLED_TCASES="$func $compl $excep $Identity2MS $bdemo $serv" - ENABLED_TCASES="$func $compl $excep $mt $Identity2MS $bdemo $serv" - -# ENABLED_TCASES="extra extra_aslts" -# ENABLED_TCASES="control" -# ENABLED_TCASES="bdemo" -# ENABLED_TCASES="bdemo bdemof" -# ENABLED_TCASES="bdemo misc" -# ENABLED_TCASES="arithmetic constant" -# ENABLED_TCASES="condbranches" -# ENABLED_TCASES="exc" -# ENABLED_TCASES="arithmetic constant exc condbranches" -# ENABLED_TCASES="arithmetic bfield constant control descriptor logic manipulation name reference region synchronization misc provoke exc bdemo" -# ENABLED_TCASES="oarg oconst olocal onamedloc onamedglob opackageel oreftonamed oreftopackageel oreturn" -# ENABLED_TCASES="rstore roptional rcopyobject rindecrement rexplicitconv exc_ref exc_operand2 exc_result2" -# ENABLED_TCASES="condbranches" -# ENABLED_TCASES="arithmetic bfield" -# ENABLED_TCASES="descriptor" -# ENABLED_TCASES="reference" -# ENABLED_TCASES="arithmetic misc logic bdemo" -# ENABLED_TCASES="misc control manipulation" -# ENABLED_TCASES="exc_ref" -# ENABLED_TCASES="rstore" -# ENABLED_TCASES="bdemo reference" -# ENABLED_TCASES="name" -# ENABLED_TCASES="badasl" -# ENABLED_TCASES="constant" -# ENABLED_TCASES="arithmetic constant exc mt_mutex bdemo" -# ENABLED_TCASES="mt_mutex" -# ENABLED_TCASES="region" + if [ "x$ENABLED_TCASES" = "x" ]; then + +# ENABLED_TCASES="$func $compl $excep $bdemo $serv" +# ENABLED_TCASES="$func $compl $excep $Identity2MS $bdemo $serv" + ENABLED_TCASES="$func $compl $excep $mt $Identity2MS $bdemo $serv" + +# ENABLED_TCASES="extra extra_aslts" +# ENABLED_TCASES="control" +# ENABLED_TCASES="bdemo" +# ENABLED_TCASES="bdemo bdemof" +# ENABLED_TCASES="bdemo misc" +# ENABLED_TCASES="arithmetic constant" +# ENABLED_TCASES="condbranches" +# ENABLED_TCASES="exc" +# ENABLED_TCASES="arithmetic constant exc condbranches" +# ENABLED_TCASES="arithmetic bfield constant control descriptor logic manipulation name reference region synchronization misc provoke exc bdemo" +# ENABLED_TCASES="oarg oconst olocal onamedloc onamedglob opackageel oreftonamed oreftopackageel oreturn" +# ENABLED_TCASES="rstore roptional rcopyobject rindecrement rexplicitconv exc_ref exc_operand2 exc_result2" +# ENABLED_TCASES="condbranches" +# ENABLED_TCASES="arithmetic bfield" +# ENABLED_TCASES="descriptor" +# ENABLED_TCASES="reference" +# ENABLED_TCASES="arithmetic misc logic bdemo" +# ENABLED_TCASES="misc control manipulation" +# ENABLED_TCASES="exc_ref" +# ENABLED_TCASES="rstore" +# ENABLED_TCASES="bdemo reference" +# ENABLED_TCASES="name" +# ENABLED_TCASES="badasl" +# ENABLED_TCASES="constant" +# ENABLED_TCASES="arithmetic constant exc mt_mutex bdemo" +# ENABLED_TCASES="mt_mutex" +# ENABLED_TCASES="region" + + fi } # -# Set up a set of test run modes you want +# Set up a list of test modes you want # to be processed by run and compare utilities. -# Do that here manually. # -INIT_RUN_MODES() +INIT_SET_OF_TEST_MODES() { - # The test run modes to be processed: + local m n found + + for m in $ALL_AVAILABLE_TEST_MODES + do + found=0 + for n in $ENABLED_TMODES + do + if [ "x$m" = "x$n" ]; then + found=1 + fi + done + + if [ $found -eq 1 ]; then - # 32-bit non-slack (normal): + # 32-bit non-slack (normal): - ENABLENORM32=1 + if [ "$m" = "n32" ]; then + ENABLENORM32=1 + fi - # 64-bit non-slack (normal): + # 64-bit non-slack (normal): - ENABLENORM64=1 + if [ "$m" = "n64" ]; then + ENABLENORM64=1 + fi - # 32-bit slack: + # 32-bit slack: - ENABLESLACK32=1 + if [ "$m" = "s32" ]; then + ENABLESLACK32=1 + fi - # 64-bit slack: + # 64-bit slack: - ENABLESLACK64=1 + if [ "$m" = "s64" ]; then + ENABLESLACK64=1 + fi + fi + done } # diff --git a/tests/aslts/src/runtime/collections/functional/table/load.asl b/tests/aslts/src/runtime/collections/functional/table/load.asl index 60d75bc..9201e6d 100644 --- a/tests/aslts/src/runtime/collections/functional/table/load.asl +++ b/tests/aslts/src/runtime/collections/functional/table/load.asl @@ -124,7 +124,7 @@ Device(DTM0) { // Originated from ssdt0.asl: iasl -tc ssdt0.asl Name(BUF0, Buffer() { 0x53,0x53,0x44,0x54,0x34,0x00,0x00,0x00, /* 00000000 "SSDT4..." */ - 0x02,0xDE,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 "..Intel." */ + 0x02,0x98,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 "..Intel." */ 0x4D,0x61,0x6E,0x79,0x00,0x00,0x00,0x00, /* 00000010 "Many...." */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x15,0x12,0x06,0x20,0x14,0x0F,0x5C,0x53, /* 00000020 "... ..\S" */ diff --git a/tests/aslts/src/runtime/collections/functional/table/loadtable.asl b/tests/aslts/src/runtime/collections/functional/table/loadtable.asl index 2d2a112..602571c 100644 --- a/tests/aslts/src/runtime/collections/functional/table/loadtable.asl +++ b/tests/aslts/src/runtime/collections/functional/table/loadtable.asl @@ -1790,7 +1790,13 @@ Device(DTM2) { } LoadTable("OEM1", "", Local1, "\\", "\\DTM2.PLDT", 1) if (SLCK) { - CH04(arg0, 0, 61, z176, 0x110, 0, 0) // AE_AML_STRING_LIMIT + // ACPI_OEM_TABLE_ID_SIZE should be less than 8. + // The size of the "Integer" converted from "Any" is ISZ0*2. + if (LLessEqual(ISZ0, 4)) { + CH03(arg0, z176, 0x110, 0, 0) // No exception + } else { + CH04(arg0, 0, 61, z176, 0x110, 0, 0) // AE_AML_STRING_LIMIT + } } else { CH04(arg0, 0, 49, z176, 0x110, 0, 0) // AE_AML_UNINITIALIZED_LOCAL }