Lines Matching +full:reference +full:- +full:buffer
3 * Module Name: utcopy - Internal to external object translation utilities
11 * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
108 * any of its subsidiaries will export/re-export any technical data, process,
130 * 3. Neither the names of the above-listed copyright holders nor the names
179 UINT8 *Buffer,
215 * PARAMETERS: InternalObject - Source object to be copied
216 * ExternalObject - Where to return the copied object
217 * DataSpace - Where object data is returned (such as
218 * buffer and string data)
219 * BufferSpaceUsed - Length of DataSpace that was used
226 * The DataSpace buffer is assumed to have sufficient space for
263 ExternalObject->Type = InternalObject->Common.Type; in AcpiUtCopyIsimpleToEsimple()
267 switch (InternalObject->Common.Type) in AcpiUtCopyIsimpleToEsimple()
271 ExternalObject->String.Pointer = (char *) DataSpace; in AcpiUtCopyIsimpleToEsimple()
272 ExternalObject->String.Length = InternalObject->String.Length; in AcpiUtCopyIsimpleToEsimple()
274 (ACPI_SIZE) InternalObject->String.Length + 1); in AcpiUtCopyIsimpleToEsimple()
277 (void *) InternalObject->String.Pointer, in AcpiUtCopyIsimpleToEsimple()
278 (ACPI_SIZE) InternalObject->String.Length + 1); in AcpiUtCopyIsimpleToEsimple()
283 ExternalObject->Buffer.Pointer = DataSpace; in AcpiUtCopyIsimpleToEsimple()
284 ExternalObject->Buffer.Length = InternalObject->Buffer.Length; in AcpiUtCopyIsimpleToEsimple()
286 InternalObject->String.Length); in AcpiUtCopyIsimpleToEsimple()
289 (void *) InternalObject->Buffer.Pointer, in AcpiUtCopyIsimpleToEsimple()
290 InternalObject->Buffer.Length); in AcpiUtCopyIsimpleToEsimple()
295 ExternalObject->Integer.Value = InternalObject->Integer.Value; in AcpiUtCopyIsimpleToEsimple()
300 /* This is an object reference. */ in AcpiUtCopyIsimpleToEsimple()
302 switch (InternalObject->Reference.Class) in AcpiUtCopyIsimpleToEsimple()
306 * For namepath, return the object handle ("reference") in AcpiUtCopyIsimpleToEsimple()
309 ExternalObject->Reference.Handle = in AcpiUtCopyIsimpleToEsimple()
310 InternalObject->Reference.Node; in AcpiUtCopyIsimpleToEsimple()
311 ExternalObject->Reference.ActualType = in AcpiUtCopyIsimpleToEsimple()
312 AcpiNsGetType (InternalObject->Reference.Node); in AcpiUtCopyIsimpleToEsimple()
317 /* All other reference types are unsupported */ in AcpiUtCopyIsimpleToEsimple()
325 ExternalObject->Processor.ProcId = in AcpiUtCopyIsimpleToEsimple()
326 InternalObject->Processor.ProcId; in AcpiUtCopyIsimpleToEsimple()
327 ExternalObject->Processor.PblkAddress = in AcpiUtCopyIsimpleToEsimple()
328 InternalObject->Processor.Address; in AcpiUtCopyIsimpleToEsimple()
329 ExternalObject->Processor.PblkLength = in AcpiUtCopyIsimpleToEsimple()
330 InternalObject->Processor.Length; in AcpiUtCopyIsimpleToEsimple()
335 ExternalObject->PowerResource.SystemLevel = in AcpiUtCopyIsimpleToEsimple()
336 InternalObject->PowerResource.SystemLevel; in AcpiUtCopyIsimpleToEsimple()
338 ExternalObject->PowerResource.ResourceOrder = in AcpiUtCopyIsimpleToEsimple()
339 InternalObject->PowerResource.ResourceOrder; in AcpiUtCopyIsimpleToEsimple()
348 AcpiUtGetTypeName (InternalObject->Common.Type))); in AcpiUtCopyIsimpleToEsimple()
386 ThisIndex = State->Pkg.Index; in AcpiUtCopyIelementToEelement()
388 (State->Pkg.DestObject))->Package.Elements[ThisIndex]; in AcpiUtCopyIelementToEelement()
397 TargetObject, Info->FreeSpace, &ObjectSpace); in AcpiUtCopyIelementToEelement()
408 TargetObject->Type = ACPI_TYPE_PACKAGE; in AcpiUtCopyIelementToEelement()
409 TargetObject->Package.Count = SourceObject->Package.Count; in AcpiUtCopyIelementToEelement()
410 TargetObject->Package.Elements = in AcpiUtCopyIelementToEelement()
411 ACPI_CAST_PTR (ACPI_OBJECT, Info->FreeSpace); in AcpiUtCopyIelementToEelement()
416 State->Pkg.ThisTargetObj = TargetObject; in AcpiUtCopyIelementToEelement()
420 * update the buffer length counter in AcpiUtCopyIelementToEelement()
423 (ACPI_SIZE) TargetObject->Package.Count * in AcpiUtCopyIelementToEelement()
432 Info->FreeSpace += ObjectSpace; in AcpiUtCopyIelementToEelement()
433 Info->Length += ObjectSpace; in AcpiUtCopyIelementToEelement()
442 * PARAMETERS: InternalObject - Pointer to the object we are returning
443 * Buffer - Where the object is returned
444 * SpaceUsed - Where the object length is returned
449 * buffer. A package object by definition contains other objects.
451 * The buffer is assumed to have sufficient space for the object.
452 * The caller must have verified the buffer length needed using
460 UINT8 *Buffer, in AcpiUtCopyIpackageToEpackage() argument
472 * First package at head of the buffer in AcpiUtCopyIpackageToEpackage()
474 ExternalObject = ACPI_CAST_PTR (ACPI_OBJECT, Buffer); in AcpiUtCopyIpackageToEpackage()
480 Info.FreeSpace = Buffer + in AcpiUtCopyIpackageToEpackage()
485 ExternalObject->Type = InternalObject->Common.Type; in AcpiUtCopyIpackageToEpackage()
486 ExternalObject->Package.Count = InternalObject->Package.Count; in AcpiUtCopyIpackageToEpackage()
487 ExternalObject->Package.Elements = in AcpiUtCopyIpackageToEpackage()
491 * Leave room for an array of ACPI_OBJECTS in the buffer in AcpiUtCopyIpackageToEpackage()
494 Info.Length += (ACPI_SIZE) ExternalObject->Package.Count * in AcpiUtCopyIpackageToEpackage()
496 Info.FreeSpace += ExternalObject->Package.Count * in AcpiUtCopyIpackageToEpackage()
511 * PARAMETERS: InternalObject - The internal object to be converted
512 * RetBuffer - Where the object is returned
532 if (InternalObject->Common.Type == ACPI_TYPE_PACKAGE) in AcpiUtCopyIobjectToEobject()
539 RetBuffer->Pointer, &RetBuffer->Length); in AcpiUtCopyIobjectToEobject()
547 ACPI_CAST_PTR (ACPI_OBJECT, RetBuffer->Pointer), in AcpiUtCopyIobjectToEobject()
548 ACPI_ADD_PTR (UINT8, RetBuffer->Pointer, in AcpiUtCopyIobjectToEobject()
550 &RetBuffer->Length); in AcpiUtCopyIobjectToEobject()
555 RetBuffer->Length += sizeof (ACPI_OBJECT); in AcpiUtCopyIobjectToEobject()
566 * PARAMETERS: ExternalObject - The external object to be converted
567 * RetInternalObject - Where the internal object is returned
590 * Simple types supported are: String, Buffer, Integer in AcpiUtCopyEsimpleToIsimple()
592 switch (ExternalObject->Type) in AcpiUtCopyEsimpleToIsimple()
600 (UINT8) ExternalObject->Type); in AcpiUtCopyEsimpleToIsimple()
618 AcpiUtGetTypeName (ExternalObject->Type))); in AcpiUtCopyEsimpleToIsimple()
624 /* Must COPY string and buffer contents */ in AcpiUtCopyEsimpleToIsimple()
626 switch (ExternalObject->Type) in AcpiUtCopyEsimpleToIsimple()
630 InternalObject->String.Pointer = in AcpiUtCopyEsimpleToIsimple()
632 ExternalObject->String.Length + 1); in AcpiUtCopyEsimpleToIsimple()
634 if (!InternalObject->String.Pointer) in AcpiUtCopyEsimpleToIsimple()
639 memcpy (InternalObject->String.Pointer, in AcpiUtCopyEsimpleToIsimple()
640 ExternalObject->String.Pointer, in AcpiUtCopyEsimpleToIsimple()
641 ExternalObject->String.Length); in AcpiUtCopyEsimpleToIsimple()
643 InternalObject->String.Length = ExternalObject->String.Length; in AcpiUtCopyEsimpleToIsimple()
648 InternalObject->Buffer.Pointer = in AcpiUtCopyEsimpleToIsimple()
649 ACPI_ALLOCATE_ZEROED (ExternalObject->Buffer.Length); in AcpiUtCopyEsimpleToIsimple()
650 if (!InternalObject->Buffer.Pointer) in AcpiUtCopyEsimpleToIsimple()
655 memcpy (InternalObject->Buffer.Pointer, in AcpiUtCopyEsimpleToIsimple()
656 ExternalObject->Buffer.Pointer, in AcpiUtCopyEsimpleToIsimple()
657 ExternalObject->Buffer.Length); in AcpiUtCopyEsimpleToIsimple()
659 InternalObject->Buffer.Length = ExternalObject->Buffer.Length; in AcpiUtCopyEsimpleToIsimple()
661 /* Mark buffer data valid */ in AcpiUtCopyEsimpleToIsimple()
663 InternalObject->Buffer.Flags |= AOPOBJ_DATA_VALID; in AcpiUtCopyEsimpleToIsimple()
668 InternalObject->Integer.Value = ExternalObject->Integer.Value; in AcpiUtCopyEsimpleToIsimple()
673 /* An incoming reference is defined to be a namespace node */ in AcpiUtCopyEsimpleToIsimple()
675 InternalObject->Reference.Class = ACPI_REFCLASS_REFOF; in AcpiUtCopyEsimpleToIsimple()
676 InternalObject->Reference.Object = ExternalObject->Reference.Handle; in AcpiUtCopyEsimpleToIsimple()
700 * PARAMETERS: ExternalObject - The external object to be converted
701 * InternalObject - Where the internal object is returned
727 ExternalObject->Package.Count); in AcpiUtCopyEpackageToIpackage()
733 PackageElements = PackageObject->Package.Elements; in AcpiUtCopyEpackageToIpackage()
739 for (i = 0; i < ExternalObject->Package.Count; i++) in AcpiUtCopyEpackageToIpackage()
742 &ExternalObject->Package.Elements[i], in AcpiUtCopyEpackageToIpackage()
748 PackageObject->Package.Count = i; in AcpiUtCopyEpackageToIpackage()
757 PackageObject->Package.Flags |= AOPOBJ_DATA_VALID; in AcpiUtCopyEpackageToIpackage()
768 * PARAMETERS: ExternalObject - The external object to be converted
769 * InternalObject - Where the internal object is returned
788 if (ExternalObject->Type == ACPI_TYPE_PACKAGE) in AcpiUtCopyEobjectToIobject()
810 * PARAMETERS: SourceDesc - The internal object to be copied
811 * DestDesc - New target object
815 * DESCRIPTION: Simple copy of one internal object to another. Reference count
833 ReferenceCount = DestDesc->Common.ReferenceCount; in AcpiUtCopySimpleObject()
834 NextObject = DestDesc->Common.NextObject; in AcpiUtCopySimpleObject()
851 DestDesc->Common.ReferenceCount = ReferenceCount; in AcpiUtCopySimpleObject()
852 DestDesc->Common.NextObject = NextObject; in AcpiUtCopySimpleObject()
856 DestDesc->Common.Flags &= ~AOPOBJ_STATIC_POINTER; in AcpiUtCopySimpleObject()
860 switch (DestDesc->Common.Type) in AcpiUtCopySimpleObject()
864 * Allocate and copy the actual buffer if and only if: in AcpiUtCopySimpleObject()
865 * 1) There is a valid buffer pointer in AcpiUtCopySimpleObject()
866 * 2) The buffer has a length > 0 in AcpiUtCopySimpleObject()
868 if ((SourceDesc->Buffer.Pointer) && in AcpiUtCopySimpleObject()
869 (SourceDesc->Buffer.Length)) in AcpiUtCopySimpleObject()
871 DestDesc->Buffer.Pointer = in AcpiUtCopySimpleObject()
872 ACPI_ALLOCATE (SourceDesc->Buffer.Length); in AcpiUtCopySimpleObject()
873 if (!DestDesc->Buffer.Pointer) in AcpiUtCopySimpleObject()
878 /* Copy the actual buffer data */ in AcpiUtCopySimpleObject()
880 memcpy (DestDesc->Buffer.Pointer, in AcpiUtCopySimpleObject()
881 SourceDesc->Buffer.Pointer, SourceDesc->Buffer.Length); in AcpiUtCopySimpleObject()
891 if (SourceDesc->String.Pointer) in AcpiUtCopySimpleObject()
893 DestDesc->String.Pointer = in AcpiUtCopySimpleObject()
894 ACPI_ALLOCATE ((ACPI_SIZE) SourceDesc->String.Length + 1); in AcpiUtCopySimpleObject()
895 if (!DestDesc->String.Pointer) in AcpiUtCopySimpleObject()
902 memcpy (DestDesc->String.Pointer, SourceDesc->String.Pointer, in AcpiUtCopySimpleObject()
903 (ACPI_SIZE) SourceDesc->String.Length + 1); in AcpiUtCopySimpleObject()
909 * We copied the reference object, so we now must add a reference in AcpiUtCopySimpleObject()
910 * to the object pointed to by the reference in AcpiUtCopySimpleObject()
912 * DDBHandle reference (from Load/LoadTable) is a special reference, in AcpiUtCopySimpleObject()
913 * it does not have a Reference.Object, so does not need to in AcpiUtCopySimpleObject()
914 * increase the reference count in AcpiUtCopySimpleObject()
916 if (SourceDesc->Reference.Class == ACPI_REFCLASS_TABLE) in AcpiUtCopySimpleObject()
921 AcpiUtAddReference (SourceDesc->Reference.Object); in AcpiUtCopySimpleObject()
926 * We copied the Region Handler, so we now must add a reference in AcpiUtCopySimpleObject()
928 if (DestDesc->Region.Handler) in AcpiUtCopySimpleObject()
930 AcpiUtAddReference (DestDesc->Region.Handler); in AcpiUtCopySimpleObject()
940 Status = AcpiOsCreateMutex (&DestDesc->Mutex.OsMutex); in AcpiUtCopySimpleObject()
950 &DestDesc->Event.OsSemaphore); in AcpiUtCopySimpleObject()
996 ThisIndex = State->Pkg.Index; in AcpiUtCopyIelementToIelement()
998 &State->Pkg.DestObject->Package.Elements[ThisIndex]; in AcpiUtCopyIelementToIelement()
1012 SourceObject->Common.Type); in AcpiUtCopyIelementToIelement()
1036 * This object is a package - go down another nesting level in AcpiUtCopyIelementToIelement()
1040 SourceObject->Package.Count); in AcpiUtCopyIelementToIelement()
1046 TargetObject->Common.Flags = SourceObject->Common.Flags; in AcpiUtCopyIelementToIelement()
1050 State->Pkg.ThisTargetObj = TargetObject; in AcpiUtCopyIelementToIelement()
1074 * PARAMETERS: SourceObj - Pointer to the source package object
1075 * DestObj - Where the internal object is returned
1076 * WalkState - Current Walk state descriptor
1097 DestObj->Common.Type = SourceObj->Common.Type; in AcpiUtCopyIpackageToIpackage()
1098 DestObj->Common.Flags = SourceObj->Common.Flags; in AcpiUtCopyIpackageToIpackage()
1099 DestObj->Package.Count = SourceObj->Package.Count; in AcpiUtCopyIpackageToIpackage()
1104 DestObj->Package.Elements = ACPI_ALLOCATE_ZEROED ( in AcpiUtCopyIpackageToIpackage()
1105 ((ACPI_SIZE) SourceObj->Package.Count + 1) * in AcpiUtCopyIpackageToIpackage()
1107 if (!DestObj->Package.Elements) in AcpiUtCopyIpackageToIpackage()
1114 * Copy the package element-by-element by walking the package "tree". in AcpiUtCopyIpackageToIpackage()
1134 * PARAMETERS: SourceDesc - The internal object to be copied
1135 * DestDesc - Where the copied object is returned
1136 * WalkState - Current walk state
1158 *DestDesc = AcpiUtCreateInternalObject (SourceDesc->Common.Type); in AcpiUtCopyIobjectToIobject()
1166 if (SourceDesc->Common.Type == ACPI_TYPE_PACKAGE) in AcpiUtCopyIobjectToIobject()