Date: Mon, 28 Jan 2013 20:33:32 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r246039 - in vendor-sys/acpica/dist/source: components/utilities include Message-ID: <201301282033.r0SKXWBc009365@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jkim Date: Mon Jan 28 20:33:31 2013 New Revision: 246039 URL: http://svnweb.freebsd.org/changeset/base/246039 Log: Fix a long standing bug. NextObject is the first field for very long time. Modified: vendor-sys/acpica/dist/source/components/utilities/utcache.c vendor-sys/acpica/dist/source/include/acmacros.h vendor-sys/acpica/dist/source/include/actypes.h Modified: vendor-sys/acpica/dist/source/components/utilities/utcache.c ============================================================================== --- vendor-sys/acpica/dist/source/components/utilities/utcache.c Mon Jan 28 20:25:27 2013 (r246038) +++ vendor-sys/acpica/dist/source/components/utilities/utcache.c Mon Jan 28 20:33:31 2013 (r246039) @@ -95,7 +95,6 @@ AcpiOsCreateCache ( /* Populate the cache object and return it */ ACPI_MEMSET (Cache, 0, sizeof (ACPI_MEMORY_LIST)); - Cache->LinkOffset = 8; Cache->ListName = CacheName; Cache->ObjectSize = ObjectSize; Cache->MaxDepth = MaxDepth; @@ -121,7 +120,7 @@ ACPI_STATUS AcpiOsPurgeCache ( ACPI_MEMORY_LIST *Cache) { - char *Next; + void *Next; ACPI_STATUS Status; @@ -145,8 +144,7 @@ AcpiOsPurgeCache ( { /* Delete and unlink one cached state object */ - Next = *(ACPI_CAST_INDIRECT_PTR (char, - &(((char *) Cache->ListHead)[Cache->LinkOffset]))); + Next = ACPI_GET_DESCRIPTOR_PTR (Cache->ListHead); ACPI_FREE (Cache->ListHead); Cache->ListHead = Next; @@ -251,8 +249,7 @@ AcpiOsReleaseObject ( /* Put the object at the head of the cache list */ - * (ACPI_CAST_INDIRECT_PTR (char, - &(((char *) Object)[Cache->LinkOffset]))) = Cache->ListHead; + ACPI_SET_DESCRIPTOR_PTR (Object, Cache->ListHead); Cache->ListHead = Object; Cache->CurrentDepth++; @@ -307,8 +304,7 @@ AcpiOsAcquireObject ( /* There is an object available, use it */ Object = Cache->ListHead; - Cache->ListHead = *(ACPI_CAST_INDIRECT_PTR (char, - &(((char *) Object)[Cache->LinkOffset]))); + Cache->ListHead = ACPI_GET_DESCRIPTOR_PTR (Object); Cache->CurrentDepth--; Modified: vendor-sys/acpica/dist/source/include/acmacros.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acmacros.h Mon Jan 28 20:25:27 2013 (r246038) +++ vendor-sys/acpica/dist/source/include/acmacros.h Mon Jan 28 20:33:31 2013 (r246039) @@ -325,10 +325,12 @@ * where a pointer to an object of type ACPI_OPERAND_OBJECT can also * appear. This macro is used to distinguish them. * - * The "Descriptor" field is the first field in both structures. + * The "DescriptorType" field is the second field in both structures. */ +#define ACPI_GET_DESCRIPTOR_PTR(d) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.CommonPointer) +#define ACPI_SET_DESCRIPTOR_PTR(d, p) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.CommonPointer = (p)) #define ACPI_GET_DESCRIPTOR_TYPE(d) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType) -#define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType = t) +#define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType = (t)) /* * Macros for the master AML opcode table Modified: vendor-sys/acpica/dist/source/include/actypes.h ============================================================================== --- vendor-sys/acpica/dist/source/include/actypes.h Mon Jan 28 20:25:27 2013 (r246038) +++ vendor-sys/acpica/dist/source/include/actypes.h Mon Jan 28 20:33:31 2013 (r246039) @@ -1226,7 +1226,6 @@ typedef struct acpi_memory_list UINT16 ObjectSize; UINT16 MaxDepth; UINT16 CurrentDepth; - UINT16 LinkOffset; #ifdef ACPI_DBG_TRACK_ALLOCATIONS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301282033.r0SKXWBc009365>