Message ID | 20230630082847.100533-1-colin.i.king@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | ACPICA: Update to version 20230628 | expand |
Thanks! Acked-by: Ivan Hu <ivan.hu@canonical.com> On 6/30/23 16:28, Colin Ian King wrote: > Changes in this release of ACPICA are detailed on the ACPICA developer > mailing list for ACPICA 20230628 > > Signed-off-by: Colin Ian King <colin.i.king@gmail.com> > --- > src/acpica/source/common/ahpredef.c | 1 + > src/acpica/source/common/dmtable.c | 26 +++ > src/acpica/source/common/dmtbdump2.c | 83 ++++++++- > src/acpica/source/common/dmtbinfo1.c | 2 +- > src/acpica/source/common/dmtbinfo2.c | 173 +++++++++++++++++- > src/acpica/source/compiler/aslrestype2.c | 6 +- > src/acpica/source/compiler/dttable2.c | 67 ++++++- > src/acpica/source/compiler/dttemplate.h | 51 +++++- > .../source/components/debugger/dbcmds.c | 60 +++++- > .../source/components/debugger/dbinput.c | 10 +- > .../source/components/disassembler/dmresrcl.c | 2 +- > .../source/components/dispatcher/dswstate.c | 4 +- > src/acpica/source/components/events/evevent.c | 11 +- > .../source/components/executer/exserial.c | 3 +- > .../source/components/hardware/hwsleep.c | 11 -- > .../source/components/parser/psopcode.c | 2 +- > .../source/components/resources/rsaddr.c | 2 +- > .../source/components/resources/rscreate.c | 8 +- > .../source/components/resources/rsdumpinfo.c | 8 +- > .../source/components/resources/rsirq.c | 12 +- > .../source/components/utilities/utdebug.c | 5 + > .../source/components/utilities/utglobal.c | 1 - > src/acpica/source/include/acdebug.h | 4 + > src/acpica/source/include/acdisasm.h | 13 ++ > src/acpica/source/include/acglobal.h | 1 + > src/acpica/source/include/aclocal.h | 29 ++- > src/acpica/source/include/acnames.h | 1 + > src/acpica/source/include/acpixf.h | 2 +- > src/acpica/source/include/acpredef.h | 3 + > src/acpica/source/include/acrestyp.h | 8 +- > src/acpica/source/include/actbinfo.h | 15 +- > src/acpica/source/include/actbl1.h | 4 +- > src/acpica/source/include/actbl2.h | 81 +++++++- > src/acpica/source/include/actbl3.h | 4 +- > src/acpica/source/include/actypes.h | 3 +- > src/acpica/source/include/amlresrc.h | 2 +- > src/acpica/source/include/platform/aclinux.h | 1 + > src/acpica/source/tools/acpiexec/aeinstall.c | 118 +++++++++++- > 38 files changed, 740 insertions(+), 97 deletions(-) > > diff --git a/src/acpica/source/common/ahpredef.c b/src/acpica/source/common/ahpredef.c > index f4080587..a1f3a125 100644 > --- a/src/acpica/source/common/ahpredef.c > +++ b/src/acpica/source/common/ahpredef.c > @@ -234,6 +234,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = > AH_PREDEF ("_DMA", "Direct Memory Access", "Returns device current resources for DMA transactions, and resource field"), > AH_PREDEF ("_DOD", "Display Output Devices", "Enumerate all devices attached to the display adapter"), > AH_PREDEF ("_DOS", "Disable Output Switching", "Sets the display output switching mode"), > + AH_PREDEF ("_DSC", "Deepest State for Configuration", "Returns the deepest D-state of the device to the OSPM"), > AH_PREDEF ("_DPL", "Device Selection Polarity", "Polarity of Device Selection signal, Resource Descriptor field"), > AH_PREDEF ("_DRS", "Drive Strength", "Drive Strength setting for GPIO connection, Resource Descriptor field"), > AH_PREDEF ("_DSD", "Device-Specific Data", "Returns a list of device property information"), > diff --git a/src/acpica/source/common/dmtable.c b/src/acpica/source/common/dmtable.c > index 31ca7390..f0cc5b99 100644 > --- a/src/acpica/source/common/dmtable.c > +++ b/src/acpica/source/common/dmtable.c > @@ -430,6 +430,9 @@ static const char *AcpiDmMadtSubnames[] = > "Bridge I/O Interrupt Controller", /* ACPI_MADT_TYPE_BIO_PIC */ > "LPC Interrupt Controller", /* ACPI_MADT_TYPE_LPC_PIC */ > "RISC-V Interrupt Controller", /* ACPI_MADT_TYPE_RINTC */ > + "RISC-V Incoming MSI Controller", /* ACPI_MADT_TYPE_IMSIC */ > + "RISC-V APLIC Controller", /* ACPI_MADT_TYPE_APLIC */ > + "RISC-V PLIC Controller", /* ACPI_MADT_TYPE_PLIC */ > "Unknown Subtable Type", /* Reserved */ > "Types 80-FF are used for OEM data" /* Reserved for OEM data */ > }; > @@ -669,6 +672,14 @@ static const char *AcpiDmGasAccessWidth[] = > "Unknown Width Encoding" > }; > > +static const char *AcpiDmRhctSubnames[] = > +{ > + "RISC-V ISA string structure", /* ACPI_RHCT_ISA_STRING */ > + "RISC-V CMO node structure", /* ACPI_RHCT_CMO_NODE */ > + "RISC-V MMU node structure", /* ACPI_RHCT_MMU_NODE */ > + "RISC-V Hart Info structure", /* ACPI_RHCT_HART_INFO */ > +}; > + > > /******************************************************************************* > * > @@ -1190,6 +1201,7 @@ AcpiDmDumpTable ( > case ACPI_DMT_NFIT: > case ACPI_DMT_NHLT1e: > case ACPI_DMT_PHAT: > + case ACPI_DMT_RHCT: > > ByteLength = 2; > break; > @@ -2169,6 +2181,20 @@ AcpiDmDumpTable ( > AcpiDmRgrtSubnames[Temp8]); > break; > > + case ACPI_DMT_RHCT: > + > + /* RHCT subtable types */ > + > + Temp16 = ACPI_GET16 (Target); > + if (Temp16 == ACPI_RHCT_NODE_TYPE_HART_INFO) > + { > + Temp16 = ACPI_RHCT_NODE_TYPE_RESERVED; > + } > + > + AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), > + AcpiDmRhctSubnames[Temp16]); > + break; > + > case ACPI_DMT_SDEV: > > /* SDEV subtable types */ > diff --git a/src/acpica/source/common/dmtbdump2.c b/src/acpica/source/common/dmtbdump2.c > index e9c5dbfd..fd377cb2 100644 > --- a/src/acpica/source/common/dmtbdump2.c > +++ b/src/acpica/source/common/dmtbdump2.c > @@ -990,6 +990,61 @@ AcpiDmDumpMadt ( > InfoTable = AcpiDmTableInfoMadt16; > break; > > + case ACPI_MADT_TYPE_CORE_PIC: > + > + InfoTable = AcpiDmTableInfoMadt17; > + break; > + > + case ACPI_MADT_TYPE_LIO_PIC: > + > + InfoTable = AcpiDmTableInfoMadt18; > + break; > + > + case ACPI_MADT_TYPE_HT_PIC: > + > + InfoTable = AcpiDmTableInfoMadt19; > + break; > + > + case ACPI_MADT_TYPE_EIO_PIC: > + > + InfoTable = AcpiDmTableInfoMadt20; > + break; > + > + case ACPI_MADT_TYPE_MSI_PIC: > + > + InfoTable = AcpiDmTableInfoMadt21; > + break; > + > + case ACPI_MADT_TYPE_BIO_PIC: > + > + InfoTable = AcpiDmTableInfoMadt22; > + break; > + > + case ACPI_MADT_TYPE_LPC_PIC: > + > + InfoTable = AcpiDmTableInfoMadt23; > + break; > + > + case ACPI_MADT_TYPE_RINTC: > + > + InfoTable = AcpiDmTableInfoMadt24; > + break; > + > + case ACPI_MADT_TYPE_IMSIC: > + > + InfoTable = AcpiDmTableInfoMadt25; > + break; > + > + case ACPI_MADT_TYPE_APLIC: > + > + InfoTable = AcpiDmTableInfoMadt26; > + break; > + > + case ACPI_MADT_TYPE_PLIC: > + > + InfoTable = AcpiDmTableInfoMadt27; > + break; > + > default: > > if ((Subtable->Type >= ACPI_MADT_TYPE_RESERVED) && > @@ -1021,7 +1076,7 @@ AcpiDmDumpMadt ( > /* Dump the OEM data */ > > Status = AcpiDmDumpTable (Length, Offset, ACPI_CAST_PTR (UINT8, Table) + Offset, > - Subtable->Length - sizeof (ACPI_SUBTABLE_HEADER), AcpiDmTableInfoMadt17); > + Subtable->Length - sizeof (ACPI_SUBTABLE_HEADER), AcpiDmTableInfoMadt128); > if (ACPI_FAILURE (Status)) > { > return; > @@ -1058,16 +1113,16 @@ NextSubtable: > Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable, > Subtable->Length); > > - DbgPrint (ASL_PARSE_OUTPUT, "//[5) Next Subtable %p, length %X]\n", > - Subtable, Subtable->Length); > - DbgPrint (ASL_PARSE_OUTPUT, "//[5B) Offset from table start: 0x%8.8X%8.8X (%p)]\n", > - ACPI_FORMAT_UINT64 (ACPI_CAST_PTR (char, Subtable) - ACPI_CAST_PTR (char, Table)), Subtable); > - > Offset = ACPI_CAST_PTR (char, Subtable) - ACPI_CAST_PTR (char, Table); > if (Offset >= Table->Length) > { > return; > } > + > + DbgPrint (ASL_PARSE_OUTPUT, "//[5) Next Subtable %p, length %X]\n", > + Subtable, Subtable->Length); > + DbgPrint (ASL_PARSE_OUTPUT, "//[5B) Offset from table start: 0x%8.8X%8.8X (%p)]\n", > + ACPI_FORMAT_UINT64 (ACPI_CAST_PTR (char, Subtable) - ACPI_CAST_PTR (char, Table)), Subtable); > } > } > > @@ -2765,6 +2820,8 @@ AcpiDmDumpRhct ( > ACPI_RHCT_NODE_HEADER *Subtable; > ACPI_RHCT_HART_INFO *RhctHartInfo; > ACPI_RHCT_ISA_STRING *RhctIsaString; > + ACPI_RHCT_CMO_NODE *RhctCmoNode; > + ACPI_RHCT_MMU_NODE *RhctMmuNode; > UINT32 Length = Table->Length; > UINT8 SubtableOffset, IsaPadOffset; > UINT32 Offset = sizeof (ACPI_TABLE_RHCT); > @@ -2850,6 +2907,20 @@ AcpiDmDumpRhct ( > (Subtable->Length - IsaPadOffset), AcpiDmTableInfoRhctIsaPad); > } > > + break; > + > + case ACPI_RHCT_NODE_TYPE_CMO: > + RhctCmoNode = ACPI_ADD_PTR (ACPI_RHCT_CMO_NODE, Subtable, SubtableOffset); > + Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset, > + RhctCmoNode, 4, AcpiDmTableInfoRhctCmo1); > + break; > + > + case ACPI_RHCT_NODE_TYPE_MMU: > + RhctMmuNode = ACPI_ADD_PTR (ACPI_RHCT_MMU_NODE, Subtable, SubtableOffset); > + Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset, > + RhctMmuNode, 2, AcpiDmTableInfoRhctMmu1); > + break; > + > default: > break; > } > diff --git a/src/acpica/source/common/dmtbinfo1.c b/src/acpica/source/common/dmtbinfo1.c > index e4632085..11cf6715 100644 > --- a/src/acpica/source/common/dmtbinfo1.c > +++ b/src/acpica/source/common/dmtbinfo1.c > @@ -947,7 +947,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[] = > { > {ACPI_DMT_UINT24, ACPI_DMAR4_OFFSET (Reserved[0]), "Reserved", 0}, > {ACPI_DMT_UINT8, ACPI_DMAR4_OFFSET (DeviceNumber), "Device Number", 0}, > - {ACPI_DMT_STRING, ACPI_DMAR4_OFFSET (u.DeviceName[0]), "Device Name", 0}, > + {ACPI_DMT_STRING, ACPI_DMAR4_OFFSET (DeviceName[0]), "Device Name", 0}, > ACPI_DMT_TERMINATOR > }; > > diff --git a/src/acpica/source/common/dmtbinfo2.c b/src/acpica/source/common/dmtbinfo2.c > index 214206ad..bb961a6c 100644 > --- a/src/acpica/source/common/dmtbinfo2.c > +++ b/src/acpica/source/common/dmtbinfo2.c > @@ -678,8 +678,6 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[] = > {ACPI_DMT_UINT64, ACPI_LPIT0_OFFSET (CounterFrequency), "Counter Frequency", 0}, > ACPI_DMT_TERMINATOR > }; > - > - > /******************************************************************************* > * > * MADT - Multiple APIC Description Table and subtables > @@ -926,12 +924,155 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt16[] = > ACPI_DMT_TERMINATOR > }; > > -/* 17: OEM data structure */ > +/* 17: core interrupt controller */ > > ACPI_DMTABLE_INFO AcpiDmTableInfoMadt17[] = > +{ > + {ACPI_DMT_UINT8, ACPI_MADT17_OFFSET (Version), "Version", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT17_OFFSET (ProcessorId), "ProcessorId", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT17_OFFSET (CoreId), "CoreId", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT17_OFFSET (Flags), "Flags", 0}, > + ACPI_DMT_TERMINATOR > +}; > + > +/* 18: Legacy I/O interrupt controller */ > + > +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt18[] = > +{ > + {ACPI_DMT_UINT8, ACPI_MADT18_OFFSET (Version), "Version", 0}, > + {ACPI_DMT_UINT64, ACPI_MADT18_OFFSET (Address), "Address", 0}, > + {ACPI_DMT_UINT16, ACPI_MADT18_OFFSET (Size), "Size", 0}, > + {ACPI_DMT_UINT16, ACPI_MADT18_OFFSET (Cascade), "Cascade", 0}, > + {ACPI_DMT_UINT64, ACPI_MADT18_OFFSET (CascadeMap), "CascadeMap", 0}, > + ACPI_DMT_TERMINATOR > +}; > + > +/* 19: HT interrupt controller */ > + > +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt19[] = > +{ > + {ACPI_DMT_UINT8, ACPI_MADT19_OFFSET (Version), "Version", 0}, > + {ACPI_DMT_UINT64, ACPI_MADT19_OFFSET (Address), "Address", 0}, > + {ACPI_DMT_UINT16, ACPI_MADT19_OFFSET (Size), "Size", 0}, > + {ACPI_DMT_UINT64, ACPI_MADT19_OFFSET (Cascade), "Cascade", 0}, > + ACPI_DMT_TERMINATOR > +}; > + > +/* 20: Extend I/O interrupt controller */ > + > +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt20[] = > +{ > + {ACPI_DMT_UINT8, ACPI_MADT20_OFFSET (Version), "Version", 0}, > + {ACPI_DMT_UINT8, ACPI_MADT20_OFFSET (Cascade), "Cascade", 0}, > + {ACPI_DMT_UINT8, ACPI_MADT20_OFFSET (Node), "Node", 0}, > + {ACPI_DMT_UINT64, ACPI_MADT20_OFFSET (NodeMap), "NodeMap", 0}, > + ACPI_DMT_TERMINATOR > +}; > + > +/* 21: MSI controller */ > + > +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt21[] = > +{ > + {ACPI_DMT_UINT8, ACPI_MADT21_OFFSET (Version), "Version", 0}, > + {ACPI_DMT_UINT64, ACPI_MADT21_OFFSET (MsgAddress), "MsgAddress", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT21_OFFSET (Start), "Start", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT21_OFFSET (Count), "Count", 0}, > + ACPI_DMT_TERMINATOR > +}; > + > +/* 22: BIO interrupt controller */ > + > +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt22[] = > +{ > + {ACPI_DMT_UINT8, ACPI_MADT22_OFFSET (Version), "Version", 0}, > + {ACPI_DMT_UINT64, ACPI_MADT22_OFFSET (Address), "Address", 0}, > + {ACPI_DMT_UINT16, ACPI_MADT22_OFFSET (Size), "Size", 0}, > + {ACPI_DMT_UINT16, ACPI_MADT22_OFFSET (Id), "Id", 0}, > + {ACPI_DMT_UINT16, ACPI_MADT22_OFFSET (GsiBase), "GsiBase", 0}, > + ACPI_DMT_TERMINATOR > +}; > + > +/* 23: LPC interrupt controller */ > + > +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt23[] = > +{ > + {ACPI_DMT_UINT8, ACPI_MADT23_OFFSET (Version), "Version", 0}, > + {ACPI_DMT_UINT64, ACPI_MADT23_OFFSET (Address), "Address", 0}, > + {ACPI_DMT_UINT16, ACPI_MADT23_OFFSET (Size), "Size", 0}, > + {ACPI_DMT_UINT8, ACPI_MADT23_OFFSET (Cascade), "Cascade", 0}, > + ACPI_DMT_TERMINATOR > +}; > + > +/* 24: RINTC interrupt controller */ > + > +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt24[] = > +{ > + {ACPI_DMT_UINT8, ACPI_MADT24_OFFSET (Version), "Version", 0}, > + {ACPI_DMT_UINT8, ACPI_MADT24_OFFSET (Reserved), "Reserved", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT24_OFFSET (Flags), "Flags", 0}, > + {ACPI_DMT_UINT64, ACPI_MADT24_OFFSET (HartId), "HartId", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT24_OFFSET (Uid), "Uid", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT24_OFFSET (ExtIntcId), "ExtIntcId", 0}, > + {ACPI_DMT_UINT64, ACPI_MADT24_OFFSET (ImsicAddr), "ImsicAddr", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT24_OFFSET (ImsicSize), "ImsicSize", 0}, > + ACPI_DMT_TERMINATOR > +}; > + > +/* 25: RISC-V IMSIC interrupt controller */ > + > +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt25[] = > +{ > + {ACPI_DMT_UINT8, ACPI_MADT25_OFFSET (Version), "Version", 0}, > + {ACPI_DMT_UINT8, ACPI_MADT25_OFFSET (Reserved), "Reserved", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT25_OFFSET (Flags), "Flags", 0}, > + {ACPI_DMT_UINT16, ACPI_MADT25_OFFSET (NumIds), "NumIds", 0}, > + {ACPI_DMT_UINT16, ACPI_MADT25_OFFSET (NumGuestIds), "NumGuestIds", 0}, > + {ACPI_DMT_UINT8, ACPI_MADT25_OFFSET (GuestIndexBits), "GuestIndexBits", 0}, > + {ACPI_DMT_UINT8, ACPI_MADT25_OFFSET (HartIndexBits), "HartIndexBits", 0}, > + {ACPI_DMT_UINT8, ACPI_MADT25_OFFSET (GroupIndexBits), "GroupIndexBits", 0}, > + {ACPI_DMT_UINT8, ACPI_MADT25_OFFSET (GroupIndexShift), "GroupIndexShift", 0}, > + ACPI_DMT_TERMINATOR > +}; > + > +/* 26: RISC-V APLIC interrupt controller */ > + > +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt26[] = > +{ > + {ACPI_DMT_UINT8, ACPI_MADT26_OFFSET (Version), "Version", 0}, > + {ACPI_DMT_UINT8, ACPI_MADT26_OFFSET (Id), "Id", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT26_OFFSET (Flags), "Flags", 0}, > + {ACPI_DMT_UINT64, ACPI_MADT26_OFFSET (HwId), "HwId", 0}, > + {ACPI_DMT_UINT16, ACPI_MADT26_OFFSET (NumIdcs), "NumIdcs", 0}, > + {ACPI_DMT_UINT16, ACPI_MADT26_OFFSET (NumSources), "NumSources", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT26_OFFSET (GsiBase), "GsiBase", 0}, > + {ACPI_DMT_UINT64, ACPI_MADT26_OFFSET (BaseAddr), "BaseAddr", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT26_OFFSET (Size), "Size", 0}, > + ACPI_DMT_TERMINATOR > +}; > + > +/* 27: RISC-V PLIC interrupt controller */ > + > +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt27[] = > +{ > + {ACPI_DMT_UINT8, ACPI_MADT27_OFFSET (Version), "Version", 0}, > + {ACPI_DMT_UINT8, ACPI_MADT27_OFFSET (Id), "Id", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT27_OFFSET (Flags), "Flags", 0}, > + {ACPI_DMT_UINT64, ACPI_MADT27_OFFSET (HwId), "HwId", 0}, > + {ACPI_DMT_UINT16, ACPI_MADT27_OFFSET (NumIrqs), "NumIrqs", 0}, > + {ACPI_DMT_UINT16, ACPI_MADT27_OFFSET (MaxPrio), "MaxPrio", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT27_OFFSET (Flags), "Flags", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT27_OFFSET (Size), "Size", 0}, > + {ACPI_DMT_UINT64, ACPI_MADT27_OFFSET (BaseAddr), "BaseAddr", 0}, > + {ACPI_DMT_UINT32, ACPI_MADT27_OFFSET (GsiBase), "GsiBase", 0}, > + ACPI_DMT_TERMINATOR > +}; > + > +/* 128: OEM data structure */ > + > +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt128[] = > { > {ACPI_DMT_RAW_BUFFER, 0, "OEM Data", 0}, > - ACPI_DMT_TERMINATOR > + ACPI_DMT_TERMINATOR > }; > > /******************************************************************************* > @@ -2080,7 +2221,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoRgrt0[] = > > ACPI_DMTABLE_INFO AcpiDmTableInfoRhct[] = > { > - {ACPI_DMT_UINT32, ACPI_RHCT_OFFSET (Reserved), "Reserved", 0}, > + {ACPI_DMT_UINT32, ACPI_RHCT_OFFSET (Flags), "Flags", 0}, > {ACPI_DMT_UINT64, ACPI_RHCT_OFFSET (TimeBaseFreq), "Timer Base Frequency", 0}, > {ACPI_DMT_UINT32, ACPI_RHCT_OFFSET (NodeCount), "Number of nodes", 0}, > {ACPI_DMT_UINT32, ACPI_RHCT_OFFSET (NodeOffset), "Offset to the node array", 0}, > @@ -2092,7 +2233,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoRhct[] = > > ACPI_DMTABLE_INFO AcpiDmTableInfoRhctNodeHdr[] = > { > - {ACPI_DMT_UINT16, ACPI_RHCTH_OFFSET (Type), "Subtable Type", 0}, > + {ACPI_DMT_RHCT, ACPI_RHCTH_OFFSET (Type), "Subtable Type", 0}, > {ACPI_DMT_UINT16, ACPI_RHCTH_OFFSET (Length), "Length", 0}, > {ACPI_DMT_UINT16, ACPI_RHCTH_OFFSET (Revision), "Revision", 0}, > ACPI_DMT_TERMINATOR > @@ -2116,6 +2257,26 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoRhctIsaPad[] = > ACPI_DMT_TERMINATOR > }; > > +/* 1: CMO node type */ > + > +ACPI_DMTABLE_INFO AcpiDmTableInfoRhctCmo1[] = > +{ > + {ACPI_DMT_UINT8, ACPI_RHCT1_OFFSET (Reserved), "Reserved", 0}, > + {ACPI_DMT_UINT8, ACPI_RHCT1_OFFSET (CbomSize), "CBOM Block Size", 0}, > + {ACPI_DMT_UINT8, ACPI_RHCT1_OFFSET (CbopSize), "CBOP Block Size", 0}, > + {ACPI_DMT_UINT8, ACPI_RHCT1_OFFSET (CbozSize), "CBOZ Block Size", 0}, > + ACPI_DMT_TERMINATOR > +}; > + > +/* 2: MMU node type */ > + > +ACPI_DMTABLE_INFO AcpiDmTableInfoRhctMmu1[] = > +{ > + {ACPI_DMT_UINT8, ACPI_RHCT2_OFFSET (Reserved), "Reserved", 0}, > + {ACPI_DMT_UINT8, ACPI_RHCT2_OFFSET (MmuType), "MMU Type", 0}, > + ACPI_DMT_TERMINATOR > +}; > + > /* 0xFFFF: Hart Info type */ > > ACPI_DMTABLE_INFO AcpiDmTableInfoRhctHartInfo1[] = > diff --git a/src/acpica/source/compiler/aslrestype2.c b/src/acpica/source/compiler/aslrestype2.c > index bf6f77ed..6a1c1cbe 100644 > --- a/src/acpica/source/compiler/aslrestype2.c > +++ b/src/acpica/source/compiler/aslrestype2.c > @@ -337,7 +337,7 @@ RsDoInterruptDescriptor ( > Descriptor->ExtendedIrq.InterruptCount = 0; > > Rover = ACPI_CAST_PTR (AML_RESOURCE, > - (&(Descriptor->ExtendedIrq.u.Interrupts[0]))); > + (&(Descriptor->ExtendedIrq.Interrupts[0]))); > > /* Process all child initialization nodes */ > > @@ -466,7 +466,7 @@ RsDoInterruptDescriptor ( > > RsCreateDwordField (InitializerOp, ACPI_RESTAG_INTERRUPT, > CurrentByteOffset + > - ASL_RESDESC_OFFSET (ExtendedIrq.u.Interrupts[0])); > + ASL_RESDESC_OFFSET (ExtendedIrq.Interrupts[0])); > } > } > > @@ -494,7 +494,7 @@ RsDoInterruptDescriptor ( > } > > Rnode->BufferLength = > - (ASL_RESDESC_OFFSET (ExtendedIrq.u.Interrupts[0]) - > + (ASL_RESDESC_OFFSET (ExtendedIrq.Interrupts[0]) - > ASL_RESDESC_OFFSET (ExtendedIrq.DescriptorType)) > + OptionIndex + StringLength; > return (Rnode); > diff --git a/src/acpica/source/compiler/dttable2.c b/src/acpica/source/compiler/dttable2.c > index 007b6747..e0317f4c 100644 > --- a/src/acpica/source/compiler/dttable2.c > +++ b/src/acpica/source/compiler/dttable2.c > @@ -371,11 +371,66 @@ DtCompileMadt ( > InfoTable = AcpiDmTableInfoMadt16; > break; > > + case ACPI_MADT_TYPE_CORE_PIC: > + > + InfoTable = AcpiDmTableInfoMadt17; > + break; > + > + case ACPI_MADT_TYPE_LIO_PIC: > + > + InfoTable = AcpiDmTableInfoMadt18; > + break; > + > + case ACPI_MADT_TYPE_HT_PIC: > + > + InfoTable = AcpiDmTableInfoMadt19; > + break; > + > + case ACPI_MADT_TYPE_EIO_PIC: > + > + InfoTable = AcpiDmTableInfoMadt20; > + break; > + > + case ACPI_MADT_TYPE_MSI_PIC: > + > + InfoTable = AcpiDmTableInfoMadt21; > + break; > + > + case ACPI_MADT_TYPE_BIO_PIC: > + > + InfoTable = AcpiDmTableInfoMadt22; > + break; > + > + case ACPI_MADT_TYPE_LPC_PIC: > + > + InfoTable = AcpiDmTableInfoMadt23; > + break; > + > + case ACPI_MADT_TYPE_RINTC: > + > + InfoTable = AcpiDmTableInfoMadt24; > + break; > + > + case ACPI_MADT_TYPE_IMSIC: > + > + InfoTable = AcpiDmTableInfoMadt25; > + break; > + > + case ACPI_MADT_TYPE_APLIC: > + > + InfoTable = AcpiDmTableInfoMadt26; > + break; > + > + case ACPI_MADT_TYPE_PLIC: > + > + InfoTable = AcpiDmTableInfoMadt27; > + break; > + > default: > > if (MadtHeader->Type >= ACPI_MADT_TYPE_OEM_RESERVED) > { > - InfoTable = AcpiDmTableInfoMadt17; > + InfoTable = AcpiDmTableInfoMadt128; > } > else > { > @@ -2190,6 +2245,16 @@ DtCompileRhct ( > InfoTable = AcpiDmTableInfoRhctHartInfo1; > break; > > + case ACPI_RHCT_NODE_TYPE_CMO: > + > + InfoTable = AcpiDmTableInfoRhctCmo1; > + break; > + > + case ACPI_RHCT_NODE_TYPE_MMU: > + > + InfoTable = AcpiDmTableInfoRhctMmu1; > + break; > + > default: > > DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "RHCT"); > diff --git a/src/acpica/source/compiler/dttemplate.h b/src/acpica/source/compiler/dttemplate.h > index 755da402..c97a8ed2 100644 > --- a/src/acpica/source/compiler/dttemplate.h > +++ b/src/acpica/source/compiler/dttemplate.h > @@ -1128,11 +1128,11 @@ const unsigned char TemplateLpit[] = > > const unsigned char TemplateMadt[] = > { > - 0x41,0x50,0x49,0x43,0x6A,0x01,0x00,0x00, /* 00000000 "APICj..." */ > - 0x05,0x9D,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ > + 0x41,0x50,0x49,0x43,0x60,0x02,0x00,0x00, /* 00000000 "APIC...." */ > + 0x05,0x69,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ > 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ > 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ > - 0x13,0x11,0x20,0x20,0x00,0x00,0x00,0x00, /* 00000020 ".. ...." */ > + 0x31,0x03,0x22,0x20,0x00,0x00,0x00,0x00, /* 00000020 "1." ...." */ > 0x01,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000028 "........" */ > 0x01,0x00,0x00,0x00,0x01,0x0C,0x01,0x00, /* 00000030 "........" */ > 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ > @@ -1173,7 +1173,37 @@ const unsigned char TemplateMadt[] = > 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */ > 0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x00, /* 00000158 "........" */ > 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */ > - 0x00,0x00 /* 00000168 ".." */ > + 0x00,0x00,0x11,0x0F,0x01,0x01,0x00,0x00, /* 00000168 "........" */ > + 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 00000170 "........" */ > + 0x00,0x12,0x17,0x01,0x00,0x14,0xE0,0x1F, /* 00000178 "........" */ > + 0x00,0x00,0x00,0x00,0x80,0x00,0x02,0x03, /* 00000180 "........" */ > + 0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0xFF, /* 00000188 "........" */ > + 0x13,0x15,0x01,0x80,0x00,0x00,0xFB,0xFD, /* 00000190 "........" */ > + 0x0E,0x00,0x00,0x40,0x00,0x00,0x00,0x00, /* 00000198 "...@...." */ > + 0xFF,0x00,0x00,0x00,0x00,0x14,0x0D,0x01, /* 000001A0 "........" */ > + 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001A8 "........" */ > + 0x00,0x00,0x15,0x13,0x01,0x00,0x00,0xF0, /* 000001B0 "........" */ > + 0x2F,0x00,0x00,0x00,0x00,0x40,0x00,0x00, /* 000001B8 "/....@.." */ > + 0x00,0xC0,0x00,0x00,0x00,0x16,0x11,0x01, /* 000001C0 "........" */ > + 0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00, /* 000001C8 "........" */ > + 0x00,0x10,0x00,0x00,0x40,0x00,0x17,0x0E, /* 000001D0 "....@..." */ > + 0x01,0x00,0x20,0x00,0x10,0x00,0x00,0x00, /* 000001D8 ".. ....." */ > + 0x00,0x00,0x10,0x13,0x18,0x24,0x01,0x00, /* 000001E0 "........" */ > + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001E8 "........" */ > + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001F0 "........" */ > + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28, /* 000001F8 ".......(" */ > + 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 00000200 "........" */ > + 0x19,0x10,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000208 "........" */ > + 0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x18, /* 00000210 "........" */ > + 0x1A,0x24,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000218 ".$......" */ > + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000220 "........" */ > + 0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00, /* 00000228 "..`....." */ > + 0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x00, /* 00000230 "........" */ > + 0x00,0x80,0x00,0x00,0x1B,0x24,0x01,0x00, /* 00000238 ".....$.." */ > + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000240 "........" */ > + 0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000248 "`.....`." */ > + 0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x0C, /* 00000250 "..`....." */ > + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000258 "........" */ > }; > > const unsigned char TemplateMcfg[] = > @@ -1718,8 +1748,8 @@ const unsigned char TemplateRgrt[] = > > const unsigned char TemplateRhct[] = > { > - 0x52,0x48,0x43,0x54,0x7C,0x00,0x00,0x00, /* 00000000 "RHCT|..." */ > - 0x01,0x7D,0x4F,0x45,0x4D,0x43,0x41,0x00, /* 00000008 "..OEMCA." */ > + 0x52,0x48,0x43,0x54,0x96,0x00,0x00,0x00, /* 00000000 "RHCT|..." */ > + 0x01,0x24,0x4F,0x45,0x4D,0x43,0x41,0x00, /* 00000008 "..OEMCA." */ > 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ > 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ > 0x28,0x09,0x22,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ > @@ -1731,9 +1761,12 @@ const unsigned char TemplateRhct[] = > 0x72,0x5F,0x7A,0x69,0x66,0x65,0x6E,0x63, /* 00000050 "r_zifenc" */ > 0x65,0x69,0x5F,0x7A,0x62,0x61,0x5F,0x7A, /* 00000058 "ei_zba_z" */ > 0x62,0x62,0x5F,0x7A,0x62,0x63,0x5F,0x7A, /* 00000060 "bb_zbc_z" */ > - 0x62,0x73,0x00,0x00,0xFF,0xFF,0x10,0x00, /* 00000068 "bs......" */ > - 0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ > - 0x38,0x00,0x00,0x00 /* 00000078 "........" */ > + 0x62,0x73,0x00,0x00,0xFF,0xFF,0x18,0x00, /* 00000068 "bs......" */ > + 0x01,0x00,0x03,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ > + 0x38,0x00,0x00,0x00,0x7c,0x00,0x00,0x00, /* 00000078 "........" */ > + 0x8E,0x00,0x00,0x00,0x01,0x00,0x0A,0x00, /* 00000080 "........" */ > + 0x01,0x00,0x00,0x06,0x06,0x06,0x02,0x00, /* 00000088 "........" */ > + 0x08,0x00,0x01,0x00,0x00,0x02 /* 00000090 "........" */ > }; > > const unsigned char TemplateRsdp[] = > diff --git a/src/acpica/source/components/debugger/dbcmds.c b/src/acpica/source/components/debugger/dbcmds.c > index b8c2b422..6636f7b9 100644 > --- a/src/acpica/source/components/debugger/dbcmds.c > +++ b/src/acpica/source/components/debugger/dbcmds.c > @@ -156,7 +156,7 @@ > #include "acnamesp.h" > #include "acresrc.h" > #include "actables.h" > - > +#include "limits.h" > > #define _COMPONENT ACPI_CA_DEBUGGER > ACPI_MODULE_NAME ("dbcmds") > @@ -1291,6 +1291,64 @@ AcpiDbDisplayResources ( > } > > > +/******************************************************************************* > + * > + * FUNCTION: AcpiDbGenerateGed > + * > + * PARAMETERS: GedArg - Raw GED number, ascii string > + * > + * RETURN: None > + * > + * DESCRIPTION: Simulate firing of a GED > + * > + ******************************************************************************/ > + > +void > +AcpiDbGenerateInterrupt ( > + char *GsivArg) > +{ > + UINT32 GsivNumber; > + ACPI_GED_HANDLER_INFO *GedInfo = AcpiGbl_GedHandlerList; > + > + if (!GedInfo) { > + AcpiOsPrintf ("No GED handling present\n"); > + } > + > + GsivNumber = strtoul (GsivArg, NULL, 0); > + > + while (GedInfo) { > + > + if (GedInfo->IntId == GsivNumber) { > + ACPI_OBJECT_LIST ArgList; > + ACPI_OBJECT Arg0; > + ACPI_HANDLE EvtHandle = GedInfo->EvtMethod; > + ACPI_STATUS Status; > + > + AcpiOsPrintf ("Evaluate GED _EVT (GSIV=%d)\n", GsivNumber); > + > + if (!EvtHandle) { > + AcpiOsPrintf ("Undefined _EVT method\n"); > + return; > + } > + > + Arg0.Integer.Type = ACPI_TYPE_INTEGER; > + Arg0.Integer.Value = GsivNumber; > + > + ArgList.Count = 1; > + ArgList.Pointer = &Arg0; > + > + Status = AcpiEvaluateObject (EvtHandle, NULL, &ArgList, NULL); > + if (ACPI_FAILURE (Status)) > + { > + AcpiOsPrintf ("Could not evaluate _EVT\n"); > + return; > + } > + > + } > + GedInfo = GedInfo->Next; > + } > +} > + > #if (!ACPI_REDUCED_HARDWARE) > /******************************************************************************* > * > diff --git a/src/acpica/source/components/debugger/dbinput.c b/src/acpica/source/components/debugger/dbinput.c > index 5e5c6289..b5b131d4 100644 > --- a/src/acpica/source/components/debugger/dbinput.c > +++ b/src/acpica/source/components/debugger/dbinput.c > @@ -264,6 +264,7 @@ enum AcpiExDebuggerCommands > CMD_THREADS, > > CMD_TEST, > + CMD_INTERRUPT, > #endif > }; > > @@ -345,6 +346,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] = > {"THREADS", 3}, > > {"TEST", 1}, > + {"INTERRUPT", 1}, > #endif > {NULL, 0} > }; > @@ -389,7 +391,7 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = > {1, " Debug <Namepath> [Arguments]", "Single-Step a control method\n"}, > {7, " [Arguments] formats:", "Control method argument formats\n"}, > {1, " Hex Integer", "Integer\n"}, > - {1, " \"Ascii String\"", "String\n"}, > + {1, " \"ASCII String\"", "String\n"}, > {1, " (Hex Byte List)", "Buffer\n"}, > {1, " (01 42 7A BF)", "Buffer example (4 bytes)\n"}, > {1, " [Package Element List]", "Package\n"}, > @@ -461,6 +463,7 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = > {1, " Gpes", "Display info on all GPE devices\n"}, > {1, " Sci", "Generate an SCI\n"}, > {1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"}, > + {1, " Interrupt <GSIV>", "Simulate an interrupt\n"}, > #endif > {0, NULL, NULL} > }; > @@ -1263,6 +1266,11 @@ AcpiDbCommandDispatch ( > AcpiOsPrintf ("Event command not implemented\n"); > break; > > + case CMD_INTERRUPT: > + > + AcpiDbGenerateInterrupt (AcpiGbl_DbArgs[1]); > + break; > + > case CMD_GPE: > > AcpiDbGenerateGpe (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); > diff --git a/src/acpica/source/components/disassembler/dmresrcl.c b/src/acpica/source/components/disassembler/dmresrcl.c > index 88d19036..75cafe5d 100644 > --- a/src/acpica/source/components/disassembler/dmresrcl.c > +++ b/src/acpica/source/components/disassembler/dmresrcl.c > @@ -1112,7 +1112,7 @@ AcpiDmInterruptDescriptor ( > { > AcpiDmIndent (Level + 1); > AcpiOsPrintf ("0x%8.8X,\n", > - (UINT32) Resource->ExtendedIrq.u.Interrupts[i]); > + (UINT32) Resource->ExtendedIrq.Interrupts[i]); > } > > AcpiDmIndent (Level); > diff --git a/src/acpica/source/components/dispatcher/dswstate.c b/src/acpica/source/components/dispatcher/dswstate.c > index cc648e3a..e67de6bc 100644 > --- a/src/acpica/source/components/dispatcher/dswstate.c > +++ b/src/acpica/source/components/dispatcher/dswstate.c > @@ -310,8 +310,8 @@ AcpiDsResultPush ( > if (!Object) > { > ACPI_ERROR ((AE_INFO, > - "Null Object! Obj=%p State=%p Num=%u", > - Object, WalkState, WalkState->ResultCount)); > + "Null Object! State=%p Num=%u", > + WalkState, WalkState->ResultCount)); > return (AE_BAD_PARAMETER); > } > > diff --git a/src/acpica/source/components/events/evevent.c b/src/acpica/source/components/events/evevent.c > index 913cbd14..b7f6692a 100644 > --- a/src/acpica/source/components/events/evevent.c > +++ b/src/acpica/source/components/events/evevent.c > @@ -312,8 +312,7 @@ AcpiEvFixedEventInitialize ( > { > Status = AcpiWriteBitRegister ( > AcpiGbl_FixedEventInfo[i].EnableRegisterId, > - (i == ACPI_EVENT_PCIE_WAKE) ? > - ACPI_ENABLE_EVENT : ACPI_DISABLE_EVENT); > + ACPI_DISABLE_EVENT); > if (ACPI_FAILURE (Status)) > { > return (Status); > @@ -362,11 +361,6 @@ AcpiEvFixedEventDetect ( > return (IntStatus); > } > > - if (FixedEnable & ACPI_BITMASK_PCIEXP_WAKE_DISABLE) > - FixedEnable &= ~ACPI_BITMASK_PCIEXP_WAKE_DISABLE; > - else > - FixedEnable |= ACPI_BITMASK_PCIEXP_WAKE_DISABLE; > - > ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, > "Fixed Event Block: Enable %08X Status %08X\n", > FixedEnable, FixedStatus)); > @@ -437,8 +431,7 @@ AcpiEvFixedEventDispatch ( > { > (void) AcpiWriteBitRegister ( > AcpiGbl_FixedEventInfo[Event].EnableRegisterId, > - (Event == ACPI_EVENT_PCIE_WAKE) ? > - ACPI_ENABLE_EVENT : ACPI_DISABLE_EVENT); > + ACPI_DISABLE_EVENT); > > ACPI_ERROR ((AE_INFO, > "No installed handler for fixed event - %s (%u), disabling", > diff --git a/src/acpica/source/components/executer/exserial.c b/src/acpica/source/components/executer/exserial.c > index 6d57e376..f51047f9 100644 > --- a/src/acpica/source/components/executer/exserial.c > +++ b/src/acpica/source/components/executer/exserial.c > @@ -505,8 +505,7 @@ AcpiExWriteSerialBus ( > /* Copy the input buffer data to the transfer buffer */ > > Buffer = BufferDesc->Buffer.Pointer; > - DataLength = (BufferLength < SourceDesc->Buffer.Length ? > - BufferLength : SourceDesc->Buffer.Length); > + DataLength = ACPI_MIN (BufferLength, SourceDesc->Buffer.Length); > memcpy (Buffer, SourceDesc->Buffer.Pointer, DataLength); > > /* Lock entire transaction if requested */ > diff --git a/src/acpica/source/components/hardware/hwsleep.c b/src/acpica/source/components/hardware/hwsleep.c > index d9bb8ae0..0e4e17a0 100644 > --- a/src/acpica/source/components/hardware/hwsleep.c > +++ b/src/acpica/source/components/hardware/hwsleep.c > @@ -475,17 +475,6 @@ AcpiHwLegacyWake ( > AcpiGbl_FixedEventInfo[ACPI_EVENT_SLEEP_BUTTON].StatusRegisterId, > ACPI_CLEAR_STATUS); > > - /* Enable pcie wake event if support */ > - if ((AcpiGbl_FADT.Flags & ACPI_FADT_PCI_EXPRESS_WAKE)) > - { > - (void) AcpiWriteBitRegister ( > - AcpiGbl_FixedEventInfo[ACPI_EVENT_PCIE_WAKE].EnableRegisterId, > - ACPI_DISABLE_EVENT); > - (void) AcpiWriteBitRegister ( > - AcpiGbl_FixedEventInfo[ACPI_EVENT_PCIE_WAKE].StatusRegisterId, > - ACPI_CLEAR_STATUS); > - } > - > AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING); > return_ACPI_STATUS (Status); > } > diff --git a/src/acpica/source/components/parser/psopcode.c b/src/acpica/source/components/parser/psopcode.c > index db0c2e47..a161fa45 100644 > --- a/src/acpica/source/components/parser/psopcode.c > +++ b/src/acpica/source/components/parser/psopcode.c > @@ -436,7 +436,7 @@ const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] = > > /* ACPI 3.0 opcodes */ > > -/* 7E */ ACPI_OP ("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R, AML_FLAGS_EXEC_0A_0T_1R), > +/* 7E */ ACPI_OP ("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R, AML_FLAGS_EXEC_0A_0T_1R | AML_NO_OPERAND_RESOLVE), > > /* ACPI 5.0 opcodes */ > > diff --git a/src/acpica/source/components/resources/rsaddr.c b/src/acpica/source/components/resources/rsaddr.c > index beee8380..8bad02dd 100644 > --- a/src/acpica/source/components/resources/rsaddr.c > +++ b/src/acpica/source/components/resources/rsaddr.c > @@ -431,11 +431,11 @@ AcpiRsGetAddressCommon ( > ACPI_RESOURCE *Resource, > AML_RESOURCE *Aml) > { > + > /* Avoid undefined behavior: member access within misaligned address */ > > AML_RESOURCE_ADDRESS Address; > memcpy(&Address, Aml, sizeof(Address)); > - > ACPI_FUNCTION_ENTRY(); > > /* Validate the Resource Type */ > diff --git a/src/acpica/source/components/resources/rscreate.c b/src/acpica/source/components/resources/rscreate.c > index 583abe1a..da0967ee 100644 > --- a/src/acpica/source/components/resources/rscreate.c > +++ b/src/acpica/source/components/resources/rscreate.c > @@ -475,9 +475,9 @@ AcpiRsCreatePciRoutingTable ( > /* Use *remaining* length of the buffer as max for pathname */ > > PathBuffer.Length = OutputBuffer->Length - > - (UINT32) ((UINT8 *) UserPrt->u.Source - > + (UINT32) ((UINT8 *) UserPrt->Source - > (UINT8 *) OutputBuffer->Pointer); > - PathBuffer.Pointer = UserPrt->u.Source; > + PathBuffer.Pointer = UserPrt->Source; > > Status = AcpiNsHandleToPathname ( > (ACPI_HANDLE) Node, &PathBuffer, FALSE); > @@ -488,12 +488,12 @@ AcpiRsCreatePciRoutingTable ( > > /* +1 to include null terminator */ > > - UserPrt->Length += (UINT32) strlen (UserPrt->u.Source) + 1; > + UserPrt->Length += (UINT32) strlen (UserPrt->Source) + 1; > break; > > case ACPI_TYPE_STRING: > > - strcpy (UserPrt->u.Source, ObjDesc->String.Pointer); > + strcpy (UserPrt->Source, ObjDesc->String.Pointer); > > /* > * Add to the Length field the length of the string > diff --git a/src/acpica/source/components/resources/rsdumpinfo.c b/src/acpica/source/components/resources/rsdumpinfo.c > index 2801e0d7..f15b7b98 100644 > --- a/src/acpica/source/components/resources/rsdumpinfo.c > +++ b/src/acpica/source/components/resources/rsdumpinfo.c > @@ -182,7 +182,7 @@ ACPI_RSDUMP_INFO AcpiRsDumpIrq[7] = > {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Polarity), "Polarity", AcpiGbl_LlDecode}, > {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Irq.Shareable), "Sharing", AcpiGbl_ShrDecode}, > {ACPI_RSD_UINT8 , ACPI_RSD_OFFSET (Irq.InterruptCount), "Interrupt Count", NULL}, > - {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Irq.u.Interrupts[0]), "Interrupt List", NULL} > + {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Irq.Interrupts[0]), "Interrupt List", NULL} > }; > > ACPI_RSDUMP_INFO AcpiRsDumpDma[6] = > @@ -192,7 +192,7 @@ ACPI_RSDUMP_INFO AcpiRsDumpDma[6] = > {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Dma.BusMaster), "Mastering", AcpiGbl_BmDecode}, > {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Dma.Transfer), "Transfer Type", AcpiGbl_SizDecode}, > {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Dma.ChannelCount), "Channel Count", NULL}, > - {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Dma.u.Channels[0]), "Channel List", NULL} > + {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Dma.Channels[0]), "Channel List", NULL} > }; > > ACPI_RSDUMP_INFO AcpiRsDumpStartDpf[4] = > @@ -327,7 +327,7 @@ ACPI_RSDUMP_INFO AcpiRsDumpExtIrq[8] = > {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Shareable), "Sharing", AcpiGbl_ShrDecode}, > {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (ExtendedIrq.ResourceSource), NULL, NULL}, > {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (ExtendedIrq.InterruptCount), "Interrupt Count", NULL}, > - {ACPI_RSD_DWORDLIST,ACPI_RSD_OFFSET (ExtendedIrq.u.Interrupts[0]), "Interrupt List", NULL} > + {ACPI_RSD_DWORDLIST,ACPI_RSD_OFFSET (ExtendedIrq.Interrupts[0]), "Interrupt List", NULL} > }; > > ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[6] = > @@ -555,7 +555,7 @@ ACPI_RSDUMP_INFO AcpiRsDumpPrt[5] = > {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPrt), NULL, NULL}, > {ACPI_RSD_UINT64, ACPI_PRT_OFFSET (Address), "Address", NULL}, > {ACPI_RSD_UINT32, ACPI_PRT_OFFSET (Pin), "Pin", NULL}, > - {ACPI_RSD_STRING, ACPI_PRT_OFFSET (u.Source[0]), "Source", NULL}, > + {ACPI_RSD_STRING, ACPI_PRT_OFFSET (Source[0]), "Source", NULL}, > {ACPI_RSD_UINT32, ACPI_PRT_OFFSET (SourceIndex), "Source Index", NULL} > }; > > diff --git a/src/acpica/source/components/resources/rsirq.c b/src/acpica/source/components/resources/rsirq.c > index 10256c50..c2d306aa 100644 > --- a/src/acpica/source/components/resources/rsirq.c > +++ b/src/acpica/source/components/resources/rsirq.c > @@ -171,7 +171,7 @@ ACPI_RSCONVERT_INFO AcpiRsGetIrq[9] = > > /* Get the IRQ mask (bytes 1:2) */ > > - {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.u.Interrupts[0]), > + {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.Interrupts[0]), > AML_OFFSET (Irq.IrqMask), > ACPI_RS_OFFSET (Data.Irq.InterruptCount)}, > > @@ -227,7 +227,7 @@ ACPI_RSCONVERT_INFO AcpiRsSetIrq[14] = > > /* Convert interrupt list to 16-bit IRQ bitmask */ > > - {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.u.Interrupts[0]), > + {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.Interrupts[0]), > AML_OFFSET (Irq.IrqMask), > ACPI_RS_OFFSET (Data.Irq.InterruptCount)}, > > @@ -345,14 +345,14 @@ ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[10] = > > /* Copy every IRQ in the table, each is 32 bits */ > > - {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.ExtendedIrq.u.Interrupts[0]), > - AML_OFFSET (ExtendedIrq.u.Interrupts[0]), > + {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.ExtendedIrq.Interrupts[0]), > + AML_OFFSET (ExtendedIrq.Interrupts[0]), > 0}, > > /* Optional ResourceSource (Index and String) */ > > {ACPI_RSC_SOURCEX, ACPI_RS_OFFSET (Data.ExtendedIrq.ResourceSource), > - ACPI_RS_OFFSET (Data.ExtendedIrq.u.Interrupts[0]), > + ACPI_RS_OFFSET (Data.ExtendedIrq.Interrupts[0]), > sizeof (AML_RESOURCE_EXTENDED_IRQ)} > }; > > @@ -389,7 +389,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertDma[6] = > > /* DMA channel mask bits */ > > - {ACPI_RSC_BITMASK, ACPI_RS_OFFSET (Data.Dma.u.Channels[0]), > + {ACPI_RSC_BITMASK, ACPI_RS_OFFSET (Data.Dma.Channels[0]), > AML_OFFSET (Dma.DmaChannelMask), > ACPI_RS_OFFSET (Data.Dma.ChannelCount)} > }; > diff --git a/src/acpica/source/components/utilities/utdebug.c b/src/acpica/source/components/utilities/utdebug.c > index b0c3640f..82e8a620 100644 > --- a/src/acpica/source/components/utilities/utdebug.c > +++ b/src/acpica/source/components/utilities/utdebug.c > @@ -185,7 +185,12 @@ AcpiUtInitStackPtrTrace ( > ACPI_SIZE CurrentSp; > > > +#pragma GCC diagnostic push > +#if defined(__GNUC__) && __GNUC__ >= 12 > +#pragma GCC diagnostic ignored "-Wdangling-pointer=" > +#endif > AcpiGbl_EntryStackPointer = &CurrentSp; > +#pragma GCC diagnostic pop > } > > > diff --git a/src/acpica/source/components/utilities/utglobal.c b/src/acpica/source/components/utilities/utglobal.c > index 28e4c341..c3b3688b 100644 > --- a/src/acpica/source/components/utilities/utglobal.c > +++ b/src/acpica/source/components/utilities/utglobal.c > @@ -287,7 +287,6 @@ ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] = > /* ACPI_EVENT_POWER_BUTTON */ {ACPI_BITREG_POWER_BUTTON_STATUS, ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_ENABLE}, > /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, > /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE}, > - /* ACPI_EVENT_PCIE_WAKE */ {ACPI_BITREG_PCIEXP_WAKE_STATUS, ACPI_BITREG_PCIEXP_WAKE_DISABLE, ACPI_BITMASK_PCIEXP_WAKE_STATUS, ACPI_BITMASK_PCIEXP_WAKE_DISABLE}, > }; > #endif /* !ACPI_REDUCED_HARDWARE */ > > diff --git a/src/acpica/source/include/acdebug.h b/src/acpica/source/include/acdebug.h > index c1596ee8..054de129 100644 > --- a/src/acpica/source/include/acdebug.h > +++ b/src/acpica/source/include/acdebug.h > @@ -619,4 +619,8 @@ AcpiDbUint32ToHexString ( > UINT32 Value, > char *Buffer); > > +void > +AcpiDbGenerateInterrupt ( > + char *GsivArg); > + > #endif /* __ACDEBUG_H__ */ > diff --git a/src/acpica/source/include/acdisasm.h b/src/acpica/source/include/acdisasm.h > index afc9034b..6f37d355 100644 > --- a/src/acpica/source/include/acdisasm.h > +++ b/src/acpica/source/include/acdisasm.h > @@ -554,6 +554,17 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt14[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt15[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt16[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt17[]; > +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt18[]; > +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt19[]; > +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt20[]; > +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt21[]; > +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt22[]; > +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt23[]; > +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt24[]; > +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt25[]; > +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt26[]; > +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt27[]; > +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt128[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[]; > @@ -646,6 +657,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhct[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctNodeHdr[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctIsa1[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctIsaPad[]; > +extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctCmo1[]; > +extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctMmu1[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctHartInfo1[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctHartInfo2[]; > extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[]; > diff --git a/src/acpica/source/include/acglobal.h b/src/acpica/source/include/acglobal.h > index 28fc6514..9df72a57 100644 > --- a/src/acpica/source/include/acglobal.h > +++ b/src/acpica/source/include/acglobal.h > @@ -268,6 +268,7 @@ ACPI_GLOBAL (ACPI_TABLE_HANDLER, AcpiGbl_TableHandler); > ACPI_GLOBAL (void *, AcpiGbl_TableHandlerContext); > ACPI_GLOBAL (ACPI_INTERFACE_HANDLER, AcpiGbl_InterfaceHandler); > ACPI_GLOBAL (ACPI_SCI_HANDLER_INFO *, AcpiGbl_SciHandlerList); > +ACPI_GLOBAL (ACPI_GED_HANDLER_INFO *, AcpiGbl_GedHandlerList); > > /* Owner ID support */ > > diff --git a/src/acpica/source/include/aclocal.h b/src/acpica/source/include/aclocal.h > index 9c090a07..99459a8b 100644 > --- a/src/acpica/source/include/aclocal.h > +++ b/src/acpica/source/include/aclocal.h > @@ -767,6 +767,15 @@ typedef struct acpi_field_info > > } ACPI_FIELD_INFO; > > +/* Information about the interrupt ID and _EVT of a GED device */ > + > +typedef struct acpi_ged_handler_info > +{ > + struct acpi_ged_handler_info *Next; > + UINT32 IntId; /* The interrupt ID that triggers the execution ofthe EvtMethod. */ > + ACPI_NAMESPACE_NODE *EvtMethod; /* The _EVT method to be executed when an interrupt with ID = IntID is received */ > + > +} ACPI_GED_HANDLER_INFO; > > /***************************************************************************** > * > @@ -786,13 +795,13 @@ typedef struct acpi_field_info > UINT8 DescriptorType; /* To differentiate various internal objs */\ > UINT8 Flags; \ > UINT16 Value; \ > - UINT16 State; > + UINT16 State > > /* There are 2 bytes available here until the next natural alignment boundary */ > > typedef struct acpi_common_state > { > - ACPI_STATE_COMMON > + ACPI_STATE_COMMON; > } ACPI_COMMON_STATE; > > > @@ -801,7 +810,7 @@ typedef struct acpi_common_state > */ > typedef struct acpi_update_state > { > - ACPI_STATE_COMMON > + ACPI_STATE_COMMON; > union acpi_operand_object *Object; > > } ACPI_UPDATE_STATE; > @@ -812,7 +821,7 @@ typedef struct acpi_update_state > */ > typedef struct acpi_pkg_state > { > - ACPI_STATE_COMMON > + ACPI_STATE_COMMON; > UINT32 Index; > union acpi_operand_object *SourceObject; > union acpi_operand_object *DestObject; > @@ -829,7 +838,7 @@ typedef struct acpi_pkg_state > */ > typedef struct acpi_control_state > { > - ACPI_STATE_COMMON > + ACPI_STATE_COMMON; > UINT16 Opcode; > union acpi_parse_object *PredicateOp; > UINT8 *AmlPredicateStart; /* Start of if/while predicate */ > @@ -844,7 +853,7 @@ typedef struct acpi_control_state > */ > typedef struct acpi_scope_state > { > - ACPI_STATE_COMMON > + ACPI_STATE_COMMON; > ACPI_NAMESPACE_NODE *Node; > > } ACPI_SCOPE_STATE; > @@ -852,7 +861,7 @@ typedef struct acpi_scope_state > > typedef struct acpi_pscope_state > { > - ACPI_STATE_COMMON > + ACPI_STATE_COMMON; > UINT32 ArgCount; /* Number of fixed arguments */ > union acpi_parse_object *Op; /* Current op being parsed */ > UINT8 *ArgEnd; /* Current argument end */ > @@ -868,7 +877,7 @@ typedef struct acpi_pscope_state > */ > typedef struct acpi_thread_state > { > - ACPI_STATE_COMMON > + ACPI_STATE_COMMON; > UINT8 CurrentSyncLevel; /* Mutex Sync (nested acquire) level */ > struct acpi_walk_state *WalkStateList; /* Head of list of WalkStates for this thread */ > union acpi_operand_object *AcquiredMutexList; /* List of all currently acquired mutexes */ > @@ -883,7 +892,7 @@ typedef struct acpi_thread_state > */ > typedef struct acpi_result_values > { > - ACPI_STATE_COMMON > + ACPI_STATE_COMMON; > union acpi_operand_object *ObjDesc [ACPI_RESULTS_FRAME_OBJ_NUM]; > > } ACPI_RESULT_VALUES; > @@ -914,7 +923,7 @@ typedef struct acpi_global_notify_handler > */ > typedef struct acpi_notify_info > { > - ACPI_STATE_COMMON > + ACPI_STATE_COMMON; > UINT8 HandlerListId; > ACPI_NAMESPACE_NODE *Node; > union acpi_operand_object *HandlerListHead; > diff --git a/src/acpica/source/include/acnames.h b/src/acpica/source/include/acnames.h > index a6cdd2e2..e9f0af8c 100644 > --- a/src/acpica/source/include/acnames.h > +++ b/src/acpica/source/include/acnames.h > @@ -164,6 +164,7 @@ > #define METHOD_NAME__DDN "_DDN" > #define METHOD_NAME__DIS "_DIS" > #define METHOD_NAME__DMA "_DMA" > +#define METHOD_NAME__EVT "_EVT" > #define METHOD_NAME__HID "_HID" > #define METHOD_NAME__INI "_INI" > #define METHOD_NAME__PLD "_PLD" > diff --git a/src/acpica/source/include/acpixf.h b/src/acpica/source/include/acpixf.h > index a7d61033..c8e3b4c4 100644 > --- a/src/acpica/source/include/acpixf.h > +++ b/src/acpica/source/include/acpixf.h > @@ -154,7 +154,7 @@ > > /* Current ACPICA subsystem version in YYYYMMDD format */ > > -#define ACPI_CA_VERSION 0x20230331 > +#define ACPI_CA_VERSION 0x20230628 > > #include "acconfig.h" > #include "actypes.h" > diff --git a/src/acpica/source/include/acpredef.h b/src/acpica/source/include/acpredef.h > index ca47e7cc..303dfaec 100644 > --- a/src/acpica/source/include/acpredef.h > +++ b/src/acpica/source/include/acpredef.h > @@ -579,6 +579,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = > > {{"_DOS", METHOD_1ARGS (ACPI_TYPE_INTEGER), > METHOD_NO_RETURN_VALUE}}, > + > + { {"_DSC", METHOD_0ARGS, > + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, > > {{"_DSD", METHOD_0ARGS, /* ACPI 6.0 */ > METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: 1 Buf, 1 Pkg */ > diff --git a/src/acpica/source/include/acrestyp.h b/src/acpica/source/include/acrestyp.h > index 3065bdce..0dab6ec7 100644 > --- a/src/acpica/source/include/acrestyp.h > +++ b/src/acpica/source/include/acrestyp.h > @@ -293,7 +293,7 @@ typedef struct acpi_resource_irq > union { > UINT8 Interrupt; > ACPI_FLEX_ARRAY(UINT8, Interrupts); > - } u; > + }; > > } ACPI_RESOURCE_IRQ; > > @@ -306,7 +306,7 @@ typedef struct acpi_resource_dma > union { > UINT8 Channel; > ACPI_FLEX_ARRAY(UINT8, Channels); > - } u; > + }; > > } ACPI_RESOURCE_DMA; > > @@ -547,7 +547,7 @@ typedef struct acpi_resource_extended_irq > union { > UINT32 Interrupt; > ACPI_FLEX_ARRAY(UINT32, Interrupts); > - } u; > + }; > > } ACPI_RESOURCE_EXTENDED_IRQ; > > @@ -951,7 +951,7 @@ typedef struct acpi_pci_routing_table > union { > char Pad[4]; /* pad to 64 bits so sizeof() works in all cases */ > ACPI_FLEX_ARRAY(char, Source); > - } u; > + }; > } ACPI_PCI_ROUTING_TABLE; > > #endif /* __ACRESTYP_H__ */ > diff --git a/src/acpica/source/include/actbinfo.h b/src/acpica/source/include/actbinfo.h > index 5417aff4..e0ad61bb 100644 > --- a/src/acpica/source/include/actbinfo.h > +++ b/src/acpica/source/include/actbinfo.h > @@ -334,7 +334,18 @@ > #define ACPI_MADT14_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_REDISTRIBUTOR,f) > #define ACPI_MADT15_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_TRANSLATOR,f) > #define ACPI_MADT16_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_MULTIPROC_WAKEUP,f) > -#define ACPI_MADT17_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_OEM_DATA,f) > +#define ACPI_MADT17_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_CORE_PIC,f) > +#define ACPI_MADT18_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LIO_PIC,f) > +#define ACPI_MADT19_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_HT_PIC,f) > +#define ACPI_MADT20_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_EIO_PIC,f) > +#define ACPI_MADT21_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_MSI_PIC,f) > +#define ACPI_MADT22_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_BIO_PIC,f) > +#define ACPI_MADT23_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LPC_PIC,f) > +#define ACPI_MADT24_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_RINTC,f) > +#define ACPI_MADT25_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_IMSIC,f) > +#define ACPI_MADT26_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_APLIC,f) > +#define ACPI_MADT27_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_PLIC,f) > +#define ACPI_MADT128_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_OEM_DATA,f) > #define ACPI_MADTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) > #define ACPI_MCFG0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f) > #define ACPI_MPAM0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPAM_MSC_NODE,f) > @@ -403,6 +414,8 @@ > #define ACPI_PRMT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PRMT_HANDLER_INFO,f) > #define ACPI_RHCTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RHCT_NODE_HEADER,f) > #define ACPI_RHCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RHCT_ISA_STRING,f) > +#define ACPI_RHCT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RHCT_CMO_NODE,f) > +#define ACPI_RHCT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RHCT_MMU_NODE,f) > #define ACPI_RHCTFFFF_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RHCT_HART_INFO,f) > #define ACPI_S3PTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f) > #define ACPI_S3PT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_RESUME,f) > diff --git a/src/acpica/source/include/actbl1.h b/src/acpica/source/include/actbl1.h > index 1b115ae3..c1a960ac 100644 > --- a/src/acpica/source/include/actbl1.h > +++ b/src/acpica/source/include/actbl1.h > @@ -635,7 +635,7 @@ typedef struct acpi_cdat_dsmas > > /* Flags for subtable above */ > > -#define ACPI_CEDT_DSMAS_NON_VOLATILE (1 << 2) > +#define ACPI_CDAT_DSMAS_NON_VOLATILE (1 << 2) > > > /* Subtable 1: Device scoped Latency and Bandwidth Information Structure (DSLBIS) */ > @@ -1222,7 +1222,7 @@ typedef struct acpi_dmar_andd > union { > char __pad; > ACPI_FLEX_ARRAY(char, DeviceName); > - } u; > + }; > > } ACPI_DMAR_ANDD; > > diff --git a/src/acpica/source/include/actbl2.h b/src/acpica/source/include/actbl2.h > index 9b2812a0..140b386f 100644 > --- a/src/acpica/source/include/actbl2.h > +++ b/src/acpica/source/include/actbl2.h > @@ -1136,7 +1136,10 @@ enum AcpiMadtType > ACPI_MADT_TYPE_BIO_PIC = 22, > ACPI_MADT_TYPE_LPC_PIC = 23, > ACPI_MADT_TYPE_RINTC = 24, > - ACPI_MADT_TYPE_RESERVED = 25, /* 25 to 0x7F are reserved */ > + ACPI_MADT_TYPE_IMSIC = 25, > + ACPI_MADT_TYPE_APLIC = 26, > + ACPI_MADT_TYPE_PLIC = 27, > + ACPI_MADT_TYPE_RESERVED = 28, /* 28 to 0x7F are reserved */ > ACPI_MADT_TYPE_OEM_RESERVED = 0x80 /* 0x80 to 0xFF are reserved for OEM use */ > }; > > @@ -1550,14 +1553,17 @@ enum AcpiMadtLpcPicVersion { > }; > > /* 24: RISC-V INTC */ > -struct acpi_madt_rintc { > +typedef struct acpi_madt_rintc { > ACPI_SUBTABLE_HEADER Header; > UINT8 Version; > UINT8 Reserved; > UINT32 Flags; > UINT64 HartId; > UINT32 Uid; /* ACPI processor UID */ > -}; > + UINT32 ExtIntcId; /* External INTC Id */ > + UINT64 ImsicAddr; /* IMSIC base address */ > + UINT32 ImsicSize; /* IMSIC size */ > +} ACPI_MADT_RINTC; > > /* Values for RISC-V INTC Version field above */ > > @@ -1567,6 +1573,49 @@ enum AcpiMadtRintcVersion { > ACPI_MADT_RINTC_VERSION_RESERVED = 2 /* 2 and greater are reserved */ > }; > > +/* 25: RISC-V IMSIC */ > +typedef struct acpi_madt_imsic { > + ACPI_SUBTABLE_HEADER Header; > + UINT8 Version; > + UINT8 Reserved; > + UINT32 Flags; > + UINT16 NumIds; > + UINT16 NumGuestIds; > + UINT8 GuestIndexBits; > + UINT8 HartIndexBits; > + UINT8 GroupIndexBits; > + UINT8 GroupIndexShift; > +} ACPI_MADT_IMSIC; > + > +/* 26: RISC-V APLIC */ > +typedef struct acpi_madt_aplic { > + ACPI_SUBTABLE_HEADER Header; > + UINT8 Version; > + UINT8 Id; > + UINT32 Flags; > + UINT8 HwId[8]; > + UINT16 NumIdcs; > + UINT16 NumSources; > + UINT32 GsiBase; > + UINT64 BaseAddr; > + UINT32 Size; > +} ACPI_MADT_APLIC; > + > +/* 27: RISC-V PLIC */ > +typedef struct acpi_madt_plic { > + ACPI_SUBTABLE_HEADER Header; > + UINT8 Version; > + UINT8 Id; > + UINT8 HwId[8]; > + UINT16 NumIrqs; > + UINT16 MaxPrio; > + UINT32 Flags; > + UINT32 Size; > + UINT64 BaseAddr; > + UINT32 GsiBase; > +} ACPI_MADT_PLIC; > + > + > /* 80: OEM data */ > > typedef struct acpi_madt_oem_data > @@ -3285,12 +3334,15 @@ enum AcpiRgrtImageType > > typedef struct acpi_table_rhct { > ACPI_TABLE_HEADER Header; /* Common ACPI table header */ > - UINT32 Reserved; > + UINT32 Flags; /* RHCT flags */ > UINT64 TimeBaseFreq; > UINT32 NodeCount; > UINT32 NodeOffset; > } ACPI_TABLE_RHCT; > > +/* RHCT Flags */ > + > +#define ACPI_RHCT_TIMER_CANNOT_WAKEUP_CPU (1) > /* > * RHCT subtables > */ > @@ -3304,6 +3356,9 @@ typedef struct acpi_rhct_node_header { > > enum acpi_rhct_node_type { > ACPI_RHCT_NODE_TYPE_ISA_STRING = 0x0000, > + ACPI_RHCT_NODE_TYPE_CMO = 0x0001, > + ACPI_RHCT_NODE_TYPE_MMU = 0x0002, > + ACPI_RHCT_NODE_TYPE_RESERVED = 0x0003, > ACPI_RHCT_NODE_TYPE_HART_INFO = 0xFFFF, > }; > > @@ -3317,6 +3372,24 @@ typedef struct acpi_rhct_isa_string { > char Isa[]; > } ACPI_RHCT_ISA_STRING; > > +typedef struct acpi_rhct_cmo_node { > + UINT8 Reserved; /* Must be zero */ > + UINT8 CbomSize; /* CBOM size in powerof 2 */ > + UINT8 CbopSize; /* CBOP size in powerof 2 */ > + UINT8 CbozSize; /* CBOZ size in powerof 2 */ > +} ACPI_RHCT_CMO_NODE; > + > +typedef struct acpi_rhct_mmu_node { > + UINT8 Reserved; /* Must be zero */ > + UINT8 MmuType; /* Virtual Address Scheme */ > +} ACPI_RHCT_MMU_NODE; > + > +enum acpi_rhct_mmu_type { > + ACPI_RHCT_MMU_TYPE_SV39 = 0, > + ACPI_RHCT_MMU_TYPE_SV48 = 1, > + ACPI_RHCT_MMU_TYPE_SV57 = 2 > +}; > + > /* Hart Info node structure */ > typedef struct acpi_rhct_hart_info { > UINT16 NumOffsets; > diff --git a/src/acpica/source/include/actbl3.h b/src/acpica/source/include/actbl3.h > index 15ef0195..1438c1db 100644 > --- a/src/acpica/source/include/actbl3.h > +++ b/src/acpica/source/include/actbl3.h > @@ -454,13 +454,15 @@ typedef struct acpi_srat_gic_its_affinity > * 6: ACPI_SRAT_TYPE_GENERIC_PORT_AFFINITY > */ > > +#define ACPI_SRAT_DEVICE_HANDLE_SIZE 16 > + > typedef struct acpi_srat_generic_affinity > { > ACPI_SUBTABLE_HEADER Header; > UINT8 Reserved; > UINT8 DeviceHandleType; > UINT32 ProximityDomain; > - UINT8 DeviceHandle[16]; > + UINT8 DeviceHandle[ACPI_SRAT_DEVICE_HANDLE_SIZE]; > UINT32 Flags; > UINT32 Reserved1; > > diff --git a/src/acpica/source/include/actypes.h b/src/acpica/source/include/actypes.h > index c0f0a87f..93382052 100644 > --- a/src/acpica/source/include/actypes.h > +++ b/src/acpica/source/include/actypes.h > @@ -873,8 +873,7 @@ typedef UINT32 ACPI_EVENT_TYPE; > #define ACPI_EVENT_POWER_BUTTON 2 > #define ACPI_EVENT_SLEEP_BUTTON 3 > #define ACPI_EVENT_RTC 4 > -#define ACPI_EVENT_PCIE_WAKE 5 > -#define ACPI_EVENT_MAX 5 > +#define ACPI_EVENT_MAX 4 > #define ACPI_NUM_FIXED_EVENTS ACPI_EVENT_MAX + 1 > > /* > diff --git a/src/acpica/source/include/amlresrc.h b/src/acpica/source/include/amlresrc.h > index a8e288ad..05fa1505 100644 > --- a/src/acpica/source/include/amlresrc.h > +++ b/src/acpica/source/include/amlresrc.h > @@ -506,7 +506,7 @@ typedef struct aml_resource_extended_irq > union { > UINT32 Interrupt; > ACPI_FLEX_ARRAY(UINT32, Interrupts); > - } u; > + }; > /* ResSourceIndex, ResSource optional fields follow */ > > } AML_RESOURCE_EXTENDED_IRQ; > diff --git a/src/acpica/source/include/platform/aclinux.h b/src/acpica/source/include/platform/aclinux.h > index da37a2fa..f5234b97 100644 > --- a/src/acpica/source/include/platform/aclinux.h > +++ b/src/acpica/source/include/platform/aclinux.h > @@ -312,6 +312,7 @@ > #ifdef ACPI_USE_STANDARD_HEADERS > #include <stddef.h> > #include <unistd.h> > +#include <stdint.h> > > #define ACPI_OFFSET(d, f) offsetof(d, f) > #endif > diff --git a/src/acpica/source/tools/acpiexec/aeinstall.c b/src/acpica/source/tools/acpiexec/aeinstall.c > index 9e1940c3..b855fcbc 100644 > --- a/src/acpica/source/tools/acpiexec/aeinstall.c > +++ b/src/acpica/source/tools/acpiexec/aeinstall.c > @@ -176,6 +176,13 @@ AeInstallPciHandler ( > void *Context, > void **ReturnValue); > > +static ACPI_STATUS > +AeInstallGedHandler ( > + ACPI_HANDLE ObjHandle, > + UINT32 Level, > + void *Context, > + void **ReturnValue); > + > > BOOLEAN AcpiGbl_DisplayRegionAccess = FALSE; > ACPI_CONNECTION_INFO AeMyContext; > @@ -343,6 +350,110 @@ AeInstallRegionHandlers ( > } > } > > +/******************************************************************************* > + * > + * FUNCTION: AeInstallGedHandler > + * > + * PARAMETERS: ACPI_WALK_NAMESPACE callback > + * > + * RETURN: Status > + * > + * DESCRIPTION: Walk entire namespace, install a handler for every GED > + * device found. > + * > + ******************************************************************************/ > +static ACPI_STATUS > +AeInstallGedHandler ( > + ACPI_HANDLE ObjHandle, > + UINT32 Level, > + void *Context, > + void **ReturnValue) > +{ > + > + ACPI_BUFFER ReturnBuffer; > + ACPI_STATUS Status; > + ACPI_RESOURCE *ResourceList; > + ACPI_RESOURCE_EXTENDED_IRQ *extended_irq_rsc; > + ACPI_NAMESPACE_NODE *Node; > + ACPI_NAMESPACE_NODE *EvtMethodNode; > + > + ACPI_FUNCTION_ENTRY(); > + > + /* Obtain the Namespace Node of this GED object handle. */ > + Node = AcpiNsValidateHandle (ObjHandle); > + if (!Node) > + { > + return (AE_BAD_PARAMETER); > + } > + > + /* > + * A GED device must have one _EVT method. > + * Obtain the _EVT method and store it in the global > + * GED register. > + */ > + Status = AcpiNsSearchOneScope ( > + *ACPI_CAST_PTR (ACPI_NAME, METHOD_NAME__EVT), > + Node, > + ACPI_TYPE_METHOD, > + &EvtMethodNode > + ); > + if (ACPI_FAILURE (Status)) > + { > + AcpiOsPrintf ("Failed to obtain _EVT method for the GED device.\n"); > + return Status; > + } > + > + ReturnBuffer.Pointer = NULL; > + ReturnBuffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; > + > + Status = AcpiGetCurrentResources (ObjHandle, &ReturnBuffer); > + if (ACPI_FAILURE (Status)) > + { > + AcpiOsPrintf ("AcpiGetCurrentResources failed: %s\n", > + AcpiFormatException (Status)); > + return Status; > + } > + > + /* Traverse the _CRS resource list */ > + ResourceList = ACPI_CAST_PTR (ACPI_RESOURCE, ReturnBuffer.Pointer); > + while (ResourceList->Type != ACPI_RESOURCE_TYPE_END_TAG) { > + > + switch (ResourceList->Type) { > + case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: { > + > + /* > + * Found an Interrupt resource. Link the interrupt resource > + * and the _EVT method of this GED device in the GED event handler list. > + */ > + ACPI_GED_HANDLER_INFO *GedHandler = > + ACPI_ALLOCATE (sizeof (ACPI_SCI_HANDLER_INFO)); > + if (!GedHandler) > + { > + return AE_NO_MEMORY; > + } > + > + GedHandler->Next = AcpiGbl_GedHandlerList; > + AcpiGbl_GedHandlerList = GedHandler; > + > + extended_irq_rsc = &ResourceList->Data.ExtendedIrq; > + > + GedHandler->IntId = extended_irq_rsc->Interrupts[0]; > + GedHandler->EvtMethod = EvtMethodNode; > + > + AcpiOsPrintf ("Interrupt ID %d\n", extended_irq_rsc->Interrupts[0]); > + > + break; > + } > + default: > + > + AcpiOsPrintf ("Resource type %X\n", ResourceList->Type); > + } > + > + ResourceList = ACPI_NEXT_RESOURCE (ResourceList); > + } > + > + return AE_OK; > +} > > /******************************************************************************* > * > @@ -352,7 +463,7 @@ AeInstallRegionHandlers ( > * > * RETURN: Status > * > - * DESCRIPTION: Install handlers for all EC and PCI devices in the namespace > + * DESCRIPTION: Install handlers for all EC, PCI and GED devices in the namespace > * > ******************************************************************************/ > > @@ -368,6 +479,11 @@ AeInstallDeviceHandlers ( > /* Install a PCI handler */ > > AcpiGetDevices ("PNP0A08", AeInstallPciHandler, NULL, NULL); > + > + /* Install a GED handler */ > + > + AcpiGetDevices ("ACPI0013", AeInstallGedHandler, NULL, NULL); > + > return (AE_OK); > } >
diff --git a/src/acpica/source/common/ahpredef.c b/src/acpica/source/common/ahpredef.c index f4080587..a1f3a125 100644 --- a/src/acpica/source/common/ahpredef.c +++ b/src/acpica/source/common/ahpredef.c @@ -234,6 +234,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_DMA", "Direct Memory Access", "Returns device current resources for DMA transactions, and resource field"), AH_PREDEF ("_DOD", "Display Output Devices", "Enumerate all devices attached to the display adapter"), AH_PREDEF ("_DOS", "Disable Output Switching", "Sets the display output switching mode"), + AH_PREDEF ("_DSC", "Deepest State for Configuration", "Returns the deepest D-state of the device to the OSPM"), AH_PREDEF ("_DPL", "Device Selection Polarity", "Polarity of Device Selection signal, Resource Descriptor field"), AH_PREDEF ("_DRS", "Drive Strength", "Drive Strength setting for GPIO connection, Resource Descriptor field"), AH_PREDEF ("_DSD", "Device-Specific Data", "Returns a list of device property information"), diff --git a/src/acpica/source/common/dmtable.c b/src/acpica/source/common/dmtable.c index 31ca7390..f0cc5b99 100644 --- a/src/acpica/source/common/dmtable.c +++ b/src/acpica/source/common/dmtable.c @@ -430,6 +430,9 @@ static const char *AcpiDmMadtSubnames[] = "Bridge I/O Interrupt Controller", /* ACPI_MADT_TYPE_BIO_PIC */ "LPC Interrupt Controller", /* ACPI_MADT_TYPE_LPC_PIC */ "RISC-V Interrupt Controller", /* ACPI_MADT_TYPE_RINTC */ + "RISC-V Incoming MSI Controller", /* ACPI_MADT_TYPE_IMSIC */ + "RISC-V APLIC Controller", /* ACPI_MADT_TYPE_APLIC */ + "RISC-V PLIC Controller", /* ACPI_MADT_TYPE_PLIC */ "Unknown Subtable Type", /* Reserved */ "Types 80-FF are used for OEM data" /* Reserved for OEM data */ }; @@ -669,6 +672,14 @@ static const char *AcpiDmGasAccessWidth[] = "Unknown Width Encoding" }; +static const char *AcpiDmRhctSubnames[] = +{ + "RISC-V ISA string structure", /* ACPI_RHCT_ISA_STRING */ + "RISC-V CMO node structure", /* ACPI_RHCT_CMO_NODE */ + "RISC-V MMU node structure", /* ACPI_RHCT_MMU_NODE */ + "RISC-V Hart Info structure", /* ACPI_RHCT_HART_INFO */ +}; + /******************************************************************************* * @@ -1190,6 +1201,7 @@ AcpiDmDumpTable ( case ACPI_DMT_NFIT: case ACPI_DMT_NHLT1e: case ACPI_DMT_PHAT: + case ACPI_DMT_RHCT: ByteLength = 2; break; @@ -2169,6 +2181,20 @@ AcpiDmDumpTable ( AcpiDmRgrtSubnames[Temp8]); break; + case ACPI_DMT_RHCT: + + /* RHCT subtable types */ + + Temp16 = ACPI_GET16 (Target); + if (Temp16 == ACPI_RHCT_NODE_TYPE_HART_INFO) + { + Temp16 = ACPI_RHCT_NODE_TYPE_RESERVED; + } + + AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), + AcpiDmRhctSubnames[Temp16]); + break; + case ACPI_DMT_SDEV: /* SDEV subtable types */ diff --git a/src/acpica/source/common/dmtbdump2.c b/src/acpica/source/common/dmtbdump2.c index e9c5dbfd..fd377cb2 100644 --- a/src/acpica/source/common/dmtbdump2.c +++ b/src/acpica/source/common/dmtbdump2.c @@ -990,6 +990,61 @@ AcpiDmDumpMadt ( InfoTable = AcpiDmTableInfoMadt16; break; + case ACPI_MADT_TYPE_CORE_PIC: + + InfoTable = AcpiDmTableInfoMadt17; + break; + + case ACPI_MADT_TYPE_LIO_PIC: + + InfoTable = AcpiDmTableInfoMadt18; + break; + + case ACPI_MADT_TYPE_HT_PIC: + + InfoTable = AcpiDmTableInfoMadt19; + break; + + case ACPI_MADT_TYPE_EIO_PIC: + + InfoTable = AcpiDmTableInfoMadt20; + break; + + case ACPI_MADT_TYPE_MSI_PIC: + + InfoTable = AcpiDmTableInfoMadt21; + break; + + case ACPI_MADT_TYPE_BIO_PIC: + + InfoTable = AcpiDmTableInfoMadt22; + break; + + case ACPI_MADT_TYPE_LPC_PIC: + + InfoTable = AcpiDmTableInfoMadt23; + break; + + case ACPI_MADT_TYPE_RINTC: + + InfoTable = AcpiDmTableInfoMadt24; + break; + + case ACPI_MADT_TYPE_IMSIC: + + InfoTable = AcpiDmTableInfoMadt25; + break; + + case ACPI_MADT_TYPE_APLIC: + + InfoTable = AcpiDmTableInfoMadt26; + break; + + case ACPI_MADT_TYPE_PLIC: + + InfoTable = AcpiDmTableInfoMadt27; + break; + default: if ((Subtable->Type >= ACPI_MADT_TYPE_RESERVED) && @@ -1021,7 +1076,7 @@ AcpiDmDumpMadt ( /* Dump the OEM data */ Status = AcpiDmDumpTable (Length, Offset, ACPI_CAST_PTR (UINT8, Table) + Offset, - Subtable->Length - sizeof (ACPI_SUBTABLE_HEADER), AcpiDmTableInfoMadt17); + Subtable->Length - sizeof (ACPI_SUBTABLE_HEADER), AcpiDmTableInfoMadt128); if (ACPI_FAILURE (Status)) { return; @@ -1058,16 +1113,16 @@ NextSubtable: Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable, Subtable->Length); - DbgPrint (ASL_PARSE_OUTPUT, "//[5) Next Subtable %p, length %X]\n", - Subtable, Subtable->Length); - DbgPrint (ASL_PARSE_OUTPUT, "//[5B) Offset from table start: 0x%8.8X%8.8X (%p)]\n", - ACPI_FORMAT_UINT64 (ACPI_CAST_PTR (char, Subtable) - ACPI_CAST_PTR (char, Table)), Subtable); - Offset = ACPI_CAST_PTR (char, Subtable) - ACPI_CAST_PTR (char, Table); if (Offset >= Table->Length) { return; } + + DbgPrint (ASL_PARSE_OUTPUT, "//[5) Next Subtable %p, length %X]\n", + Subtable, Subtable->Length); + DbgPrint (ASL_PARSE_OUTPUT, "//[5B) Offset from table start: 0x%8.8X%8.8X (%p)]\n", + ACPI_FORMAT_UINT64 (ACPI_CAST_PTR (char, Subtable) - ACPI_CAST_PTR (char, Table)), Subtable); } } @@ -2765,6 +2820,8 @@ AcpiDmDumpRhct ( ACPI_RHCT_NODE_HEADER *Subtable; ACPI_RHCT_HART_INFO *RhctHartInfo; ACPI_RHCT_ISA_STRING *RhctIsaString; + ACPI_RHCT_CMO_NODE *RhctCmoNode; + ACPI_RHCT_MMU_NODE *RhctMmuNode; UINT32 Length = Table->Length; UINT8 SubtableOffset, IsaPadOffset; UINT32 Offset = sizeof (ACPI_TABLE_RHCT); @@ -2850,6 +2907,20 @@ AcpiDmDumpRhct ( (Subtable->Length - IsaPadOffset), AcpiDmTableInfoRhctIsaPad); } + break; + + case ACPI_RHCT_NODE_TYPE_CMO: + RhctCmoNode = ACPI_ADD_PTR (ACPI_RHCT_CMO_NODE, Subtable, SubtableOffset); + Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset, + RhctCmoNode, 4, AcpiDmTableInfoRhctCmo1); + break; + + case ACPI_RHCT_NODE_TYPE_MMU: + RhctMmuNode = ACPI_ADD_PTR (ACPI_RHCT_MMU_NODE, Subtable, SubtableOffset); + Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset, + RhctMmuNode, 2, AcpiDmTableInfoRhctMmu1); + break; + default: break; } diff --git a/src/acpica/source/common/dmtbinfo1.c b/src/acpica/source/common/dmtbinfo1.c index e4632085..11cf6715 100644 --- a/src/acpica/source/common/dmtbinfo1.c +++ b/src/acpica/source/common/dmtbinfo1.c @@ -947,7 +947,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[] = { {ACPI_DMT_UINT24, ACPI_DMAR4_OFFSET (Reserved[0]), "Reserved", 0}, {ACPI_DMT_UINT8, ACPI_DMAR4_OFFSET (DeviceNumber), "Device Number", 0}, - {ACPI_DMT_STRING, ACPI_DMAR4_OFFSET (u.DeviceName[0]), "Device Name", 0}, + {ACPI_DMT_STRING, ACPI_DMAR4_OFFSET (DeviceName[0]), "Device Name", 0}, ACPI_DMT_TERMINATOR }; diff --git a/src/acpica/source/common/dmtbinfo2.c b/src/acpica/source/common/dmtbinfo2.c index 214206ad..bb961a6c 100644 --- a/src/acpica/source/common/dmtbinfo2.c +++ b/src/acpica/source/common/dmtbinfo2.c @@ -678,8 +678,6 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[] = {ACPI_DMT_UINT64, ACPI_LPIT0_OFFSET (CounterFrequency), "Counter Frequency", 0}, ACPI_DMT_TERMINATOR }; - - /******************************************************************************* * * MADT - Multiple APIC Description Table and subtables @@ -926,12 +924,155 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt16[] = ACPI_DMT_TERMINATOR }; -/* 17: OEM data structure */ +/* 17: core interrupt controller */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt17[] = +{ + {ACPI_DMT_UINT8, ACPI_MADT17_OFFSET (Version), "Version", 0}, + {ACPI_DMT_UINT32, ACPI_MADT17_OFFSET (ProcessorId), "ProcessorId", 0}, + {ACPI_DMT_UINT32, ACPI_MADT17_OFFSET (CoreId), "CoreId", 0}, + {ACPI_DMT_UINT32, ACPI_MADT17_OFFSET (Flags), "Flags", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 18: Legacy I/O interrupt controller */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt18[] = +{ + {ACPI_DMT_UINT8, ACPI_MADT18_OFFSET (Version), "Version", 0}, + {ACPI_DMT_UINT64, ACPI_MADT18_OFFSET (Address), "Address", 0}, + {ACPI_DMT_UINT16, ACPI_MADT18_OFFSET (Size), "Size", 0}, + {ACPI_DMT_UINT16, ACPI_MADT18_OFFSET (Cascade), "Cascade", 0}, + {ACPI_DMT_UINT64, ACPI_MADT18_OFFSET (CascadeMap), "CascadeMap", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 19: HT interrupt controller */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt19[] = +{ + {ACPI_DMT_UINT8, ACPI_MADT19_OFFSET (Version), "Version", 0}, + {ACPI_DMT_UINT64, ACPI_MADT19_OFFSET (Address), "Address", 0}, + {ACPI_DMT_UINT16, ACPI_MADT19_OFFSET (Size), "Size", 0}, + {ACPI_DMT_UINT64, ACPI_MADT19_OFFSET (Cascade), "Cascade", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 20: Extend I/O interrupt controller */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt20[] = +{ + {ACPI_DMT_UINT8, ACPI_MADT20_OFFSET (Version), "Version", 0}, + {ACPI_DMT_UINT8, ACPI_MADT20_OFFSET (Cascade), "Cascade", 0}, + {ACPI_DMT_UINT8, ACPI_MADT20_OFFSET (Node), "Node", 0}, + {ACPI_DMT_UINT64, ACPI_MADT20_OFFSET (NodeMap), "NodeMap", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 21: MSI controller */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt21[] = +{ + {ACPI_DMT_UINT8, ACPI_MADT21_OFFSET (Version), "Version", 0}, + {ACPI_DMT_UINT64, ACPI_MADT21_OFFSET (MsgAddress), "MsgAddress", 0}, + {ACPI_DMT_UINT32, ACPI_MADT21_OFFSET (Start), "Start", 0}, + {ACPI_DMT_UINT32, ACPI_MADT21_OFFSET (Count), "Count", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 22: BIO interrupt controller */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt22[] = +{ + {ACPI_DMT_UINT8, ACPI_MADT22_OFFSET (Version), "Version", 0}, + {ACPI_DMT_UINT64, ACPI_MADT22_OFFSET (Address), "Address", 0}, + {ACPI_DMT_UINT16, ACPI_MADT22_OFFSET (Size), "Size", 0}, + {ACPI_DMT_UINT16, ACPI_MADT22_OFFSET (Id), "Id", 0}, + {ACPI_DMT_UINT16, ACPI_MADT22_OFFSET (GsiBase), "GsiBase", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 23: LPC interrupt controller */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt23[] = +{ + {ACPI_DMT_UINT8, ACPI_MADT23_OFFSET (Version), "Version", 0}, + {ACPI_DMT_UINT64, ACPI_MADT23_OFFSET (Address), "Address", 0}, + {ACPI_DMT_UINT16, ACPI_MADT23_OFFSET (Size), "Size", 0}, + {ACPI_DMT_UINT8, ACPI_MADT23_OFFSET (Cascade), "Cascade", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 24: RINTC interrupt controller */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt24[] = +{ + {ACPI_DMT_UINT8, ACPI_MADT24_OFFSET (Version), "Version", 0}, + {ACPI_DMT_UINT8, ACPI_MADT24_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_MADT24_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_UINT64, ACPI_MADT24_OFFSET (HartId), "HartId", 0}, + {ACPI_DMT_UINT32, ACPI_MADT24_OFFSET (Uid), "Uid", 0}, + {ACPI_DMT_UINT32, ACPI_MADT24_OFFSET (ExtIntcId), "ExtIntcId", 0}, + {ACPI_DMT_UINT64, ACPI_MADT24_OFFSET (ImsicAddr), "ImsicAddr", 0}, + {ACPI_DMT_UINT32, ACPI_MADT24_OFFSET (ImsicSize), "ImsicSize", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 25: RISC-V IMSIC interrupt controller */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt25[] = +{ + {ACPI_DMT_UINT8, ACPI_MADT25_OFFSET (Version), "Version", 0}, + {ACPI_DMT_UINT8, ACPI_MADT25_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_MADT25_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_UINT16, ACPI_MADT25_OFFSET (NumIds), "NumIds", 0}, + {ACPI_DMT_UINT16, ACPI_MADT25_OFFSET (NumGuestIds), "NumGuestIds", 0}, + {ACPI_DMT_UINT8, ACPI_MADT25_OFFSET (GuestIndexBits), "GuestIndexBits", 0}, + {ACPI_DMT_UINT8, ACPI_MADT25_OFFSET (HartIndexBits), "HartIndexBits", 0}, + {ACPI_DMT_UINT8, ACPI_MADT25_OFFSET (GroupIndexBits), "GroupIndexBits", 0}, + {ACPI_DMT_UINT8, ACPI_MADT25_OFFSET (GroupIndexShift), "GroupIndexShift", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 26: RISC-V APLIC interrupt controller */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt26[] = +{ + {ACPI_DMT_UINT8, ACPI_MADT26_OFFSET (Version), "Version", 0}, + {ACPI_DMT_UINT8, ACPI_MADT26_OFFSET (Id), "Id", 0}, + {ACPI_DMT_UINT32, ACPI_MADT26_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_UINT64, ACPI_MADT26_OFFSET (HwId), "HwId", 0}, + {ACPI_DMT_UINT16, ACPI_MADT26_OFFSET (NumIdcs), "NumIdcs", 0}, + {ACPI_DMT_UINT16, ACPI_MADT26_OFFSET (NumSources), "NumSources", 0}, + {ACPI_DMT_UINT32, ACPI_MADT26_OFFSET (GsiBase), "GsiBase", 0}, + {ACPI_DMT_UINT64, ACPI_MADT26_OFFSET (BaseAddr), "BaseAddr", 0}, + {ACPI_DMT_UINT32, ACPI_MADT26_OFFSET (Size), "Size", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 27: RISC-V PLIC interrupt controller */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt27[] = +{ + {ACPI_DMT_UINT8, ACPI_MADT27_OFFSET (Version), "Version", 0}, + {ACPI_DMT_UINT8, ACPI_MADT27_OFFSET (Id), "Id", 0}, + {ACPI_DMT_UINT32, ACPI_MADT27_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_UINT64, ACPI_MADT27_OFFSET (HwId), "HwId", 0}, + {ACPI_DMT_UINT16, ACPI_MADT27_OFFSET (NumIrqs), "NumIrqs", 0}, + {ACPI_DMT_UINT16, ACPI_MADT27_OFFSET (MaxPrio), "MaxPrio", 0}, + {ACPI_DMT_UINT32, ACPI_MADT27_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_UINT32, ACPI_MADT27_OFFSET (Size), "Size", 0}, + {ACPI_DMT_UINT64, ACPI_MADT27_OFFSET (BaseAddr), "BaseAddr", 0}, + {ACPI_DMT_UINT32, ACPI_MADT27_OFFSET (GsiBase), "GsiBase", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 128: OEM data structure */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt128[] = { {ACPI_DMT_RAW_BUFFER, 0, "OEM Data", 0}, - ACPI_DMT_TERMINATOR + ACPI_DMT_TERMINATOR }; /******************************************************************************* @@ -2080,7 +2221,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoRgrt0[] = ACPI_DMTABLE_INFO AcpiDmTableInfoRhct[] = { - {ACPI_DMT_UINT32, ACPI_RHCT_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_RHCT_OFFSET (Flags), "Flags", 0}, {ACPI_DMT_UINT64, ACPI_RHCT_OFFSET (TimeBaseFreq), "Timer Base Frequency", 0}, {ACPI_DMT_UINT32, ACPI_RHCT_OFFSET (NodeCount), "Number of nodes", 0}, {ACPI_DMT_UINT32, ACPI_RHCT_OFFSET (NodeOffset), "Offset to the node array", 0}, @@ -2092,7 +2233,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoRhct[] = ACPI_DMTABLE_INFO AcpiDmTableInfoRhctNodeHdr[] = { - {ACPI_DMT_UINT16, ACPI_RHCTH_OFFSET (Type), "Subtable Type", 0}, + {ACPI_DMT_RHCT, ACPI_RHCTH_OFFSET (Type), "Subtable Type", 0}, {ACPI_DMT_UINT16, ACPI_RHCTH_OFFSET (Length), "Length", 0}, {ACPI_DMT_UINT16, ACPI_RHCTH_OFFSET (Revision), "Revision", 0}, ACPI_DMT_TERMINATOR @@ -2116,6 +2257,26 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoRhctIsaPad[] = ACPI_DMT_TERMINATOR }; +/* 1: CMO node type */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoRhctCmo1[] = +{ + {ACPI_DMT_UINT8, ACPI_RHCT1_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_RHCT1_OFFSET (CbomSize), "CBOM Block Size", 0}, + {ACPI_DMT_UINT8, ACPI_RHCT1_OFFSET (CbopSize), "CBOP Block Size", 0}, + {ACPI_DMT_UINT8, ACPI_RHCT1_OFFSET (CbozSize), "CBOZ Block Size", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 2: MMU node type */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoRhctMmu1[] = +{ + {ACPI_DMT_UINT8, ACPI_RHCT2_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_RHCT2_OFFSET (MmuType), "MMU Type", 0}, + ACPI_DMT_TERMINATOR +}; + /* 0xFFFF: Hart Info type */ ACPI_DMTABLE_INFO AcpiDmTableInfoRhctHartInfo1[] = diff --git a/src/acpica/source/compiler/aslrestype2.c b/src/acpica/source/compiler/aslrestype2.c index bf6f77ed..6a1c1cbe 100644 --- a/src/acpica/source/compiler/aslrestype2.c +++ b/src/acpica/source/compiler/aslrestype2.c @@ -337,7 +337,7 @@ RsDoInterruptDescriptor ( Descriptor->ExtendedIrq.InterruptCount = 0; Rover = ACPI_CAST_PTR (AML_RESOURCE, - (&(Descriptor->ExtendedIrq.u.Interrupts[0]))); + (&(Descriptor->ExtendedIrq.Interrupts[0]))); /* Process all child initialization nodes */ @@ -466,7 +466,7 @@ RsDoInterruptDescriptor ( RsCreateDwordField (InitializerOp, ACPI_RESTAG_INTERRUPT, CurrentByteOffset + - ASL_RESDESC_OFFSET (ExtendedIrq.u.Interrupts[0])); + ASL_RESDESC_OFFSET (ExtendedIrq.Interrupts[0])); } } @@ -494,7 +494,7 @@ RsDoInterruptDescriptor ( } Rnode->BufferLength = - (ASL_RESDESC_OFFSET (ExtendedIrq.u.Interrupts[0]) - + (ASL_RESDESC_OFFSET (ExtendedIrq.Interrupts[0]) - ASL_RESDESC_OFFSET (ExtendedIrq.DescriptorType)) + OptionIndex + StringLength; return (Rnode); diff --git a/src/acpica/source/compiler/dttable2.c b/src/acpica/source/compiler/dttable2.c index 007b6747..e0317f4c 100644 --- a/src/acpica/source/compiler/dttable2.c +++ b/src/acpica/source/compiler/dttable2.c @@ -371,11 +371,66 @@ DtCompileMadt ( InfoTable = AcpiDmTableInfoMadt16; break; + case ACPI_MADT_TYPE_CORE_PIC: + + InfoTable = AcpiDmTableInfoMadt17; + break; + + case ACPI_MADT_TYPE_LIO_PIC: + + InfoTable = AcpiDmTableInfoMadt18; + break; + + case ACPI_MADT_TYPE_HT_PIC: + + InfoTable = AcpiDmTableInfoMadt19; + break; + + case ACPI_MADT_TYPE_EIO_PIC: + + InfoTable = AcpiDmTableInfoMadt20; + break; + + case ACPI_MADT_TYPE_MSI_PIC: + + InfoTable = AcpiDmTableInfoMadt21; + break; + + case ACPI_MADT_TYPE_BIO_PIC: + + InfoTable = AcpiDmTableInfoMadt22; + break; + + case ACPI_MADT_TYPE_LPC_PIC: + + InfoTable = AcpiDmTableInfoMadt23; + break; + + case ACPI_MADT_TYPE_RINTC: + + InfoTable = AcpiDmTableInfoMadt24; + break; + + case ACPI_MADT_TYPE_IMSIC: + + InfoTable = AcpiDmTableInfoMadt25; + break; + + case ACPI_MADT_TYPE_APLIC: + + InfoTable = AcpiDmTableInfoMadt26; + break; + + case ACPI_MADT_TYPE_PLIC: + + InfoTable = AcpiDmTableInfoMadt27; + break; + default: if (MadtHeader->Type >= ACPI_MADT_TYPE_OEM_RESERVED) { - InfoTable = AcpiDmTableInfoMadt17; + InfoTable = AcpiDmTableInfoMadt128; } else { @@ -2190,6 +2245,16 @@ DtCompileRhct ( InfoTable = AcpiDmTableInfoRhctHartInfo1; break; + case ACPI_RHCT_NODE_TYPE_CMO: + + InfoTable = AcpiDmTableInfoRhctCmo1; + break; + + case ACPI_RHCT_NODE_TYPE_MMU: + + InfoTable = AcpiDmTableInfoRhctMmu1; + break; + default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "RHCT"); diff --git a/src/acpica/source/compiler/dttemplate.h b/src/acpica/source/compiler/dttemplate.h index 755da402..c97a8ed2 100644 --- a/src/acpica/source/compiler/dttemplate.h +++ b/src/acpica/source/compiler/dttemplate.h @@ -1128,11 +1128,11 @@ const unsigned char TemplateLpit[] = const unsigned char TemplateMadt[] = { - 0x41,0x50,0x49,0x43,0x6A,0x01,0x00,0x00, /* 00000000 "APICj..." */ - 0x05,0x9D,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x41,0x50,0x49,0x43,0x60,0x02,0x00,0x00, /* 00000000 "APIC...." */ + 0x05,0x69,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x13,0x11,0x20,0x20,0x00,0x00,0x00,0x00, /* 00000020 ".. ...." */ + 0x31,0x03,0x22,0x20,0x00,0x00,0x00,0x00, /* 00000020 "1." ...." */ 0x01,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000028 "........" */ 0x01,0x00,0x00,0x00,0x01,0x0C,0x01,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ @@ -1173,7 +1173,37 @@ const unsigned char TemplateMadt[] = 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */ 0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x00, /* 00000158 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */ - 0x00,0x00 /* 00000168 ".." */ + 0x00,0x00,0x11,0x0F,0x01,0x01,0x00,0x00, /* 00000168 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 00000170 "........" */ + 0x00,0x12,0x17,0x01,0x00,0x14,0xE0,0x1F, /* 00000178 "........" */ + 0x00,0x00,0x00,0x00,0x80,0x00,0x02,0x03, /* 00000180 "........" */ + 0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0xFF, /* 00000188 "........" */ + 0x13,0x15,0x01,0x80,0x00,0x00,0xFB,0xFD, /* 00000190 "........" */ + 0x0E,0x00,0x00,0x40,0x00,0x00,0x00,0x00, /* 00000198 "...@...." */ + 0xFF,0x00,0x00,0x00,0x00,0x14,0x0D,0x01, /* 000001A0 "........" */ + 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001A8 "........" */ + 0x00,0x00,0x15,0x13,0x01,0x00,0x00,0xF0, /* 000001B0 "........" */ + 0x2F,0x00,0x00,0x00,0x00,0x40,0x00,0x00, /* 000001B8 "/....@.." */ + 0x00,0xC0,0x00,0x00,0x00,0x16,0x11,0x01, /* 000001C0 "........" */ + 0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00, /* 000001C8 "........" */ + 0x00,0x10,0x00,0x00,0x40,0x00,0x17,0x0E, /* 000001D0 "....@..." */ + 0x01,0x00,0x20,0x00,0x10,0x00,0x00,0x00, /* 000001D8 ".. ....." */ + 0x00,0x00,0x10,0x13,0x18,0x24,0x01,0x00, /* 000001E0 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001E8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001F0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28, /* 000001F8 ".......(" */ + 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 00000200 "........" */ + 0x19,0x10,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000208 "........" */ + 0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x18, /* 00000210 "........" */ + 0x1A,0x24,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000218 ".$......" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000220 "........" */ + 0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00, /* 00000228 "..`....." */ + 0x00,0x00,0x00,0x0D,0x00,0x00,0x00,0x00, /* 00000230 "........" */ + 0x00,0x80,0x00,0x00,0x1B,0x24,0x01,0x00, /* 00000238 ".....$.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000240 "........" */ + 0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000248 "`.....`." */ + 0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x0C, /* 00000250 "..`....." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000258 "........" */ }; const unsigned char TemplateMcfg[] = @@ -1718,8 +1748,8 @@ const unsigned char TemplateRgrt[] = const unsigned char TemplateRhct[] = { - 0x52,0x48,0x43,0x54,0x7C,0x00,0x00,0x00, /* 00000000 "RHCT|..." */ - 0x01,0x7D,0x4F,0x45,0x4D,0x43,0x41,0x00, /* 00000008 "..OEMCA." */ + 0x52,0x48,0x43,0x54,0x96,0x00,0x00,0x00, /* 00000000 "RHCT|..." */ + 0x01,0x24,0x4F,0x45,0x4D,0x43,0x41,0x00, /* 00000008 "..OEMCA." */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ 0x28,0x09,0x22,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ @@ -1731,9 +1761,12 @@ const unsigned char TemplateRhct[] = 0x72,0x5F,0x7A,0x69,0x66,0x65,0x6E,0x63, /* 00000050 "r_zifenc" */ 0x65,0x69,0x5F,0x7A,0x62,0x61,0x5F,0x7A, /* 00000058 "ei_zba_z" */ 0x62,0x62,0x5F,0x7A,0x62,0x63,0x5F,0x7A, /* 00000060 "bb_zbc_z" */ - 0x62,0x73,0x00,0x00,0xFF,0xFF,0x10,0x00, /* 00000068 "bs......" */ - 0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ - 0x38,0x00,0x00,0x00 /* 00000078 "........" */ + 0x62,0x73,0x00,0x00,0xFF,0xFF,0x18,0x00, /* 00000068 "bs......" */ + 0x01,0x00,0x03,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ + 0x38,0x00,0x00,0x00,0x7c,0x00,0x00,0x00, /* 00000078 "........" */ + 0x8E,0x00,0x00,0x00,0x01,0x00,0x0A,0x00, /* 00000080 "........" */ + 0x01,0x00,0x00,0x06,0x06,0x06,0x02,0x00, /* 00000088 "........" */ + 0x08,0x00,0x01,0x00,0x00,0x02 /* 00000090 "........" */ }; const unsigned char TemplateRsdp[] = diff --git a/src/acpica/source/components/debugger/dbcmds.c b/src/acpica/source/components/debugger/dbcmds.c index b8c2b422..6636f7b9 100644 --- a/src/acpica/source/components/debugger/dbcmds.c +++ b/src/acpica/source/components/debugger/dbcmds.c @@ -156,7 +156,7 @@ #include "acnamesp.h" #include "acresrc.h" #include "actables.h" - +#include "limits.h" #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbcmds") @@ -1291,6 +1291,64 @@ AcpiDbDisplayResources ( } +/******************************************************************************* + * + * FUNCTION: AcpiDbGenerateGed + * + * PARAMETERS: GedArg - Raw GED number, ascii string + * + * RETURN: None + * + * DESCRIPTION: Simulate firing of a GED + * + ******************************************************************************/ + +void +AcpiDbGenerateInterrupt ( + char *GsivArg) +{ + UINT32 GsivNumber; + ACPI_GED_HANDLER_INFO *GedInfo = AcpiGbl_GedHandlerList; + + if (!GedInfo) { + AcpiOsPrintf ("No GED handling present\n"); + } + + GsivNumber = strtoul (GsivArg, NULL, 0); + + while (GedInfo) { + + if (GedInfo->IntId == GsivNumber) { + ACPI_OBJECT_LIST ArgList; + ACPI_OBJECT Arg0; + ACPI_HANDLE EvtHandle = GedInfo->EvtMethod; + ACPI_STATUS Status; + + AcpiOsPrintf ("Evaluate GED _EVT (GSIV=%d)\n", GsivNumber); + + if (!EvtHandle) { + AcpiOsPrintf ("Undefined _EVT method\n"); + return; + } + + Arg0.Integer.Type = ACPI_TYPE_INTEGER; + Arg0.Integer.Value = GsivNumber; + + ArgList.Count = 1; + ArgList.Pointer = &Arg0; + + Status = AcpiEvaluateObject (EvtHandle, NULL, &ArgList, NULL); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("Could not evaluate _EVT\n"); + return; + } + + } + GedInfo = GedInfo->Next; + } +} + #if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * diff --git a/src/acpica/source/components/debugger/dbinput.c b/src/acpica/source/components/debugger/dbinput.c index 5e5c6289..b5b131d4 100644 --- a/src/acpica/source/components/debugger/dbinput.c +++ b/src/acpica/source/components/debugger/dbinput.c @@ -264,6 +264,7 @@ enum AcpiExDebuggerCommands CMD_THREADS, CMD_TEST, + CMD_INTERRUPT, #endif }; @@ -345,6 +346,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] = {"THREADS", 3}, {"TEST", 1}, + {"INTERRUPT", 1}, #endif {NULL, 0} }; @@ -389,7 +391,7 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = {1, " Debug <Namepath> [Arguments]", "Single-Step a control method\n"}, {7, " [Arguments] formats:", "Control method argument formats\n"}, {1, " Hex Integer", "Integer\n"}, - {1, " \"Ascii String\"", "String\n"}, + {1, " \"ASCII String\"", "String\n"}, {1, " (Hex Byte List)", "Buffer\n"}, {1, " (01 42 7A BF)", "Buffer example (4 bytes)\n"}, {1, " [Package Element List]", "Package\n"}, @@ -461,6 +463,7 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = {1, " Gpes", "Display info on all GPE devices\n"}, {1, " Sci", "Generate an SCI\n"}, {1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"}, + {1, " Interrupt <GSIV>", "Simulate an interrupt\n"}, #endif {0, NULL, NULL} }; @@ -1263,6 +1266,11 @@ AcpiDbCommandDispatch ( AcpiOsPrintf ("Event command not implemented\n"); break; + case CMD_INTERRUPT: + + AcpiDbGenerateInterrupt (AcpiGbl_DbArgs[1]); + break; + case CMD_GPE: AcpiDbGenerateGpe (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); diff --git a/src/acpica/source/components/disassembler/dmresrcl.c b/src/acpica/source/components/disassembler/dmresrcl.c index 88d19036..75cafe5d 100644 --- a/src/acpica/source/components/disassembler/dmresrcl.c +++ b/src/acpica/source/components/disassembler/dmresrcl.c @@ -1112,7 +1112,7 @@ AcpiDmInterruptDescriptor ( { AcpiDmIndent (Level + 1); AcpiOsPrintf ("0x%8.8X,\n", - (UINT32) Resource->ExtendedIrq.u.Interrupts[i]); + (UINT32) Resource->ExtendedIrq.Interrupts[i]); } AcpiDmIndent (Level); diff --git a/src/acpica/source/components/dispatcher/dswstate.c b/src/acpica/source/components/dispatcher/dswstate.c index cc648e3a..e67de6bc 100644 --- a/src/acpica/source/components/dispatcher/dswstate.c +++ b/src/acpica/source/components/dispatcher/dswstate.c @@ -310,8 +310,8 @@ AcpiDsResultPush ( if (!Object) { ACPI_ERROR ((AE_INFO, - "Null Object! Obj=%p State=%p Num=%u", - Object, WalkState, WalkState->ResultCount)); + "Null Object! State=%p Num=%u", + WalkState, WalkState->ResultCount)); return (AE_BAD_PARAMETER); } diff --git a/src/acpica/source/components/events/evevent.c b/src/acpica/source/components/events/evevent.c index 913cbd14..b7f6692a 100644 --- a/src/acpica/source/components/events/evevent.c +++ b/src/acpica/source/components/events/evevent.c @@ -312,8 +312,7 @@ AcpiEvFixedEventInitialize ( { Status = AcpiWriteBitRegister ( AcpiGbl_FixedEventInfo[i].EnableRegisterId, - (i == ACPI_EVENT_PCIE_WAKE) ? - ACPI_ENABLE_EVENT : ACPI_DISABLE_EVENT); + ACPI_DISABLE_EVENT); if (ACPI_FAILURE (Status)) { return (Status); @@ -362,11 +361,6 @@ AcpiEvFixedEventDetect ( return (IntStatus); } - if (FixedEnable & ACPI_BITMASK_PCIEXP_WAKE_DISABLE) - FixedEnable &= ~ACPI_BITMASK_PCIEXP_WAKE_DISABLE; - else - FixedEnable |= ACPI_BITMASK_PCIEXP_WAKE_DISABLE; - ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, "Fixed Event Block: Enable %08X Status %08X\n", FixedEnable, FixedStatus)); @@ -437,8 +431,7 @@ AcpiEvFixedEventDispatch ( { (void) AcpiWriteBitRegister ( AcpiGbl_FixedEventInfo[Event].EnableRegisterId, - (Event == ACPI_EVENT_PCIE_WAKE) ? - ACPI_ENABLE_EVENT : ACPI_DISABLE_EVENT); + ACPI_DISABLE_EVENT); ACPI_ERROR ((AE_INFO, "No installed handler for fixed event - %s (%u), disabling", diff --git a/src/acpica/source/components/executer/exserial.c b/src/acpica/source/components/executer/exserial.c index 6d57e376..f51047f9 100644 --- a/src/acpica/source/components/executer/exserial.c +++ b/src/acpica/source/components/executer/exserial.c @@ -505,8 +505,7 @@ AcpiExWriteSerialBus ( /* Copy the input buffer data to the transfer buffer */ Buffer = BufferDesc->Buffer.Pointer; - DataLength = (BufferLength < SourceDesc->Buffer.Length ? - BufferLength : SourceDesc->Buffer.Length); + DataLength = ACPI_MIN (BufferLength, SourceDesc->Buffer.Length); memcpy (Buffer, SourceDesc->Buffer.Pointer, DataLength); /* Lock entire transaction if requested */ diff --git a/src/acpica/source/components/hardware/hwsleep.c b/src/acpica/source/components/hardware/hwsleep.c index d9bb8ae0..0e4e17a0 100644 --- a/src/acpica/source/components/hardware/hwsleep.c +++ b/src/acpica/source/components/hardware/hwsleep.c @@ -475,17 +475,6 @@ AcpiHwLegacyWake ( AcpiGbl_FixedEventInfo[ACPI_EVENT_SLEEP_BUTTON].StatusRegisterId, ACPI_CLEAR_STATUS); - /* Enable pcie wake event if support */ - if ((AcpiGbl_FADT.Flags & ACPI_FADT_PCI_EXPRESS_WAKE)) - { - (void) AcpiWriteBitRegister ( - AcpiGbl_FixedEventInfo[ACPI_EVENT_PCIE_WAKE].EnableRegisterId, - ACPI_DISABLE_EVENT); - (void) AcpiWriteBitRegister ( - AcpiGbl_FixedEventInfo[ACPI_EVENT_PCIE_WAKE].StatusRegisterId, - ACPI_CLEAR_STATUS); - } - AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING); return_ACPI_STATUS (Status); } diff --git a/src/acpica/source/components/parser/psopcode.c b/src/acpica/source/components/parser/psopcode.c index db0c2e47..a161fa45 100644 --- a/src/acpica/source/components/parser/psopcode.c +++ b/src/acpica/source/components/parser/psopcode.c @@ -436,7 +436,7 @@ const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] = /* ACPI 3.0 opcodes */ -/* 7E */ ACPI_OP ("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R, AML_FLAGS_EXEC_0A_0T_1R), +/* 7E */ ACPI_OP ("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R, AML_FLAGS_EXEC_0A_0T_1R | AML_NO_OPERAND_RESOLVE), /* ACPI 5.0 opcodes */ diff --git a/src/acpica/source/components/resources/rsaddr.c b/src/acpica/source/components/resources/rsaddr.c index beee8380..8bad02dd 100644 --- a/src/acpica/source/components/resources/rsaddr.c +++ b/src/acpica/source/components/resources/rsaddr.c @@ -431,11 +431,11 @@ AcpiRsGetAddressCommon ( ACPI_RESOURCE *Resource, AML_RESOURCE *Aml) { + /* Avoid undefined behavior: member access within misaligned address */ AML_RESOURCE_ADDRESS Address; memcpy(&Address, Aml, sizeof(Address)); - ACPI_FUNCTION_ENTRY(); /* Validate the Resource Type */ diff --git a/src/acpica/source/components/resources/rscreate.c b/src/acpica/source/components/resources/rscreate.c index 583abe1a..da0967ee 100644 --- a/src/acpica/source/components/resources/rscreate.c +++ b/src/acpica/source/components/resources/rscreate.c @@ -475,9 +475,9 @@ AcpiRsCreatePciRoutingTable ( /* Use *remaining* length of the buffer as max for pathname */ PathBuffer.Length = OutputBuffer->Length - - (UINT32) ((UINT8 *) UserPrt->u.Source - + (UINT32) ((UINT8 *) UserPrt->Source - (UINT8 *) OutputBuffer->Pointer); - PathBuffer.Pointer = UserPrt->u.Source; + PathBuffer.Pointer = UserPrt->Source; Status = AcpiNsHandleToPathname ( (ACPI_HANDLE) Node, &PathBuffer, FALSE); @@ -488,12 +488,12 @@ AcpiRsCreatePciRoutingTable ( /* +1 to include null terminator */ - UserPrt->Length += (UINT32) strlen (UserPrt->u.Source) + 1; + UserPrt->Length += (UINT32) strlen (UserPrt->Source) + 1; break; case ACPI_TYPE_STRING: - strcpy (UserPrt->u.Source, ObjDesc->String.Pointer); + strcpy (UserPrt->Source, ObjDesc->String.Pointer); /* * Add to the Length field the length of the string diff --git a/src/acpica/source/components/resources/rsdumpinfo.c b/src/acpica/source/components/resources/rsdumpinfo.c index 2801e0d7..f15b7b98 100644 --- a/src/acpica/source/components/resources/rsdumpinfo.c +++ b/src/acpica/source/components/resources/rsdumpinfo.c @@ -182,7 +182,7 @@ ACPI_RSDUMP_INFO AcpiRsDumpIrq[7] = {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Polarity), "Polarity", AcpiGbl_LlDecode}, {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Irq.Shareable), "Sharing", AcpiGbl_ShrDecode}, {ACPI_RSD_UINT8 , ACPI_RSD_OFFSET (Irq.InterruptCount), "Interrupt Count", NULL}, - {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Irq.u.Interrupts[0]), "Interrupt List", NULL} + {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Irq.Interrupts[0]), "Interrupt List", NULL} }; ACPI_RSDUMP_INFO AcpiRsDumpDma[6] = @@ -192,7 +192,7 @@ ACPI_RSDUMP_INFO AcpiRsDumpDma[6] = {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Dma.BusMaster), "Mastering", AcpiGbl_BmDecode}, {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Dma.Transfer), "Transfer Type", AcpiGbl_SizDecode}, {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Dma.ChannelCount), "Channel Count", NULL}, - {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Dma.u.Channels[0]), "Channel List", NULL} + {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Dma.Channels[0]), "Channel List", NULL} }; ACPI_RSDUMP_INFO AcpiRsDumpStartDpf[4] = @@ -327,7 +327,7 @@ ACPI_RSDUMP_INFO AcpiRsDumpExtIrq[8] = {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Shareable), "Sharing", AcpiGbl_ShrDecode}, {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (ExtendedIrq.ResourceSource), NULL, NULL}, {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (ExtendedIrq.InterruptCount), "Interrupt Count", NULL}, - {ACPI_RSD_DWORDLIST,ACPI_RSD_OFFSET (ExtendedIrq.u.Interrupts[0]), "Interrupt List", NULL} + {ACPI_RSD_DWORDLIST,ACPI_RSD_OFFSET (ExtendedIrq.Interrupts[0]), "Interrupt List", NULL} }; ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[6] = @@ -555,7 +555,7 @@ ACPI_RSDUMP_INFO AcpiRsDumpPrt[5] = {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPrt), NULL, NULL}, {ACPI_RSD_UINT64, ACPI_PRT_OFFSET (Address), "Address", NULL}, {ACPI_RSD_UINT32, ACPI_PRT_OFFSET (Pin), "Pin", NULL}, - {ACPI_RSD_STRING, ACPI_PRT_OFFSET (u.Source[0]), "Source", NULL}, + {ACPI_RSD_STRING, ACPI_PRT_OFFSET (Source[0]), "Source", NULL}, {ACPI_RSD_UINT32, ACPI_PRT_OFFSET (SourceIndex), "Source Index", NULL} }; diff --git a/src/acpica/source/components/resources/rsirq.c b/src/acpica/source/components/resources/rsirq.c index 10256c50..c2d306aa 100644 --- a/src/acpica/source/components/resources/rsirq.c +++ b/src/acpica/source/components/resources/rsirq.c @@ -171,7 +171,7 @@ ACPI_RSCONVERT_INFO AcpiRsGetIrq[9] = /* Get the IRQ mask (bytes 1:2) */ - {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.u.Interrupts[0]), + {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.Interrupts[0]), AML_OFFSET (Irq.IrqMask), ACPI_RS_OFFSET (Data.Irq.InterruptCount)}, @@ -227,7 +227,7 @@ ACPI_RSCONVERT_INFO AcpiRsSetIrq[14] = /* Convert interrupt list to 16-bit IRQ bitmask */ - {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.u.Interrupts[0]), + {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.Interrupts[0]), AML_OFFSET (Irq.IrqMask), ACPI_RS_OFFSET (Data.Irq.InterruptCount)}, @@ -345,14 +345,14 @@ ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[10] = /* Copy every IRQ in the table, each is 32 bits */ - {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.ExtendedIrq.u.Interrupts[0]), - AML_OFFSET (ExtendedIrq.u.Interrupts[0]), + {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.ExtendedIrq.Interrupts[0]), + AML_OFFSET (ExtendedIrq.Interrupts[0]), 0}, /* Optional ResourceSource (Index and String) */ {ACPI_RSC_SOURCEX, ACPI_RS_OFFSET (Data.ExtendedIrq.ResourceSource), - ACPI_RS_OFFSET (Data.ExtendedIrq.u.Interrupts[0]), + ACPI_RS_OFFSET (Data.ExtendedIrq.Interrupts[0]), sizeof (AML_RESOURCE_EXTENDED_IRQ)} }; @@ -389,7 +389,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertDma[6] = /* DMA channel mask bits */ - {ACPI_RSC_BITMASK, ACPI_RS_OFFSET (Data.Dma.u.Channels[0]), + {ACPI_RSC_BITMASK, ACPI_RS_OFFSET (Data.Dma.Channels[0]), AML_OFFSET (Dma.DmaChannelMask), ACPI_RS_OFFSET (Data.Dma.ChannelCount)} }; diff --git a/src/acpica/source/components/utilities/utdebug.c b/src/acpica/source/components/utilities/utdebug.c index b0c3640f..82e8a620 100644 --- a/src/acpica/source/components/utilities/utdebug.c +++ b/src/acpica/source/components/utilities/utdebug.c @@ -185,7 +185,12 @@ AcpiUtInitStackPtrTrace ( ACPI_SIZE CurrentSp; +#pragma GCC diagnostic push +#if defined(__GNUC__) && __GNUC__ >= 12 +#pragma GCC diagnostic ignored "-Wdangling-pointer=" +#endif AcpiGbl_EntryStackPointer = &CurrentSp; +#pragma GCC diagnostic pop } diff --git a/src/acpica/source/components/utilities/utglobal.c b/src/acpica/source/components/utilities/utglobal.c index 28e4c341..c3b3688b 100644 --- a/src/acpica/source/components/utilities/utglobal.c +++ b/src/acpica/source/components/utilities/utglobal.c @@ -287,7 +287,6 @@ ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] = /* ACPI_EVENT_POWER_BUTTON */ {ACPI_BITREG_POWER_BUTTON_STATUS, ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_ENABLE}, /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE}, - /* ACPI_EVENT_PCIE_WAKE */ {ACPI_BITREG_PCIEXP_WAKE_STATUS, ACPI_BITREG_PCIEXP_WAKE_DISABLE, ACPI_BITMASK_PCIEXP_WAKE_STATUS, ACPI_BITMASK_PCIEXP_WAKE_DISABLE}, }; #endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/src/acpica/source/include/acdebug.h b/src/acpica/source/include/acdebug.h index c1596ee8..054de129 100644 --- a/src/acpica/source/include/acdebug.h +++ b/src/acpica/source/include/acdebug.h @@ -619,4 +619,8 @@ AcpiDbUint32ToHexString ( UINT32 Value, char *Buffer); +void +AcpiDbGenerateInterrupt ( + char *GsivArg); + #endif /* __ACDEBUG_H__ */ diff --git a/src/acpica/source/include/acdisasm.h b/src/acpica/source/include/acdisasm.h index afc9034b..6f37d355 100644 --- a/src/acpica/source/include/acdisasm.h +++ b/src/acpica/source/include/acdisasm.h @@ -554,6 +554,17 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt14[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt15[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt16[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt17[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt18[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt19[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt20[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt21[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt22[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt23[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt24[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt25[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt26[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt27[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt128[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[]; @@ -646,6 +657,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhct[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctNodeHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctIsa1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctIsaPad[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctCmo1[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctMmu1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctHartInfo1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRhctHartInfo2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[]; diff --git a/src/acpica/source/include/acglobal.h b/src/acpica/source/include/acglobal.h index 28fc6514..9df72a57 100644 --- a/src/acpica/source/include/acglobal.h +++ b/src/acpica/source/include/acglobal.h @@ -268,6 +268,7 @@ ACPI_GLOBAL (ACPI_TABLE_HANDLER, AcpiGbl_TableHandler); ACPI_GLOBAL (void *, AcpiGbl_TableHandlerContext); ACPI_GLOBAL (ACPI_INTERFACE_HANDLER, AcpiGbl_InterfaceHandler); ACPI_GLOBAL (ACPI_SCI_HANDLER_INFO *, AcpiGbl_SciHandlerList); +ACPI_GLOBAL (ACPI_GED_HANDLER_INFO *, AcpiGbl_GedHandlerList); /* Owner ID support */ diff --git a/src/acpica/source/include/aclocal.h b/src/acpica/source/include/aclocal.h index 9c090a07..99459a8b 100644 --- a/src/acpica/source/include/aclocal.h +++ b/src/acpica/source/include/aclocal.h @@ -767,6 +767,15 @@ typedef struct acpi_field_info } ACPI_FIELD_INFO; +/* Information about the interrupt ID and _EVT of a GED device */ + +typedef struct acpi_ged_handler_info +{ + struct acpi_ged_handler_info *Next; + UINT32 IntId; /* The interrupt ID that triggers the execution ofthe EvtMethod. */ + ACPI_NAMESPACE_NODE *EvtMethod; /* The _EVT method to be executed when an interrupt with ID = IntID is received */ + +} ACPI_GED_HANDLER_INFO; /***************************************************************************** * @@ -786,13 +795,13 @@ typedef struct acpi_field_info UINT8 DescriptorType; /* To differentiate various internal objs */\ UINT8 Flags; \ UINT16 Value; \ - UINT16 State; + UINT16 State /* There are 2 bytes available here until the next natural alignment boundary */ typedef struct acpi_common_state { - ACPI_STATE_COMMON + ACPI_STATE_COMMON; } ACPI_COMMON_STATE; @@ -801,7 +810,7 @@ typedef struct acpi_common_state */ typedef struct acpi_update_state { - ACPI_STATE_COMMON + ACPI_STATE_COMMON; union acpi_operand_object *Object; } ACPI_UPDATE_STATE; @@ -812,7 +821,7 @@ typedef struct acpi_update_state */ typedef struct acpi_pkg_state { - ACPI_STATE_COMMON + ACPI_STATE_COMMON; UINT32 Index; union acpi_operand_object *SourceObject; union acpi_operand_object *DestObject; @@ -829,7 +838,7 @@ typedef struct acpi_pkg_state */ typedef struct acpi_control_state { - ACPI_STATE_COMMON + ACPI_STATE_COMMON; UINT16 Opcode; union acpi_parse_object *PredicateOp; UINT8 *AmlPredicateStart; /* Start of if/while predicate */ @@ -844,7 +853,7 @@ typedef struct acpi_control_state */ typedef struct acpi_scope_state { - ACPI_STATE_COMMON + ACPI_STATE_COMMON; ACPI_NAMESPACE_NODE *Node; } ACPI_SCOPE_STATE; @@ -852,7 +861,7 @@ typedef struct acpi_scope_state typedef struct acpi_pscope_state { - ACPI_STATE_COMMON + ACPI_STATE_COMMON; UINT32 ArgCount; /* Number of fixed arguments */ union acpi_parse_object *Op; /* Current op being parsed */ UINT8 *ArgEnd; /* Current argument end */ @@ -868,7 +877,7 @@ typedef struct acpi_pscope_state */ typedef struct acpi_thread_state { - ACPI_STATE_COMMON + ACPI_STATE_COMMON; UINT8 CurrentSyncLevel; /* Mutex Sync (nested acquire) level */ struct acpi_walk_state *WalkStateList; /* Head of list of WalkStates for this thread */ union acpi_operand_object *AcquiredMutexList; /* List of all currently acquired mutexes */ @@ -883,7 +892,7 @@ typedef struct acpi_thread_state */ typedef struct acpi_result_values { - ACPI_STATE_COMMON + ACPI_STATE_COMMON; union acpi_operand_object *ObjDesc [ACPI_RESULTS_FRAME_OBJ_NUM]; } ACPI_RESULT_VALUES; @@ -914,7 +923,7 @@ typedef struct acpi_global_notify_handler */ typedef struct acpi_notify_info { - ACPI_STATE_COMMON + ACPI_STATE_COMMON; UINT8 HandlerListId; ACPI_NAMESPACE_NODE *Node; union acpi_operand_object *HandlerListHead; diff --git a/src/acpica/source/include/acnames.h b/src/acpica/source/include/acnames.h index a6cdd2e2..e9f0af8c 100644 --- a/src/acpica/source/include/acnames.h +++ b/src/acpica/source/include/acnames.h @@ -164,6 +164,7 @@ #define METHOD_NAME__DDN "_DDN" #define METHOD_NAME__DIS "_DIS" #define METHOD_NAME__DMA "_DMA" +#define METHOD_NAME__EVT "_EVT" #define METHOD_NAME__HID "_HID" #define METHOD_NAME__INI "_INI" #define METHOD_NAME__PLD "_PLD" diff --git a/src/acpica/source/include/acpixf.h b/src/acpica/source/include/acpixf.h index a7d61033..c8e3b4c4 100644 --- a/src/acpica/source/include/acpixf.h +++ b/src/acpica/source/include/acpixf.h @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20230331 +#define ACPI_CA_VERSION 0x20230628 #include "acconfig.h" #include "actypes.h" diff --git a/src/acpica/source/include/acpredef.h b/src/acpica/source/include/acpredef.h index ca47e7cc..303dfaec 100644 --- a/src/acpica/source/include/acpredef.h +++ b/src/acpica/source/include/acpredef.h @@ -579,6 +579,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = {{"_DOS", METHOD_1ARGS (ACPI_TYPE_INTEGER), METHOD_NO_RETURN_VALUE}}, + + { {"_DSC", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, {{"_DSD", METHOD_0ARGS, /* ACPI 6.0 */ METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: 1 Buf, 1 Pkg */ diff --git a/src/acpica/source/include/acrestyp.h b/src/acpica/source/include/acrestyp.h index 3065bdce..0dab6ec7 100644 --- a/src/acpica/source/include/acrestyp.h +++ b/src/acpica/source/include/acrestyp.h @@ -293,7 +293,7 @@ typedef struct acpi_resource_irq union { UINT8 Interrupt; ACPI_FLEX_ARRAY(UINT8, Interrupts); - } u; + }; } ACPI_RESOURCE_IRQ; @@ -306,7 +306,7 @@ typedef struct acpi_resource_dma union { UINT8 Channel; ACPI_FLEX_ARRAY(UINT8, Channels); - } u; + }; } ACPI_RESOURCE_DMA; @@ -547,7 +547,7 @@ typedef struct acpi_resource_extended_irq union { UINT32 Interrupt; ACPI_FLEX_ARRAY(UINT32, Interrupts); - } u; + }; } ACPI_RESOURCE_EXTENDED_IRQ; @@ -951,7 +951,7 @@ typedef struct acpi_pci_routing_table union { char Pad[4]; /* pad to 64 bits so sizeof() works in all cases */ ACPI_FLEX_ARRAY(char, Source); - } u; + }; } ACPI_PCI_ROUTING_TABLE; #endif /* __ACRESTYP_H__ */ diff --git a/src/acpica/source/include/actbinfo.h b/src/acpica/source/include/actbinfo.h index 5417aff4..e0ad61bb 100644 --- a/src/acpica/source/include/actbinfo.h +++ b/src/acpica/source/include/actbinfo.h @@ -334,7 +334,18 @@ #define ACPI_MADT14_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_REDISTRIBUTOR,f) #define ACPI_MADT15_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_TRANSLATOR,f) #define ACPI_MADT16_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_MULTIPROC_WAKEUP,f) -#define ACPI_MADT17_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_OEM_DATA,f) +#define ACPI_MADT17_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_CORE_PIC,f) +#define ACPI_MADT18_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LIO_PIC,f) +#define ACPI_MADT19_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_HT_PIC,f) +#define ACPI_MADT20_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_EIO_PIC,f) +#define ACPI_MADT21_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_MSI_PIC,f) +#define ACPI_MADT22_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_BIO_PIC,f) +#define ACPI_MADT23_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LPC_PIC,f) +#define ACPI_MADT24_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_RINTC,f) +#define ACPI_MADT25_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_IMSIC,f) +#define ACPI_MADT26_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_APLIC,f) +#define ACPI_MADT27_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_PLIC,f) +#define ACPI_MADT128_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_OEM_DATA,f) #define ACPI_MADTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) #define ACPI_MCFG0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f) #define ACPI_MPAM0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPAM_MSC_NODE,f) @@ -403,6 +414,8 @@ #define ACPI_PRMT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PRMT_HANDLER_INFO,f) #define ACPI_RHCTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RHCT_NODE_HEADER,f) #define ACPI_RHCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RHCT_ISA_STRING,f) +#define ACPI_RHCT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RHCT_CMO_NODE,f) +#define ACPI_RHCT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RHCT_MMU_NODE,f) #define ACPI_RHCTFFFF_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_RHCT_HART_INFO,f) #define ACPI_S3PTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f) #define ACPI_S3PT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_RESUME,f) diff --git a/src/acpica/source/include/actbl1.h b/src/acpica/source/include/actbl1.h index 1b115ae3..c1a960ac 100644 --- a/src/acpica/source/include/actbl1.h +++ b/src/acpica/source/include/actbl1.h @@ -635,7 +635,7 @@ typedef struct acpi_cdat_dsmas /* Flags for subtable above */ -#define ACPI_CEDT_DSMAS_NON_VOLATILE (1 << 2) +#define ACPI_CDAT_DSMAS_NON_VOLATILE (1 << 2) /* Subtable 1: Device scoped Latency and Bandwidth Information Structure (DSLBIS) */ @@ -1222,7 +1222,7 @@ typedef struct acpi_dmar_andd union { char __pad; ACPI_FLEX_ARRAY(char, DeviceName); - } u; + }; } ACPI_DMAR_ANDD; diff --git a/src/acpica/source/include/actbl2.h b/src/acpica/source/include/actbl2.h index 9b2812a0..140b386f 100644 --- a/src/acpica/source/include/actbl2.h +++ b/src/acpica/source/include/actbl2.h @@ -1136,7 +1136,10 @@ enum AcpiMadtType ACPI_MADT_TYPE_BIO_PIC = 22, ACPI_MADT_TYPE_LPC_PIC = 23, ACPI_MADT_TYPE_RINTC = 24, - ACPI_MADT_TYPE_RESERVED = 25, /* 25 to 0x7F are reserved */ + ACPI_MADT_TYPE_IMSIC = 25, + ACPI_MADT_TYPE_APLIC = 26, + ACPI_MADT_TYPE_PLIC = 27, + ACPI_MADT_TYPE_RESERVED = 28, /* 28 to 0x7F are reserved */ ACPI_MADT_TYPE_OEM_RESERVED = 0x80 /* 0x80 to 0xFF are reserved for OEM use */ }; @@ -1550,14 +1553,17 @@ enum AcpiMadtLpcPicVersion { }; /* 24: RISC-V INTC */ -struct acpi_madt_rintc { +typedef struct acpi_madt_rintc { ACPI_SUBTABLE_HEADER Header; UINT8 Version; UINT8 Reserved; UINT32 Flags; UINT64 HartId; UINT32 Uid; /* ACPI processor UID */ -}; + UINT32 ExtIntcId; /* External INTC Id */ + UINT64 ImsicAddr; /* IMSIC base address */ + UINT32 ImsicSize; /* IMSIC size */ +} ACPI_MADT_RINTC; /* Values for RISC-V INTC Version field above */ @@ -1567,6 +1573,49 @@ enum AcpiMadtRintcVersion { ACPI_MADT_RINTC_VERSION_RESERVED = 2 /* 2 and greater are reserved */ }; +/* 25: RISC-V IMSIC */ +typedef struct acpi_madt_imsic { + ACPI_SUBTABLE_HEADER Header; + UINT8 Version; + UINT8 Reserved; + UINT32 Flags; + UINT16 NumIds; + UINT16 NumGuestIds; + UINT8 GuestIndexBits; + UINT8 HartIndexBits; + UINT8 GroupIndexBits; + UINT8 GroupIndexShift; +} ACPI_MADT_IMSIC; + +/* 26: RISC-V APLIC */ +typedef struct acpi_madt_aplic { + ACPI_SUBTABLE_HEADER Header; + UINT8 Version; + UINT8 Id; + UINT32 Flags; + UINT8 HwId[8]; + UINT16 NumIdcs; + UINT16 NumSources; + UINT32 GsiBase; + UINT64 BaseAddr; + UINT32 Size; +} ACPI_MADT_APLIC; + +/* 27: RISC-V PLIC */ +typedef struct acpi_madt_plic { + ACPI_SUBTABLE_HEADER Header; + UINT8 Version; + UINT8 Id; + UINT8 HwId[8]; + UINT16 NumIrqs; + UINT16 MaxPrio; + UINT32 Flags; + UINT32 Size; + UINT64 BaseAddr; + UINT32 GsiBase; +} ACPI_MADT_PLIC; + + /* 80: OEM data */ typedef struct acpi_madt_oem_data @@ -3285,12 +3334,15 @@ enum AcpiRgrtImageType typedef struct acpi_table_rhct { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ - UINT32 Reserved; + UINT32 Flags; /* RHCT flags */ UINT64 TimeBaseFreq; UINT32 NodeCount; UINT32 NodeOffset; } ACPI_TABLE_RHCT; +/* RHCT Flags */ + +#define ACPI_RHCT_TIMER_CANNOT_WAKEUP_CPU (1) /* * RHCT subtables */ @@ -3304,6 +3356,9 @@ typedef struct acpi_rhct_node_header { enum acpi_rhct_node_type { ACPI_RHCT_NODE_TYPE_ISA_STRING = 0x0000, + ACPI_RHCT_NODE_TYPE_CMO = 0x0001, + ACPI_RHCT_NODE_TYPE_MMU = 0x0002, + ACPI_RHCT_NODE_TYPE_RESERVED = 0x0003, ACPI_RHCT_NODE_TYPE_HART_INFO = 0xFFFF, }; @@ -3317,6 +3372,24 @@ typedef struct acpi_rhct_isa_string { char Isa[]; } ACPI_RHCT_ISA_STRING; +typedef struct acpi_rhct_cmo_node { + UINT8 Reserved; /* Must be zero */ + UINT8 CbomSize; /* CBOM size in powerof 2 */ + UINT8 CbopSize; /* CBOP size in powerof 2 */ + UINT8 CbozSize; /* CBOZ size in powerof 2 */ +} ACPI_RHCT_CMO_NODE; + +typedef struct acpi_rhct_mmu_node { + UINT8 Reserved; /* Must be zero */ + UINT8 MmuType; /* Virtual Address Scheme */ +} ACPI_RHCT_MMU_NODE; + +enum acpi_rhct_mmu_type { + ACPI_RHCT_MMU_TYPE_SV39 = 0, + ACPI_RHCT_MMU_TYPE_SV48 = 1, + ACPI_RHCT_MMU_TYPE_SV57 = 2 +}; + /* Hart Info node structure */ typedef struct acpi_rhct_hart_info { UINT16 NumOffsets; diff --git a/src/acpica/source/include/actbl3.h b/src/acpica/source/include/actbl3.h index 15ef0195..1438c1db 100644 --- a/src/acpica/source/include/actbl3.h +++ b/src/acpica/source/include/actbl3.h @@ -454,13 +454,15 @@ typedef struct acpi_srat_gic_its_affinity * 6: ACPI_SRAT_TYPE_GENERIC_PORT_AFFINITY */ +#define ACPI_SRAT_DEVICE_HANDLE_SIZE 16 + typedef struct acpi_srat_generic_affinity { ACPI_SUBTABLE_HEADER Header; UINT8 Reserved; UINT8 DeviceHandleType; UINT32 ProximityDomain; - UINT8 DeviceHandle[16]; + UINT8 DeviceHandle[ACPI_SRAT_DEVICE_HANDLE_SIZE]; UINT32 Flags; UINT32 Reserved1; diff --git a/src/acpica/source/include/actypes.h b/src/acpica/source/include/actypes.h index c0f0a87f..93382052 100644 --- a/src/acpica/source/include/actypes.h +++ b/src/acpica/source/include/actypes.h @@ -873,8 +873,7 @@ typedef UINT32 ACPI_EVENT_TYPE; #define ACPI_EVENT_POWER_BUTTON 2 #define ACPI_EVENT_SLEEP_BUTTON 3 #define ACPI_EVENT_RTC 4 -#define ACPI_EVENT_PCIE_WAKE 5 -#define ACPI_EVENT_MAX 5 +#define ACPI_EVENT_MAX 4 #define ACPI_NUM_FIXED_EVENTS ACPI_EVENT_MAX + 1 /* diff --git a/src/acpica/source/include/amlresrc.h b/src/acpica/source/include/amlresrc.h index a8e288ad..05fa1505 100644 --- a/src/acpica/source/include/amlresrc.h +++ b/src/acpica/source/include/amlresrc.h @@ -506,7 +506,7 @@ typedef struct aml_resource_extended_irq union { UINT32 Interrupt; ACPI_FLEX_ARRAY(UINT32, Interrupts); - } u; + }; /* ResSourceIndex, ResSource optional fields follow */ } AML_RESOURCE_EXTENDED_IRQ; diff --git a/src/acpica/source/include/platform/aclinux.h b/src/acpica/source/include/platform/aclinux.h index da37a2fa..f5234b97 100644 --- a/src/acpica/source/include/platform/aclinux.h +++ b/src/acpica/source/include/platform/aclinux.h @@ -312,6 +312,7 @@ #ifdef ACPI_USE_STANDARD_HEADERS #include <stddef.h> #include <unistd.h> +#include <stdint.h> #define ACPI_OFFSET(d, f) offsetof(d, f) #endif diff --git a/src/acpica/source/tools/acpiexec/aeinstall.c b/src/acpica/source/tools/acpiexec/aeinstall.c index 9e1940c3..b855fcbc 100644 --- a/src/acpica/source/tools/acpiexec/aeinstall.c +++ b/src/acpica/source/tools/acpiexec/aeinstall.c @@ -176,6 +176,13 @@ AeInstallPciHandler ( void *Context, void **ReturnValue); +static ACPI_STATUS +AeInstallGedHandler ( + ACPI_HANDLE ObjHandle, + UINT32 Level, + void *Context, + void **ReturnValue); + BOOLEAN AcpiGbl_DisplayRegionAccess = FALSE; ACPI_CONNECTION_INFO AeMyContext; @@ -343,6 +350,110 @@ AeInstallRegionHandlers ( } } +/******************************************************************************* + * + * FUNCTION: AeInstallGedHandler + * + * PARAMETERS: ACPI_WALK_NAMESPACE callback + * + * RETURN: Status + * + * DESCRIPTION: Walk entire namespace, install a handler for every GED + * device found. + * + ******************************************************************************/ +static ACPI_STATUS +AeInstallGedHandler ( + ACPI_HANDLE ObjHandle, + UINT32 Level, + void *Context, + void **ReturnValue) +{ + + ACPI_BUFFER ReturnBuffer; + ACPI_STATUS Status; + ACPI_RESOURCE *ResourceList; + ACPI_RESOURCE_EXTENDED_IRQ *extended_irq_rsc; + ACPI_NAMESPACE_NODE *Node; + ACPI_NAMESPACE_NODE *EvtMethodNode; + + ACPI_FUNCTION_ENTRY(); + + /* Obtain the Namespace Node of this GED object handle. */ + Node = AcpiNsValidateHandle (ObjHandle); + if (!Node) + { + return (AE_BAD_PARAMETER); + } + + /* + * A GED device must have one _EVT method. + * Obtain the _EVT method and store it in the global + * GED register. + */ + Status = AcpiNsSearchOneScope ( + *ACPI_CAST_PTR (ACPI_NAME, METHOD_NAME__EVT), + Node, + ACPI_TYPE_METHOD, + &EvtMethodNode + ); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("Failed to obtain _EVT method for the GED device.\n"); + return Status; + } + + ReturnBuffer.Pointer = NULL; + ReturnBuffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; + + Status = AcpiGetCurrentResources (ObjHandle, &ReturnBuffer); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("AcpiGetCurrentResources failed: %s\n", + AcpiFormatException (Status)); + return Status; + } + + /* Traverse the _CRS resource list */ + ResourceList = ACPI_CAST_PTR (ACPI_RESOURCE, ReturnBuffer.Pointer); + while (ResourceList->Type != ACPI_RESOURCE_TYPE_END_TAG) { + + switch (ResourceList->Type) { + case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: { + + /* + * Found an Interrupt resource. Link the interrupt resource + * and the _EVT method of this GED device in the GED event handler list. + */ + ACPI_GED_HANDLER_INFO *GedHandler = + ACPI_ALLOCATE (sizeof (ACPI_SCI_HANDLER_INFO)); + if (!GedHandler) + { + return AE_NO_MEMORY; + } + + GedHandler->Next = AcpiGbl_GedHandlerList; + AcpiGbl_GedHandlerList = GedHandler; + + extended_irq_rsc = &ResourceList->Data.ExtendedIrq; + + GedHandler->IntId = extended_irq_rsc->Interrupts[0]; + GedHandler->EvtMethod = EvtMethodNode; + + AcpiOsPrintf ("Interrupt ID %d\n", extended_irq_rsc->Interrupts[0]); + + break; + } + default: + + AcpiOsPrintf ("Resource type %X\n", ResourceList->Type); + } + + ResourceList = ACPI_NEXT_RESOURCE (ResourceList); + } + + return AE_OK; +} /******************************************************************************* * @@ -352,7 +463,7 @@ AeInstallRegionHandlers ( * * RETURN: Status * - * DESCRIPTION: Install handlers for all EC and PCI devices in the namespace + * DESCRIPTION: Install handlers for all EC, PCI and GED devices in the namespace * ******************************************************************************/ @@ -368,6 +479,11 @@ AeInstallDeviceHandlers ( /* Install a PCI handler */ AcpiGetDevices ("PNP0A08", AeInstallPciHandler, NULL, NULL); + + /* Install a GED handler */ + + AcpiGetDevices ("ACPI0013", AeInstallGedHandler, NULL, NULL); + return (AE_OK); }
Changes in this release of ACPICA are detailed on the ACPICA developer mailing list for ACPICA 20230628 Signed-off-by: Colin Ian King <colin.i.king@gmail.com> --- src/acpica/source/common/ahpredef.c | 1 + src/acpica/source/common/dmtable.c | 26 +++ src/acpica/source/common/dmtbdump2.c | 83 ++++++++- src/acpica/source/common/dmtbinfo1.c | 2 +- src/acpica/source/common/dmtbinfo2.c | 173 +++++++++++++++++- src/acpica/source/compiler/aslrestype2.c | 6 +- src/acpica/source/compiler/dttable2.c | 67 ++++++- src/acpica/source/compiler/dttemplate.h | 51 +++++- .../source/components/debugger/dbcmds.c | 60 +++++- .../source/components/debugger/dbinput.c | 10 +- .../source/components/disassembler/dmresrcl.c | 2 +- .../source/components/dispatcher/dswstate.c | 4 +- src/acpica/source/components/events/evevent.c | 11 +- .../source/components/executer/exserial.c | 3 +- .../source/components/hardware/hwsleep.c | 11 -- .../source/components/parser/psopcode.c | 2 +- .../source/components/resources/rsaddr.c | 2 +- .../source/components/resources/rscreate.c | 8 +- .../source/components/resources/rsdumpinfo.c | 8 +- .../source/components/resources/rsirq.c | 12 +- .../source/components/utilities/utdebug.c | 5 + .../source/components/utilities/utglobal.c | 1 - src/acpica/source/include/acdebug.h | 4 + src/acpica/source/include/acdisasm.h | 13 ++ src/acpica/source/include/acglobal.h | 1 + src/acpica/source/include/aclocal.h | 29 ++- src/acpica/source/include/acnames.h | 1 + src/acpica/source/include/acpixf.h | 2 +- src/acpica/source/include/acpredef.h | 3 + src/acpica/source/include/acrestyp.h | 8 +- src/acpica/source/include/actbinfo.h | 15 +- src/acpica/source/include/actbl1.h | 4 +- src/acpica/source/include/actbl2.h | 81 +++++++- src/acpica/source/include/actbl3.h | 4 +- src/acpica/source/include/actypes.h | 3 +- src/acpica/source/include/amlresrc.h | 2 +- src/acpica/source/include/platform/aclinux.h | 1 + src/acpica/source/tools/acpiexec/aeinstall.c | 118 +++++++++++- 38 files changed, 740 insertions(+), 97 deletions(-)