Index: dev/acpica/Osd/OsdHardware.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/Osd/OsdHardware.c,v retrieving revision 1.5 diff -u -r1.5 OsdHardware.c --- dev/acpica/Osd/OsdHardware.c 19 Mar 2002 11:01:52 -0000 1.5 +++ dev/acpica/Osd/OsdHardware.c 28 Nov 2002 03:31:28 -0000 @@ -155,3 +155,16 @@ return(AE_OK); } + +/* + * Interim function needed for PCI IRQ routing + */ +void +AcpiOsDerivePciId( + ACPI_HANDLE rhandle, + ACPI_HANDLE chandle, + ACPI_PCI_ID **PciId) +{ + /* XXX TBD */ +} + Index: contrib/dev/acpica/acconfig.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acconfig.h,v retrieving revision 1.23 diff -u -r1.23 acconfig.h --- contrib/dev/acpica/acconfig.h 27 Nov 2002 18:09:20 -0000 1.23 +++ contrib/dev/acpica/acconfig.h 28 Nov 2002 03:28:25 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acconfig.h - Global configuration constants - * $Revision: 118 $ + * $Revision: 119 $ * *****************************************************************************/ @@ -145,7 +145,7 @@ /* Version string */ -#define ACPI_CA_VERSION 0x20021115 +#define ACPI_CA_VERSION 0x20021122 /* Version of ACPI supported */ Index: contrib/dev/acpica/aclocal.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/aclocal.h,v retrieving revision 1.1.1.21 diff -u -r1.1.1.21 aclocal.h --- contrib/dev/acpica/aclocal.h 27 Nov 2002 18:07:47 -0000 1.1.1.21 +++ contrib/dev/acpica/aclocal.h 28 Nov 2002 03:28:25 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: aclocal.h - Internal data types used across the ACPI subsystem - * $Revision: 179 $ + * $Revision: 181 $ * *****************************************************************************/ @@ -392,7 +392,6 @@ typedef struct { - UINT8 AddressSpaceId; ACPI_GENERIC_ADDRESS *BlockAddress; UINT16 RegisterCount; UINT8 BlockBaseNumber; @@ -421,7 +420,7 @@ typedef struct { - ACPI_HANDLE MethodHandle; /* Method handle for direct (fast) execution */ + ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level */ ACPI_GPE_HANDLER Handler; /* Address of handler, if any */ void *Context; /* Context to be passed to handler */ UINT8 Type; /* Level or Edge */ Index: contrib/dev/acpica/acpiosxf.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acpiosxf.h,v retrieving revision 1.12 diff -u -r1.12 acpiosxf.h --- contrib/dev/acpica/acpiosxf.h 27 Nov 2002 18:09:20 -0000 1.12 +++ contrib/dev/acpica/acpiosxf.h 28 Nov 2002 03:28:25 -0000 @@ -338,6 +338,14 @@ ACPI_INTEGER Value, UINT32 Width); +/* + * Interim function needed for PCI IRQ routing + */ +void +AcpiOsDerivePciId( + ACPI_HANDLE rhandle, + ACPI_HANDLE chandle, + ACPI_PCI_ID **PciId); /* * Miscellaneous Index: contrib/dev/acpica/dbdisply.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dbdisply.c,v retrieving revision 1.1.1.19 diff -u -r1.1.1.19 dbdisply.c --- contrib/dev/acpica/dbdisply.c 27 Nov 2002 18:07:47 -0000 1.1.1.19 +++ contrib/dev/acpica/dbdisply.c 28 Nov 2002 03:28:25 -0000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbdisply - debug display commands - * $Revision: 81 $ + * $Revision: 82 $ * ******************************************************************************/ @@ -843,7 +843,7 @@ AcpiOsPrintf ("Method [%4.4s] has %X arguments, max concurrency = %X\n", Node->Name.Ascii, NumArgs, Concurrency); - for (i = 0; i < NumArgs; i++) + for (i = 0; i < MTH_NUM_ARGS; i++) { ObjDesc = WalkState->Arguments[i].Object; AcpiOsPrintf ("Arg%d: ", i); Index: contrib/dev/acpica/dsmthdat.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dsmthdat.c,v retrieving revision 1.1.1.14 diff -u -r1.1.1.14 dsmthdat.c --- contrib/dev/acpica/dsmthdat.c 27 Nov 2002 18:07:47 -0000 1.1.1.14 +++ contrib/dev/acpica/dsmthdat.c 28 Nov 2002 03:28:25 -0000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dsmthdat - control method arguments and local variables - * $Revision: 64 $ + * $Revision: 66 $ * ******************************************************************************/ @@ -120,6 +120,7 @@ #include "acdispat.h" #include "amlcode.h" #include "acnamesp.h" +#include "acinterp.h" #define _COMPONENT ACPI_DISPATCHER @@ -378,6 +379,7 @@ * RETURN: Status * * DESCRIPTION: Insert an object onto the method stack at entry Opcode:Index. + * Note: There is no "implicit conversion" for locals. * ******************************************************************************/ @@ -390,11 +392,17 @@ { ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node; + ACPI_OPERAND_OBJECT *NewDesc = Object; ACPI_FUNCTION_TRACE ("DsMethodDataSetValue"); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "obj %p op %X, ref count = %d [%s]\n", Object, + Opcode, Object->Common.ReferenceCount, + AcpiUtGetTypeName (Object->Common.Type))); + /* Get the namespace node for the arg/local */ Status = AcpiDsMethodDataGetNode (Opcode, Index, WalkState, &Node); @@ -403,14 +411,33 @@ return_ACPI_STATUS (Status); } - /* Increment ref count so object can't be deleted while installed */ + /* + * If the object has just been created and is not attached to anything, + * (the reference count is 1), then we can just store it directly into + * the arg/local. Otherwise, we must copy it. + */ + if (Object->Common.ReferenceCount > 1) + { + Status = AcpiUtCopyIobjectToIobject (Object, &NewDesc, WalkState); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Object Copied %p, new %p\n", + Object, NewDesc)); + } + else + { + /* Increment ref count so object can't be deleted while installed */ - AcpiUtAddReference (Object); + AcpiUtAddReference (NewDesc); + } - /* Install the object into the stack entry */ + /* Install the object */ - Node->Object = Object; - return_ACPI_STATUS (AE_OK); + Node->Object = NewDesc; + return_ACPI_STATUS (Status); } @@ -676,7 +703,8 @@ CurrentObjDesc = AcpiNsGetAttachedObject (Node); if (CurrentObjDesc == ObjDesc) { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p already installed!\n", ObjDesc)); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p already installed!\n", + ObjDesc)); return_ACPI_STATUS (Status); } @@ -729,16 +757,12 @@ "Arg (%p) is an ObjRef(Node), storing in node %p\n", ObjDesc, CurrentObjDesc)); - /* Detach an existing object from the referenced Node */ - - AcpiNsDetachObject (CurrentObjDesc->Reference.Object); - /* - * Store this object into the Node + * Store this object to the Node * (perform the indirect store) */ - Status = AcpiNsAttachObject (CurrentObjDesc->Reference.Object, - ObjDesc, ACPI_GET_OBJECT_TYPE (ObjDesc)); + Status = AcpiExStoreObjectToNode (ObjDesc, + CurrentObjDesc->Reference.Object, WalkState); return_ACPI_STATUS (Status); } } Index: contrib/dev/acpica/evevent.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/evevent.c,v retrieving revision 1.1.1.20 diff -u -r1.1.1.20 evevent.c --- contrib/dev/acpica/evevent.c 27 Nov 2002 18:07:47 -0000 1.1.1.20 +++ contrib/dev/acpica/evevent.c 28 Nov 2002 03:28:25 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evevent - Fixed and General Purpose Even handling and dispatch - * $Revision: 96 $ + * $Revision: 99 $ * *****************************************************************************/ @@ -434,11 +434,8 @@ * FADT table contain zeros. The GPE0_LEN and GPE1_LEN do not need * to be the same size." */ - AcpiGbl_GpeBlockInfo[0].AddressSpaceId = AcpiGbl_FADT->XGpe0Blk.AddressSpaceId; - AcpiGbl_GpeBlockInfo[1].AddressSpaceId = AcpiGbl_FADT->XGpe1Blk.AddressSpaceId; - - AcpiGbl_GpeBlockInfo[0].RegisterCount = (UINT16) ACPI_DIV_16 (AcpiGbl_FADT->XGpe0Blk.RegisterBitWidth); - AcpiGbl_GpeBlockInfo[1].RegisterCount = (UINT16) ACPI_DIV_16 (AcpiGbl_FADT->XGpe1Blk.RegisterBitWidth); + AcpiGbl_GpeBlockInfo[0].RegisterCount = 0; + AcpiGbl_GpeBlockInfo[1].RegisterCount = 0; AcpiGbl_GpeBlockInfo[0].BlockAddress = &AcpiGbl_FADT->XGpe0Blk; AcpiGbl_GpeBlockInfo[1].BlockAddress = &AcpiGbl_FADT->XGpe1Blk; @@ -446,31 +443,27 @@ AcpiGbl_GpeBlockInfo[0].BlockBaseNumber = 0; AcpiGbl_GpeBlockInfo[1].BlockBaseNumber = AcpiGbl_FADT->Gpe1Base; - /* Warn and exit if there are no GPE registers */ - - AcpiGbl_GpeRegisterCount = AcpiGbl_GpeBlockInfo[0].RegisterCount + - AcpiGbl_GpeBlockInfo[1].RegisterCount; - if (!AcpiGbl_GpeRegisterCount) - { - ACPI_REPORT_WARNING (("There are no GPE blocks defined in the FADT\n")); - return_ACPI_STATUS (AE_OK); - } /* * Determine the maximum GPE number for this machine. * Note: both GPE0 and GPE1 are optional, and either can exist without - * the other + * the other. + * If EITHER the register length OR the block address are zero, then that + * particular block is not supported. */ - if (AcpiGbl_GpeBlockInfo[0].RegisterCount) + if (AcpiGbl_FADT->XGpe0Blk.RegisterBitWidth && ACPI_GET_ADDRESS (AcpiGbl_FADT->XGpe0Blk.Address)) { - /* GPE block 0 exists */ + /* GPE block 0 exists (has length and address > 0) */ - AcpiGbl_GpeNumberMax = ACPI_MUL_8 (AcpiGbl_GpeBlockInfo[0].RegisterCount) - 1; + AcpiGbl_GpeBlockInfo[0].RegisterCount = (UINT16) ACPI_DIV_16 (AcpiGbl_FADT->XGpe0Blk.RegisterBitWidth); + AcpiGbl_GpeNumberMax = ACPI_MUL_8 (AcpiGbl_GpeBlockInfo[0].RegisterCount) - 1; } - if (AcpiGbl_GpeBlockInfo[1].RegisterCount) + if (AcpiGbl_FADT->XGpe1Blk.RegisterBitWidth && ACPI_GET_ADDRESS (AcpiGbl_FADT->XGpe1Blk.Address)) { - /* GPE block 1 exists */ + /* GPE block 1 exists (has length and address > 0) */ + + AcpiGbl_GpeBlockInfo[1].RegisterCount = (UINT16) ACPI_DIV_16 (AcpiGbl_FADT->XGpe1Blk.RegisterBitWidth); /* Check for GPE0/GPE1 overlap (if both banks exist) */ @@ -492,6 +485,16 @@ (ACPI_MUL_8 (AcpiGbl_GpeBlockInfo[1].RegisterCount) - 1); } + /* Warn and exit if there are no GPE registers */ + + AcpiGbl_GpeRegisterCount = AcpiGbl_GpeBlockInfo[0].RegisterCount + + AcpiGbl_GpeBlockInfo[1].RegisterCount; + if (!AcpiGbl_GpeRegisterCount) + { + ACPI_REPORT_WARNING (("There are no GPE blocks defined in the FADT\n")); + return_ACPI_STATUS (AE_OK); + } + /* Check for Max GPE number out-of-range */ if (AcpiGbl_GpeNumberMax > ACPI_GPE_MAX) @@ -573,8 +576,8 @@ + i + AcpiGbl_GpeBlockInfo[GpeBlock].RegisterCount)); - GpeRegisterInfo->StatusAddress.AddressSpaceId = AcpiGbl_GpeBlockInfo[GpeBlock].AddressSpaceId; - GpeRegisterInfo->EnableAddress.AddressSpaceId = AcpiGbl_GpeBlockInfo[GpeBlock].AddressSpaceId; + GpeRegisterInfo->StatusAddress.AddressSpaceId = AcpiGbl_GpeBlockInfo[GpeBlock].BlockAddress->AddressSpaceId; + GpeRegisterInfo->EnableAddress.AddressSpaceId = AcpiGbl_GpeBlockInfo[GpeBlock].BlockAddress->AddressSpaceId; GpeRegisterInfo->StatusAddress.RegisterBitWidth = 8; GpeRegisterInfo->EnableAddress.RegisterBitWidth = 8; GpeRegisterInfo->StatusAddress.RegisterBitOffset = 8; @@ -682,7 +685,7 @@ /* Extract the name from the object and convert to a string */ ACPI_MOVE_UNALIGNED32_TO_32 (Name, - &((ACPI_NAMESPACE_NODE *) ObjHandle)->Name.Integer); + &((ACPI_NAMESPACE_NODE *) ObjHandle)->Name.Integer); Name[ACPI_NAME_SIZE] = 0; /* @@ -734,8 +737,8 @@ * Now we can add this information to the GpeInfo block * for use during dispatch of this GPE. */ - AcpiGbl_GpeNumberInfo [GpeNumberIndex].Type = Type; - AcpiGbl_GpeNumberInfo [GpeNumberIndex].MethodHandle = ObjHandle; + AcpiGbl_GpeNumberInfo [GpeNumberIndex].Type = Type; + AcpiGbl_GpeNumberInfo [GpeNumberIndex].MethodNode = (ACPI_NAMESPACE_NODE *) ObjHandle; /* * Enable the GPE (SCIs should be disabled at this point) @@ -746,7 +749,7 @@ return (Status); } - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Registered GPE method %s as GPE number %X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Registered GPE method %s as GPE number %2.2X\n", Name, GpeNumber)); return (AE_OK); } @@ -936,17 +939,18 @@ return_VOID; } - if (GpeInfo.MethodHandle) + if (GpeInfo.MethodNode) { /* * Invoke the GPE Method (_Lxx, _Exx): * (Evaluate the _Lxx/_Exx control method that corresponds to this GPE.) */ - Status = AcpiNsEvaluateByHandle (GpeInfo.MethodHandle, NULL, NULL); + Status = AcpiNsEvaluateByHandle (GpeInfo.MethodNode, NULL, NULL); if (ACPI_FAILURE (Status)) { - ACPI_REPORT_ERROR (("%s while evaluating GPE%X method\n", - AcpiFormatException (Status), GpeNumber)); + ACPI_REPORT_ERROR (("%s while evaluating method [%4.4s] for GPE[%2.2X]\n", + AcpiFormatException (Status), + GpeInfo.MethodNode->Name.Ascii, GpeNumber)); } } @@ -1019,7 +1023,7 @@ Status = AcpiHwClearGpe (GpeNumber); if (ACPI_FAILURE (Status)) { - ACPI_REPORT_ERROR (("AcpiEvGpeDispatch: Unable to clear GPE[%X]\n", GpeNumber)); + ACPI_REPORT_ERROR (("AcpiEvGpeDispatch: Unable to clear GPE[%2.2X]\n", GpeNumber)); return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); } } @@ -1037,7 +1041,7 @@ GpeInfo->Handler (GpeInfo->Context); } - else if (GpeInfo->MethodHandle) + else if (GpeInfo->MethodNode) { /* * Disable GPE, so it doesn't keep firing before the method has a @@ -1046,7 +1050,7 @@ Status = AcpiHwDisableGpe (GpeNumber); if (ACPI_FAILURE (Status)) { - ACPI_REPORT_ERROR (("AcpiEvGpeDispatch: Unable to disable GPE[%X]\n", GpeNumber)); + ACPI_REPORT_ERROR (("AcpiEvGpeDispatch: Unable to disable GPE[%2.2X]\n", GpeNumber)); return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); } @@ -1057,14 +1061,14 @@ AcpiEvAsynchExecuteGpeMethod, ACPI_TO_POINTER (GpeNumber)))) { - ACPI_REPORT_ERROR (("AcpiEvGpeDispatch: Unable to queue handler for GPE[%X], event is disabled\n", GpeNumber)); + ACPI_REPORT_ERROR (("AcpiEvGpeDispatch: Unable to queue handler for GPE[%2.2X], event is disabled\n", GpeNumber)); } } else { /* No handler or method to run! */ - ACPI_REPORT_ERROR (("AcpiEvGpeDispatch: No handler or method for GPE[%X], disabling event\n", GpeNumber)); + ACPI_REPORT_ERROR (("AcpiEvGpeDispatch: No handler or method for GPE[%2.2X], disabling event\n", GpeNumber)); /* * Disable the GPE. The GPE will remain disabled until the ACPI @@ -1073,7 +1077,7 @@ Status = AcpiHwDisableGpe (GpeNumber); if (ACPI_FAILURE (Status)) { - ACPI_REPORT_ERROR (("AcpiEvGpeDispatch: Unable to disable GPE[%X]\n", GpeNumber)); + ACPI_REPORT_ERROR (("AcpiEvGpeDispatch: Unable to disable GPE[%2.2X]\n", GpeNumber)); return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); } } @@ -1086,7 +1090,7 @@ Status = AcpiHwClearGpe (GpeNumber); if (ACPI_FAILURE (Status)) { - ACPI_REPORT_ERROR (("AcpiEvGpeDispatch: Unable to clear GPE[%X]\n", GpeNumber)); + ACPI_REPORT_ERROR (("AcpiEvGpeDispatch: Unable to clear GPE[%2.2X]\n", GpeNumber)); return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); } } Index: contrib/dev/acpica/evrgnini.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/evrgnini.c,v retrieving revision 1.1.1.16 diff -u -r1.1.1.16 evrgnini.c --- contrib/dev/acpica/evrgnini.c 29 Aug 2002 01:51:15 -0000 1.1.1.16 +++ contrib/dev/acpica/evrgnini.c 28 Nov 2002 03:28:25 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evrgnini- ACPI AddressSpace (OpRegion) init - * $Revision: 63 $ + * $Revision: 64 $ * *****************************************************************************/ @@ -379,6 +379,11 @@ { PciId->Bus = ACPI_LOWORD (Temp); } + + /* + * Complete this device's PciId + */ + AcpiOsDerivePciId (Node, RegionObj->Region.Node, &PciId); *RegionContext = PciId; return_ACPI_STATUS (AE_OK); Index: contrib/dev/acpica/psopcode.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/psopcode.c,v retrieving revision 1.1.1.17 diff -u -r1.1.1.17 psopcode.c --- contrib/dev/acpica/psopcode.c 27 Nov 2002 18:07:48 -0000 1.1.1.17 +++ contrib/dev/acpica/psopcode.c 28 Nov 2002 03:28:25 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: psopcode - Parser/Interpreter opcode information table - * $Revision: 73 $ + * $Revision: 74 $ * *****************************************************************************/ @@ -827,7 +827,7 @@ AcpiPsGetOpcodeName ( UINT16 Opcode) { -#ifdef ACPI_DISASSEMBLER +#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUG_OUTPUT) const ACPI_OPCODE_INFO *Op; Index: contrib/dev/acpica/utcopy.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/utcopy.c,v retrieving revision 1.1.1.19 diff -u -r1.1.1.19 utcopy.c --- contrib/dev/acpica/utcopy.c 27 Nov 2002 18:07:48 -0000 1.1.1.19 +++ contrib/dev/acpica/utcopy.c 28 Nov 2002 03:28:25 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utcopy - Internal to external object translation utilities - * $Revision: 105 $ + * $Revision: 106 $ * *****************************************************************************/ @@ -521,7 +521,8 @@ case ACPI_TYPE_STRING: - InternalObject->String.Pointer = ACPI_MEM_CALLOCATE ((ACPI_SIZE) ExternalObject->String.Length + 1); + InternalObject->String.Pointer = + ACPI_MEM_CALLOCATE ((ACPI_SIZE) ExternalObject->String.Length + 1); if (!InternalObject->String.Pointer) { return_ACPI_STATUS (AE_NO_MEMORY); @@ -537,7 +538,8 @@ case ACPI_TYPE_BUFFER: - InternalObject->Buffer.Pointer = ACPI_MEM_CALLOCATE (ExternalObject->Buffer.Length); + InternalObject->Buffer.Pointer = + ACPI_MEM_CALLOCATE (ExternalObject->Buffer.Length); if (!InternalObject->Buffer.Pointer) { return_ACPI_STATUS (AE_NO_MEMORY); @@ -575,10 +577,10 @@ * FUNCTION: AcpiUtCopyEpackageToIpackage * * PARAMETERS: *InternalObject - Pointer to the object we are returning - * *Buffer - Where the object is returned - * *SpaceUsed - Where the length of the object is returned + * *Buffer - Where the object is returned + * *SpaceUsed - Where the length of the object is returned * - * RETURN: Status - the status of the call + * RETURN: Status * * DESCRIPTION: This function is called to place a package object in a user * buffer. A package object by definition contains other objects. @@ -713,7 +715,8 @@ /* Copy the entire source object over the destination object*/ - ACPI_MEMCPY ((char *) DestDesc, (char *) SourceDesc, sizeof (ACPI_OPERAND_OBJECT)); + ACPI_MEMCPY ((char *) DestDesc, (char *) SourceDesc, + sizeof (ACPI_OPERAND_OBJECT)); /* Restore the saved fields */ @@ -797,28 +800,40 @@ switch (ObjectType) { - case 0: + case ACPI_COPY_TYPE_SIMPLE: - /* - * This is a simple object, just copy it - */ - TargetObject = AcpiUtCreateInternalObject (ACPI_GET_OBJECT_TYPE (SourceObject)); - if (!TargetObject) - { - return (AE_NO_MEMORY); - } + /* A null source object indicates a (legal) null package element */ - Status = AcpiUtCopySimpleObject (SourceObject, TargetObject); - if (ACPI_FAILURE (Status)) + if (SourceObject) { - return (Status); + /* + * This is a simple object, just copy it + */ + TargetObject = AcpiUtCreateInternalObject ( + ACPI_GET_OBJECT_TYPE (SourceObject)); + if (!TargetObject) + { + return (AE_NO_MEMORY); + } + + Status = AcpiUtCopySimpleObject (SourceObject, TargetObject); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + *ThisTargetPtr = TargetObject; } + else + { + /* Pass through a null element */ - *ThisTargetPtr = TargetObject; + *ThisTargetPtr = NULL; + } break; - case 1: + case ACPI_COPY_TYPE_PACKAGE: /* * This object is a package - go down another nesting level @@ -832,6 +847,18 @@ TargetObject->Package.Count = SourceObject->Package.Count; TargetObject->Common.Flags = SourceObject->Common.Flags; + + /* + * Create the object array + */ + TargetObject->Package.Elements = + ACPI_MEM_CALLOCATE (((ACPI_SIZE) SourceObject->Package.Count + 1) * + sizeof (void *)); + if (!TargetObject->Package.Elements) + { + ACPI_MEM_FREE (TargetObject); + return (AE_NO_MEMORY); + } /* * Pass the new package object back to the package walk routine Index: contrib/dev/acpica/utmisc.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/utmisc.c,v retrieving revision 1.1.1.15 diff -u -r1.1.1.15 utmisc.c --- contrib/dev/acpica/utmisc.c 27 Nov 2002 18:07:48 -0000 1.1.1.15 +++ contrib/dev/acpica/utmisc.c 28 Nov 2002 03:28:25 -0000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: utmisc - common utility procedures - * $Revision: 86 $ + * $Revision: 87 $ * ******************************************************************************/ @@ -599,7 +599,6 @@ String++; } - return (SrcString); } @@ -703,7 +702,6 @@ return_ACPI_STATUS (AE_BAD_PARAMETER); } - if (!AcpiGbl_AcpiMutexInfo[MutexId].Mutex) { Status = AcpiOsCreateSemaphore (1, 1, @@ -743,7 +741,6 @@ return_ACPI_STATUS (AE_BAD_PARAMETER); } - Status = AcpiOsDeleteSemaphore (AcpiGbl_AcpiMutexInfo[MutexId].Mutex); AcpiGbl_AcpiMutexInfo[MutexId].Mutex = NULL; @@ -782,7 +779,6 @@ return (AE_BAD_PARAMETER); } - ThisThreadId = AcpiOsGetThreadId (); /* @@ -813,7 +809,6 @@ } } - ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %X attempting to acquire Mutex [%s]\n", ThisThreadId, AcpiUtGetMutexName (MutexId))); @@ -828,7 +823,6 @@ AcpiGbl_AcpiMutexInfo[MutexId].UseCount++; AcpiGbl_AcpiMutexInfo[MutexId].OwnerId = ThisThreadId; } - else { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Thread %X could not acquire Mutex [%s] %s\n", @@ -874,7 +868,6 @@ return (AE_BAD_PARAMETER); } - /* * Mutex must be acquired in order to release it! */ @@ -887,7 +880,6 @@ return (AE_NOT_ACQUIRED); } - /* * Deadlock prevention. Check if this thread owns any mutexes of value * greater than this one. If so, the thread has violated the mutex @@ -911,7 +903,6 @@ } } - /* Mark unlocked FIRST */ AcpiGbl_AcpiMutexInfo[MutexId].OwnerId = ACPI_MUTEX_NOT_ACQUIRED; @@ -973,7 +964,6 @@ return (AE_NO_MEMORY); } - AcpiUtPushGenericState (StateList, State); return (AE_OK); } @@ -1012,7 +1002,6 @@ return (AE_NO_MEMORY); } - AcpiUtPushGenericState (StateList, State); return (AE_OK); } @@ -1281,7 +1270,6 @@ return_PTR (NULL); } - /* Init fields specific to the control struct */ State->Common.DataType = ACPI_DESC_TYPE_STATE_CONTROL; @@ -1378,6 +1366,8 @@ while (State) { + /* Get one element of the package */ + ThisIndex = State->Pkg.Index; ThisSourceObj = (ACPI_OPERAND_OBJECT *) State->Pkg.SourceObject->Package.Elements[ThisIndex]; @@ -1484,6 +1474,7 @@ { UINT32 i; signed char Sum = 0; + for (i = 0; i < Length; i++) {