aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utcopy.c
diff options
context:
space:
mode:
authorRobert Moore <robert.moore@intel.com>2005-05-13 00:00:00 -0400
committerLen Brown <len.brown@intel.com>2005-07-13 16:29:07 -0400
commit6f42ccf2fc50ecee8ea170040627f268430c1648 (patch)
tree5b6690d86adfc17e7960b2e113855079fe19c541 /drivers/acpi/utilities/utcopy.c
parentd8683a0cb5d09cb7f19feefa708424a84577e68f (diff)
ACPICA from Bob Moore <robert.moore@intel.com>
Implemented support for PCI Express root bridges -- added support for device PNP0A08 in the root bridge search within AcpiEvPciConfigRegionSetup. acpi_ev_pci_config_region_setup(). The interpreter now automatically truncates incoming 64-bit constants to 32 bits if currently executing out of a 32-bit ACPI table (Revision < 2). This also affects the iASL compiler constant folding. (Note: as per below, the iASL compiler no longer allows 64-bit constants within 32-bit tables.) Fixed a problem where string and buffer objects with "static" pointers (pointers to initialization data within an ACPI table) were not handled consistently. The internal object copy operation now always copies the data to a newly allocated buffer, regardless of whether the source object is static or not. Fixed a problem with the FromBCD operator where an implicit result conversion was improperly performed while storing the result to the target operand. Since this is an "explicit conversion" operator, the implicit conversion should never be performed on the output. Fixed a problem with the CopyObject operator where a copy to an existing named object did not always completely overwrite the existing object stored at name. Specifically, a buffer-to-buffer copy did not delete the existing buffer. Replaced "interrupt_level" with "interrupt_number" in all GPE interfaces and structs for consistency. Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/utilities/utcopy.c')
-rw-r--r--drivers/acpi/utilities/utcopy.c46
1 files changed, 19 insertions, 27 deletions
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index 11e884957162..31c30a32e5c9 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -694,58 +694,50 @@ acpi_ut_copy_simple_object (
694 dest_desc->common.reference_count = reference_count; 694 dest_desc->common.reference_count = reference_count;
695 dest_desc->common.next_object = next_object; 695 dest_desc->common.next_object = next_object;
696 696
697 /* New object is not static, regardless of source */
698
699 dest_desc->common.flags &= ~AOPOBJ_STATIC_POINTER;
700
697 /* Handle the objects with extra data */ 701 /* Handle the objects with extra data */
698 702
699 switch (ACPI_GET_OBJECT_TYPE (dest_desc)) { 703 switch (ACPI_GET_OBJECT_TYPE (dest_desc)) {
700 case ACPI_TYPE_BUFFER: 704 case ACPI_TYPE_BUFFER:
701
702 dest_desc->buffer.node = NULL;
703 dest_desc->common.flags = source_desc->common.flags;
704
705 /* 705 /*
706 * Allocate and copy the actual buffer if and only if: 706 * Allocate and copy the actual buffer if and only if:
707 * 1) There is a valid buffer pointer 707 * 1) There is a valid buffer pointer
708 * 2) The buffer is not static (not in an ACPI table) (in this case, 708 * 2) The buffer has a length > 0
709 * the actual pointer was already copied above)
710 */ 709 */
711 if ((source_desc->buffer.pointer) && 710 if ((source_desc->buffer.pointer) &&
712 (!(source_desc->common.flags & AOPOBJ_STATIC_POINTER))) { 711 (source_desc->buffer.length)) {
713 dest_desc->buffer.pointer = NULL; 712 dest_desc->buffer.pointer =
714 713 ACPI_MEM_ALLOCATE (source_desc->buffer.length);
715 /* Create an actual buffer only if length > 0 */ 714 if (!dest_desc->buffer.pointer) {
716 715 return (AE_NO_MEMORY);
717 if (source_desc->buffer.length) { 716 }
718 dest_desc->buffer.pointer =
719 ACPI_MEM_ALLOCATE (source_desc->buffer.length);
720 if (!dest_desc->buffer.pointer) {
721 return (AE_NO_MEMORY);
722 }
723 717
724 /* Copy the actual buffer data */ 718 /* Copy the actual buffer data */
725 719
726 ACPI_MEMCPY (dest_desc->buffer.pointer, 720 ACPI_MEMCPY (dest_desc->buffer.pointer,
727 source_desc->buffer.pointer, 721 source_desc->buffer.pointer,
728 source_desc->buffer.length); 722 source_desc->buffer.length);
729 }
730 } 723 }
731 break; 724 break;
732 725
733 case ACPI_TYPE_STRING: 726 case ACPI_TYPE_STRING:
734
735 /* 727 /*
736 * Allocate and copy the actual string if and only if: 728 * Allocate and copy the actual string if and only if:
737 * 1) There is a valid string pointer 729 * 1) There is a valid string pointer
738 * 2) The string is not static (not in an ACPI table) (in this case, 730 * (Pointer to a NULL string is allowed)
739 * the actual pointer was already copied above)
740 */ 731 */
741 if ((source_desc->string.pointer) && 732 if (source_desc->string.pointer) {
742 (!(source_desc->common.flags & AOPOBJ_STATIC_POINTER))) {
743 dest_desc->string.pointer = 733 dest_desc->string.pointer =
744 ACPI_MEM_ALLOCATE ((acpi_size) source_desc->string.length + 1); 734 ACPI_MEM_ALLOCATE ((acpi_size) source_desc->string.length + 1);
745 if (!dest_desc->string.pointer) { 735 if (!dest_desc->string.pointer) {
746 return (AE_NO_MEMORY); 736 return (AE_NO_MEMORY);
747 } 737 }
748 738
739 /* Copy the actual string data */
740
749 ACPI_MEMCPY (dest_desc->string.pointer, source_desc->string.pointer, 741 ACPI_MEMCPY (dest_desc->string.pointer, source_desc->string.pointer,
750 (acpi_size) source_desc->string.length + 1); 742 (acpi_size) source_desc->string.length + 1);
751 } 743 }