Fix a long standing bug. NextObject is the first field for very long time.
This commit is contained in:
parent
be6c1fe849
commit
a8e5af903d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor-sys/acpica/dist/; revision=246039
@ -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--;
|
||||
|
||||
|
@ -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
|
||||
|
@ -1226,7 +1226,6 @@ typedef struct acpi_memory_list
|
||||
UINT16 ObjectSize;
|
||||
UINT16 MaxDepth;
|
||||
UINT16 CurrentDepth;
|
||||
UINT16 LinkOffset;
|
||||
|
||||
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user