acpica-tools/0045-Correct-a-couple-of-endianness-issues-previously-uns.patch

87 lines
3.2 KiB
Diff
Raw Normal View History

From e942e785b3ec47693029e3841075becba31f2635 Mon Sep 17 00:00:00 2001
From: Al Stone <ahs3@redhat.com>
Date: Wed, 28 Oct 2020 12:53:34 -0600
Subject: [PATCH] Correct a couple of endianness issues previously unseen
Just odds and ends of some resource types and ASL analysis
Signed-off-by: Al Stone <ahs3@redhat.com>
---
source/compiler/aslanalyze.c | 4 ++--
source/compiler/aslrestype1.c | 16 ++++++++--------
source/compiler/aslrestype1i.c | 2 +-
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/source/compiler/aslanalyze.c b/source/compiler/aslanalyze.c
index 63feba2b1..f76a8c3cd 100644
--- a/source/compiler/aslanalyze.c
+++ b/source/compiler/aslanalyze.c
@@ -577,7 +577,7 @@ ApCheckForGpeNameConflict (
/* Need a null-terminated string version of NameSeg */
- ACPI_MOVE_32_TO_32 (Name, Op->Asl.NameSeg);
+ ACPI_COPY_NAMESEG (Name, Op->Asl.NameSeg);
Name[ACPI_NAMESEG_SIZE] = 0;
/*
@@ -604,7 +604,7 @@ ApCheckForGpeNameConflict (
* We are now sure we have an _Lxx or _Exx.
* Create the target name that would cause collision (Flip E/L)
*/
- ACPI_MOVE_32_TO_32 (Target, Name);
+ ACPI_COPY_NAMESEG (Target, Name);
/* Inject opposite letter ("L" versus "E") */
diff --git a/source/compiler/aslrestype1.c b/source/compiler/aslrestype1.c
index e7639c0bb..fd4428aab 100644
--- a/source/compiler/aslrestype1.c
+++ b/source/compiler/aslrestype1.c
@@ -328,10 +328,10 @@ RsDoMemory24Descriptor (
/* Validate the Min/Max/Len/Align values (Alignment==0 means 64K) */
RsSmallAddressCheck (ACPI_RESOURCE_NAME_MEMORY24,
- Descriptor->Memory24.Minimum,
- Descriptor->Memory24.Maximum,
- Descriptor->Memory24.AddressLength,
- Descriptor->Memory24.Alignment,
+ (UINT32) AcpiUtReadUint16(&Descriptor->Memory24.Minimum),
+ (UINT32) AcpiUtReadUint16(&Descriptor->Memory24.Maximum),
+ (UINT32) AcpiUtReadUint16(&Descriptor->Memory24.AddressLength),
+ (UINT32) AcpiUtReadUint16(&Descriptor->Memory24.Alignment),
MinOp, MaxOp, LengthOp, NULL, Info->DescriptorTypeOp);
return (Rnode);
@@ -442,10 +442,10 @@ RsDoMemory32Descriptor (
/* Validate the Min/Max/Len/Align values */
RsSmallAddressCheck (ACPI_RESOURCE_NAME_MEMORY32,
- Descriptor->Memory32.Minimum,
- Descriptor->Memory32.Maximum,
- Descriptor->Memory32.AddressLength,
- Descriptor->Memory32.Alignment,
+ AcpiUtReadUint32(&Descriptor->Memory32.Minimum),
+ AcpiUtReadUint32(&Descriptor->Memory32.Maximum),
+ AcpiUtReadUint32(&Descriptor->Memory32.AddressLength),
+ AcpiUtReadUint32(&Descriptor->Memory32.Alignment),
MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
return (Rnode);
diff --git a/source/compiler/aslrestype1i.c b/source/compiler/aslrestype1i.c
index 532553c4b..d41e3a1e8 100644
--- a/source/compiler/aslrestype1i.c
+++ b/source/compiler/aslrestype1i.c
@@ -436,7 +436,7 @@ RsDoFixedIoDescriptor (
/* Error checks */
- if (Descriptor->FixedIo.Address > 0x03FF)
+ if (AcpiUtReadUint16(&Descriptor->FixedIo.Address) > 0x03FF)
{
AslError (ASL_WARNING, ASL_MSG_ISA_ADDRESS, AddressOp, NULL);
}
--
2.26.2