1 /*******************************************************************************
3 * Module Name: rscalc - Calculate stream and list lengths
5 ******************************************************************************/
8 * Copyright (C) 2000 - 2021, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
50 #define _COMPONENT ACPI_RESOURCES
51 ACPI_MODULE_NAME ("rscalc")
54 /* Local prototypes */
61 AcpiRsStructOptionLength (
62 ACPI_RESOURCE_SOURCE
*ResourceSource
);
65 AcpiRsStreamOptionLength (
66 UINT32 ResourceLength
,
67 UINT32 MinimumTotalLength
);
70 /*******************************************************************************
72 * FUNCTION: AcpiRsCountSetBits
74 * PARAMETERS: BitField - Field in which to count bits
76 * RETURN: Number of bits set within the field
78 * DESCRIPTION: Count the number of bits set in a resource field. Used for
79 * (Short descriptor) interrupt and DMA lists.
81 ******************************************************************************/
90 ACPI_FUNCTION_ENTRY ();
93 for (BitsSet
= 0; BitField
; BitsSet
++)
95 /* Zero the least significant bit that is set */
97 BitField
&= (UINT16
) (BitField
- 1);
104 /*******************************************************************************
106 * FUNCTION: AcpiRsStructOptionLength
108 * PARAMETERS: ResourceSource - Pointer to optional descriptor field
112 * DESCRIPTION: Common code to handle optional ResourceSourceIndex and
113 * ResourceSource fields in some Large descriptors. Used during
114 * list-to-stream conversion
116 ******************************************************************************/
118 static ACPI_RS_LENGTH
119 AcpiRsStructOptionLength (
120 ACPI_RESOURCE_SOURCE
*ResourceSource
)
122 ACPI_FUNCTION_ENTRY ();
126 * If the ResourceSource string is valid, return the size of the string
127 * (StringLength includes the NULL terminator) plus the size of the
128 * ResourceSourceIndex (1).
130 if (ResourceSource
->StringPtr
)
132 return ((ACPI_RS_LENGTH
) (ResourceSource
->StringLength
+ 1));
139 /*******************************************************************************
141 * FUNCTION: AcpiRsStreamOptionLength
143 * PARAMETERS: ResourceLength - Length from the resource header
144 * MinimumTotalLength - Minimum length of this resource, before
145 * any optional fields. Includes header size
147 * RETURN: Length of optional string (0 if no string present)
149 * DESCRIPTION: Common code to handle optional ResourceSourceIndex and
150 * ResourceSource fields in some Large descriptors. Used during
151 * stream-to-list conversion
153 ******************************************************************************/
156 AcpiRsStreamOptionLength (
157 UINT32 ResourceLength
,
158 UINT32 MinimumAmlResourceLength
)
160 UINT32 StringLength
= 0;
163 ACPI_FUNCTION_ENTRY ();
167 * The ResourceSourceIndex and ResourceSource are optional elements of
168 * some Large-type resource descriptors.
172 * If the length of the actual resource descriptor is greater than the
173 * ACPI spec-defined minimum length, it means that a ResourceSourceIndex
174 * exists and is followed by a (required) null terminated string. The
175 * string length (including the null terminator) is the resource length
176 * minus the minimum length, minus one byte for the ResourceSourceIndex
179 if (ResourceLength
> MinimumAmlResourceLength
)
181 /* Compute the length of the optional string */
183 StringLength
= ResourceLength
- MinimumAmlResourceLength
- 1;
187 * Round the length up to a multiple of the native word in order to
188 * guarantee that the entire resource descriptor is native word aligned
190 return ((UINT32
) ACPI_ROUND_UP_TO_NATIVE_WORD (StringLength
));
194 /*******************************************************************************
196 * FUNCTION: AcpiRsGetAmlLength
198 * PARAMETERS: Resource - Pointer to the resource linked list
199 * ResourceListSize - Size of the resource linked list
200 * SizeNeeded - Where the required size is returned
204 * DESCRIPTION: Takes a linked list of internal resource descriptors and
205 * calculates the size buffer needed to hold the corresponding
206 * external resource byte stream.
208 ******************************************************************************/
212 ACPI_RESOURCE
*Resource
,
213 ACPI_SIZE ResourceListSize
,
214 ACPI_SIZE
*SizeNeeded
)
216 ACPI_SIZE AmlSizeNeeded
= 0;
217 ACPI_RESOURCE
*ResourceEnd
;
218 ACPI_RS_LENGTH TotalSize
;
221 ACPI_FUNCTION_TRACE (RsGetAmlLength
);
224 /* Traverse entire list of internal resource descriptors */
226 ResourceEnd
= ACPI_ADD_PTR (ACPI_RESOURCE
, Resource
, ResourceListSize
);
227 while (Resource
< ResourceEnd
)
229 /* Validate the descriptor type */
231 if (Resource
->Type
> ACPI_RESOURCE_TYPE_MAX
)
233 return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE
);
236 /* Sanity check the length. It must not be zero, or we loop forever */
238 if (!Resource
->Length
)
240 return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH
);
243 /* Get the base size of the (external stream) resource descriptor */
245 TotalSize
= AcpiGbl_AmlResourceSizes
[Resource
->Type
];
248 * Augment the base size for descriptors with optional and/or
249 * variable-length fields
251 switch (Resource
->Type
)
253 case ACPI_RESOURCE_TYPE_IRQ
:
255 /* Length can be 3 or 2 */
257 if (Resource
->Data
.Irq
.DescriptorLength
== 2)
264 case ACPI_RESOURCE_TYPE_START_DEPENDENT
:
266 /* Length can be 1 or 0 */
268 if (Resource
->Data
.Irq
.DescriptorLength
== 0)
275 case ACPI_RESOURCE_TYPE_VENDOR
:
277 * Vendor Defined Resource:
278 * For a Vendor Specific resource, if the Length is between 1 and 7
279 * it will be created as a Small Resource data type, otherwise it
280 * is a Large Resource data type.
282 if (Resource
->Data
.Vendor
.ByteLength
> 7)
284 /* Base size of a Large resource descriptor */
286 TotalSize
= sizeof (AML_RESOURCE_LARGE_HEADER
);
289 /* Add the size of the vendor-specific data */
291 TotalSize
= (ACPI_RS_LENGTH
)
292 (TotalSize
+ Resource
->Data
.Vendor
.ByteLength
);
296 case ACPI_RESOURCE_TYPE_END_TAG
:
299 * We are done -- return the accumulated total size.
301 *SizeNeeded
= AmlSizeNeeded
+ TotalSize
;
305 return_ACPI_STATUS (AE_OK
);
308 case ACPI_RESOURCE_TYPE_ADDRESS16
:
310 * 16-Bit Address Resource:
311 * Add the size of the optional ResourceSource info
313 TotalSize
= (ACPI_RS_LENGTH
) (TotalSize
+
314 AcpiRsStructOptionLength (
315 &Resource
->Data
.Address16
.ResourceSource
));
319 case ACPI_RESOURCE_TYPE_ADDRESS32
:
321 * 32-Bit Address Resource:
322 * Add the size of the optional ResourceSource info
324 TotalSize
= (ACPI_RS_LENGTH
) (TotalSize
+
325 AcpiRsStructOptionLength (
326 &Resource
->Data
.Address32
.ResourceSource
));
330 case ACPI_RESOURCE_TYPE_ADDRESS64
:
332 * 64-Bit Address Resource:
333 * Add the size of the optional ResourceSource info
335 TotalSize
= (ACPI_RS_LENGTH
) (TotalSize
+
336 AcpiRsStructOptionLength (
337 &Resource
->Data
.Address64
.ResourceSource
));
341 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ
:
343 * Extended IRQ Resource:
344 * Add the size of each additional optional interrupt beyond the
345 * required 1 (4 bytes for each UINT32 interrupt number)
347 TotalSize
= (ACPI_RS_LENGTH
) (TotalSize
+
348 ((Resource
->Data
.ExtendedIrq
.InterruptCount
- 1) * 4) +
350 /* Add the size of the optional ResourceSource info */
352 AcpiRsStructOptionLength (
353 &Resource
->Data
.ExtendedIrq
.ResourceSource
));
357 case ACPI_RESOURCE_TYPE_GPIO
:
359 TotalSize
= (ACPI_RS_LENGTH
) (TotalSize
+
360 (Resource
->Data
.Gpio
.PinTableLength
* 2) +
361 Resource
->Data
.Gpio
.ResourceSource
.StringLength
+
362 Resource
->Data
.Gpio
.VendorLength
);
366 case ACPI_RESOURCE_TYPE_PIN_FUNCTION
:
368 TotalSize
= (ACPI_RS_LENGTH
) (TotalSize
+
369 (Resource
->Data
.PinFunction
.PinTableLength
* 2) +
370 Resource
->Data
.PinFunction
.ResourceSource
.StringLength
+
371 Resource
->Data
.PinFunction
.VendorLength
);
376 case ACPI_RESOURCE_TYPE_SERIAL_BUS
:
378 TotalSize
= AcpiGbl_AmlResourceSerialBusSizes
[
379 Resource
->Data
.CommonSerialBus
.Type
];
381 TotalSize
= (ACPI_RS_LENGTH
) (TotalSize
+
382 Resource
->Data
.I2cSerialBus
.ResourceSource
.StringLength
+
383 Resource
->Data
.I2cSerialBus
.VendorLength
);
387 case ACPI_RESOURCE_TYPE_PIN_CONFIG
:
389 TotalSize
= (ACPI_RS_LENGTH
) (TotalSize
+
390 (Resource
->Data
.PinConfig
.PinTableLength
* 2) +
391 Resource
->Data
.PinConfig
.ResourceSource
.StringLength
+
392 Resource
->Data
.PinConfig
.VendorLength
);
396 case ACPI_RESOURCE_TYPE_PIN_GROUP
:
398 TotalSize
= (ACPI_RS_LENGTH
) (TotalSize
+
399 (Resource
->Data
.PinGroup
.PinTableLength
* 2) +
400 Resource
->Data
.PinGroup
.ResourceLabel
.StringLength
+
401 Resource
->Data
.PinGroup
.VendorLength
);
405 case ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION
:
407 TotalSize
= (ACPI_RS_LENGTH
) (TotalSize
+
408 Resource
->Data
.PinGroupFunction
.ResourceSource
.StringLength
+
409 Resource
->Data
.PinGroupFunction
.ResourceSourceLabel
.StringLength
+
410 Resource
->Data
.PinGroupFunction
.VendorLength
);
414 case ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG
:
416 TotalSize
= (ACPI_RS_LENGTH
) (TotalSize
+
417 Resource
->Data
.PinGroupConfig
.ResourceSource
.StringLength
+
418 Resource
->Data
.PinGroupConfig
.ResourceSourceLabel
.StringLength
+
419 Resource
->Data
.PinGroupConfig
.VendorLength
);
428 /* Update the total */
430 AmlSizeNeeded
+= TotalSize
;
432 /* Point to the next object */
434 Resource
= ACPI_ADD_PTR (ACPI_RESOURCE
, Resource
, Resource
->Length
);
437 /* Did not find an EndTag resource descriptor */
439 return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG
);
443 /*******************************************************************************
445 * FUNCTION: AcpiRsGetListLength
447 * PARAMETERS: AmlBuffer - Pointer to the resource byte stream
448 * AmlBufferLength - Size of AmlBuffer
449 * SizeNeeded - Where the size needed is returned
453 * DESCRIPTION: Takes an external resource byte stream and calculates the size
454 * buffer needed to hold the corresponding internal resource
455 * descriptor linked list.
457 ******************************************************************************/
460 AcpiRsGetListLength (
462 UINT32 AmlBufferLength
,
463 ACPI_SIZE
*SizeNeeded
)
470 UINT16 ResourceLength
;
471 UINT32 ExtraStructBytes
;
473 UINT8 MinimumAmlResourceLength
;
474 AML_RESOURCE
*AmlResource
;
477 ACPI_FUNCTION_TRACE (RsGetListLength
);
480 *SizeNeeded
= ACPI_RS_SIZE_MIN
; /* Minimum size is one EndTag */
481 EndAml
= AmlBuffer
+ AmlBufferLength
;
483 /* Walk the list of AML resource descriptors */
485 while (AmlBuffer
< EndAml
)
487 /* Validate the Resource Type and Resource Length */
489 Status
= AcpiUtValidateResource (NULL
, AmlBuffer
, &ResourceIndex
);
490 if (ACPI_FAILURE (Status
))
493 * Exit on failure. Cannot continue because the descriptor length
496 return_ACPI_STATUS (Status
);
499 AmlResource
= (void *) AmlBuffer
;
501 /* Get the resource length and base (minimum) AML size */
503 ResourceLength
= AcpiUtGetResourceLength (AmlBuffer
);
504 MinimumAmlResourceLength
= AcpiGbl_ResourceAmlSizes
[ResourceIndex
];
507 * Augment the size for descriptors with optional
508 * and/or variable length fields
510 ExtraStructBytes
= 0;
511 Buffer
= AmlBuffer
+ AcpiUtGetResourceHeaderLength (AmlBuffer
);
513 switch (AcpiUtGetResourceType (AmlBuffer
))
515 case ACPI_RESOURCE_NAME_IRQ
:
518 * Get the number of bits set in the 16-bit IRQ mask
520 ACPI_MOVE_16_TO_16 (&Temp16
, Buffer
);
521 ExtraStructBytes
= AcpiRsCountSetBits (Temp16
);
525 case ACPI_RESOURCE_NAME_DMA
:
528 * Get the number of bits set in the 8-bit DMA mask
530 ExtraStructBytes
= AcpiRsCountSetBits (*Buffer
);
534 case ACPI_RESOURCE_NAME_VENDOR_SMALL
:
535 case ACPI_RESOURCE_NAME_VENDOR_LARGE
:
538 * Get the number of vendor data bytes
540 ExtraStructBytes
= ResourceLength
;
543 * There is already one byte included in the minimum
544 * descriptor size. If there are extra struct bytes,
545 * subtract one from the count.
547 if (ExtraStructBytes
)
554 case ACPI_RESOURCE_NAME_END_TAG
:
556 * End Tag: This is the normal exit
558 return_ACPI_STATUS (AE_OK
);
561 case ACPI_RESOURCE_NAME_ADDRESS32
:
562 case ACPI_RESOURCE_NAME_ADDRESS16
:
563 case ACPI_RESOURCE_NAME_ADDRESS64
:
566 * Add the size of the optional ResourceSource
568 ExtraStructBytes
= AcpiRsStreamOptionLength (
569 ResourceLength
, MinimumAmlResourceLength
);
573 case ACPI_RESOURCE_NAME_EXTENDED_IRQ
:
575 * Extended IRQ Resource:
576 * Using the InterruptTableLength, add 4 bytes for each additional
577 * interrupt. Note: at least one interrupt is required and is
578 * included in the minimum descriptor size (reason for the -1)
580 ExtraStructBytes
= (Buffer
[1] - 1) * sizeof (UINT32
);
582 /* Add the size of the optional ResourceSource */
584 ExtraStructBytes
+= AcpiRsStreamOptionLength (
585 ResourceLength
- ExtraStructBytes
, MinimumAmlResourceLength
);
588 case ACPI_RESOURCE_NAME_GPIO
:
590 /* Vendor data is optional */
592 if (AmlResource
->Gpio
.VendorLength
)
595 AmlResource
->Gpio
.VendorOffset
-
596 AmlResource
->Gpio
.PinTableOffset
+
597 AmlResource
->Gpio
.VendorLength
;
602 AmlResource
->LargeHeader
.ResourceLength
+
603 sizeof (AML_RESOURCE_LARGE_HEADER
) -
604 AmlResource
->Gpio
.PinTableOffset
;
608 case ACPI_RESOURCE_NAME_PIN_FUNCTION
:
610 /* Vendor data is optional */
612 if (AmlResource
->PinFunction
.VendorLength
)
615 AmlResource
->PinFunction
.VendorOffset
-
616 AmlResource
->PinFunction
.PinTableOffset
+
617 AmlResource
->PinFunction
.VendorLength
;
622 AmlResource
->LargeHeader
.ResourceLength
+
623 sizeof (AML_RESOURCE_LARGE_HEADER
) -
624 AmlResource
->PinFunction
.PinTableOffset
;
628 case ACPI_RESOURCE_NAME_SERIAL_BUS
:
630 MinimumAmlResourceLength
= AcpiGbl_ResourceAmlSerialBusSizes
[
631 AmlResource
->CommonSerialBus
.Type
];
633 AmlResource
->CommonSerialBus
.ResourceLength
-
634 MinimumAmlResourceLength
;
637 case ACPI_RESOURCE_NAME_PIN_CONFIG
:
639 /* Vendor data is optional */
641 if (AmlResource
->PinConfig
.VendorLength
)
644 AmlResource
->PinConfig
.VendorOffset
-
645 AmlResource
->PinConfig
.PinTableOffset
+
646 AmlResource
->PinConfig
.VendorLength
;
651 AmlResource
->LargeHeader
.ResourceLength
+
652 sizeof (AML_RESOURCE_LARGE_HEADER
) -
653 AmlResource
->PinConfig
.PinTableOffset
;
657 case ACPI_RESOURCE_NAME_PIN_GROUP
:
660 AmlResource
->PinGroup
.VendorOffset
-
661 AmlResource
->PinGroup
.PinTableOffset
+
662 AmlResource
->PinGroup
.VendorLength
;
666 case ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION
:
669 AmlResource
->PinGroupFunction
.VendorOffset
-
670 AmlResource
->PinGroupFunction
.ResSourceOffset
+
671 AmlResource
->PinGroupFunction
.VendorLength
;
675 case ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG
:
678 AmlResource
->PinGroupConfig
.VendorOffset
-
679 AmlResource
->PinGroupConfig
.ResSourceOffset
+
680 AmlResource
->PinGroupConfig
.VendorLength
;
690 * Update the required buffer size for the internal descriptor structs
692 * Important: Round the size up for the appropriate alignment. This
693 * is a requirement on IA64.
695 if (AcpiUtGetResourceType (AmlBuffer
) ==
696 ACPI_RESOURCE_NAME_SERIAL_BUS
)
698 BufferSize
= AcpiGbl_ResourceStructSerialBusSizes
[
699 AmlResource
->CommonSerialBus
.Type
] + ExtraStructBytes
;
703 BufferSize
= AcpiGbl_ResourceStructSizes
[ResourceIndex
] +
707 BufferSize
= (UINT32
) ACPI_ROUND_UP_TO_NATIVE_WORD (BufferSize
);
708 *SizeNeeded
+= BufferSize
;
710 ACPI_DEBUG_PRINT ((ACPI_DB_RESOURCES
,
711 "Type %.2X, AmlLength %.2X InternalLength %.2X%8X\n",
712 AcpiUtGetResourceType (AmlBuffer
),
713 AcpiUtGetDescriptorLength (AmlBuffer
), ACPI_FORMAT_UINT64(*SizeNeeded
)));
716 * Point to the next resource within the AML stream using the length
717 * contained in the resource descriptor header
719 AmlBuffer
+= AcpiUtGetDescriptorLength (AmlBuffer
);
722 /* Did not find an EndTag resource descriptor */
724 return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG
);
728 /*******************************************************************************
730 * FUNCTION: AcpiRsGetPciRoutingTableLength
732 * PARAMETERS: PackageObject - Pointer to the package object
733 * BufferSizeNeeded - UINT32 pointer of the size buffer
734 * needed to properly return the
739 * DESCRIPTION: Given a package representing a PCI routing table, this
740 * calculates the size of the corresponding linked list of
743 ******************************************************************************/
746 AcpiRsGetPciRoutingTableLength (
747 ACPI_OPERAND_OBJECT
*PackageObject
,
748 ACPI_SIZE
*BufferSizeNeeded
)
750 UINT32 NumberOfElements
;
751 ACPI_SIZE TempSizeNeeded
= 0;
752 ACPI_OPERAND_OBJECT
**TopObjectList
;
754 ACPI_OPERAND_OBJECT
*PackageElement
;
755 ACPI_OPERAND_OBJECT
**SubObjectList
;
760 ACPI_FUNCTION_TRACE (RsGetPciRoutingTableLength
);
763 NumberOfElements
= PackageObject
->Package
.Count
;
766 * Calculate the size of the return buffer.
767 * The base size is the number of elements * the sizes of the
768 * structures. Additional space for the strings is added below.
769 * The minus one is to subtract the size of the UINT8 Source[1]
770 * member because it is added below.
772 * But each PRT_ENTRY structure has a pointer to a string and
773 * the size of that string must be found.
775 TopObjectList
= PackageObject
->Package
.Elements
;
777 for (Index
= 0; Index
< NumberOfElements
; Index
++)
779 /* Dereference the subpackage */
781 PackageElement
= *TopObjectList
;
783 /* We must have a valid Package object */
785 if (!PackageElement
||
786 (PackageElement
->Common
.Type
!= ACPI_TYPE_PACKAGE
))
788 return_ACPI_STATUS (AE_AML_OPERAND_TYPE
);
792 * The SubObjectList will now point to an array of the
793 * four IRQ elements: Address, Pin, Source and SourceIndex
795 SubObjectList
= PackageElement
->Package
.Elements
;
797 /* Scan the IrqTableElements for the Source Name String */
802 TableIndex
< PackageElement
->Package
.Count
&& !NameFound
;
805 if (*SubObjectList
&& /* Null object allowed */
807 ((ACPI_TYPE_STRING
==
808 (*SubObjectList
)->Common
.Type
) ||
810 ((ACPI_TYPE_LOCAL_REFERENCE
==
811 (*SubObjectList
)->Common
.Type
) &&
813 ((*SubObjectList
)->Reference
.Class
==
814 ACPI_REFCLASS_NAME
))))
820 /* Look at the next element */
826 TempSizeNeeded
+= (sizeof (ACPI_PCI_ROUTING_TABLE
) - 4);
828 /* Was a String type found? */
832 if ((*SubObjectList
)->Common
.Type
== ACPI_TYPE_STRING
)
835 * The length String.Length field does not include the
836 * terminating NULL, add 1
838 TempSizeNeeded
+= ((ACPI_SIZE
)
839 (*SubObjectList
)->String
.Length
+ 1);
843 TempSizeNeeded
+= AcpiNsGetPathnameLength (
844 (*SubObjectList
)->Reference
.Node
);
850 * If no name was found, then this is a NULL, which is
851 * translated as a UINT32 zero.
853 TempSizeNeeded
+= sizeof (UINT32
);
856 /* Round up the size since each element must be aligned */
858 TempSizeNeeded
= ACPI_ROUND_UP_TO_64BIT (TempSizeNeeded
);
860 /* Point to the next ACPI_OPERAND_OBJECT */
866 * Add an extra element to the end of the list, essentially a
869 *BufferSizeNeeded
= TempSizeNeeded
+ sizeof (ACPI_PCI_ROUTING_TABLE
);
870 return_ACPI_STATUS (AE_OK
);