diff --git a/.acpica-tools.metadata b/.acpica-tools.metadata new file mode 100644 index 0000000..232db2b --- /dev/null +++ b/.acpica-tools.metadata @@ -0,0 +1,2 @@ +f2467ae9c55ee4b24c21c0b06b402c6bdd444260 SOURCES/acpica-unix2-20180629.tar.gz +ccdf02b035f86624d0652b28580413ac2e21f6f6 SOURCES/acpitests-unix-20180629.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9230fc0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/acpica-unix2-20180629.tar.gz +SOURCES/acpitests-unix-20180629.tar.gz diff --git a/SOURCES/CEDT-support_01.patch b/SOURCES/CEDT-support_01.patch new file mode 100644 index 0000000..8c144aa --- /dev/null +++ b/SOURCES/CEDT-support_01.patch @@ -0,0 +1,179 @@ +commit 0b03aa8ebd7a5b2b9407893f123ee587af45926f +Author: Ben Widawsky +Date: Thu Feb 25 13:54:56 2021 -0800 + + CXL 2.0: CEDT: Add new CEDT table + + This sets up all of the boilerplate without actually doing anything. + + Signed-off-by: Ben Widawsky + +diff --git a/source/common/ahtable.c b/source/common/ahtable.c +index a313c7f..2679fae 100644 +--- a/source/common/ahtable.c ++++ b/source/common/ahtable.c +@@ -95,6 +95,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = + {ACPI_SIG_BERT, "Boot Error Record Table"}, + {ACPI_SIG_BGRT, "Boot Graphics Resource Table"}, + {ACPI_SIG_BOOT, "Simple Boot Flag Table"}, ++ {ACPI_SIG_CEDT, "CXL Early Discovery Table"}, + {ACPI_SIG_CPEP, "Corrected Platform Error Polling table"}, + {ACPI_SIG_CSRT, "Core System Resource Table"}, + {ACPI_SIG_DBG2, "Debug Port table type 2"}, +diff --git a/source/common/dmtable.c b/source/common/dmtable.c +index 0908e44..137b5b9 100644 +--- a/source/common/dmtable.c ++++ b/source/common/dmtable.c +@@ -376,6 +376,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = + {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert}, + {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt}, + {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot}, ++ {ACPI_SIG_CEDT, NULL, NULL, NULL, NULL}, + {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep}, + {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt}, + {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2}, +diff --git a/source/common/dmtbinfo1.c b/source/common/dmtbinfo1.c +index 4adb42a..cb41915 100644 +--- a/source/common/dmtbinfo1.c ++++ b/source/common/dmtbinfo1.c +@@ -236,6 +236,33 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[] = + }; + + ++/******************************************************************************* ++ * ++ * CEDT - CXL Early Discovery Table ++ * ++ ******************************************************************************/ ++ ++ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[] = ++{ ++ {ACPI_DMT_UINT8, ACPI_CEDT_OFFSET (Type), "Subtable Type", 0}, ++ {ACPI_DMT_UINT8, ACPI_CEDT_OFFSET (Reserved), "Reserved", 0}, ++ {ACPI_DMT_UINT16, ACPI_CEDT_OFFSET (Length), "Length", DT_LENGTH}, ++ ACPI_DMT_TERMINATOR ++}; ++ ++/* 0: CXL Host Bridge Structure */ ++ ++ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[] = ++{ ++ {ACPI_DMT_UINT32, ACPI_CEDT0_OFFSET (Uid), "Associated host bridge", 0}, ++ {ACPI_DMT_UINT32, ACPI_CEDT0_OFFSET (CxlVersion), "Specification version", 0}, ++ {ACPI_DMT_UINT32, ACPI_CEDT0_OFFSET (Reserved), "Reserved", 0}, ++ {ACPI_DMT_UINT64, ACPI_CEDT0_OFFSET (Base), "Register base", 0}, ++ {ACPI_DMT_UINT64, ACPI_CEDT0_OFFSET (Length), "Register length", 0}, ++ ACPI_DMT_TERMINATOR ++}; ++ ++ + /******************************************************************************* + * + * CPEP - Corrected Platform Error Polling table +diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h +index e9b7a48..5e94ee3 100644 +--- a/source/include/acdisasm.h ++++ b/source/include/acdisasm.h +@@ -256,6 +256,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsfHdr[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[]; ++extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[]; ++extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[]; +diff --git a/source/include/actbinfo.h b/source/include/actbinfo.h +index 8a1fd74..9735f22 100644 +--- a/source/include/actbinfo.h ++++ b/source/include/actbinfo.h +@@ -104,6 +104,8 @@ + #define ACPI_ASF2a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_CONTROL_DATA,f) + #define ACPI_ASF3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_RMCP,f) + #define ACPI_ASF4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f) ++#define ACPI_CEDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_HEADER, f) ++#define ACPI_CEDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CHBS, f) + #define ACPI_CPEP0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f) + #define ACPI_CSRT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_GROUP,f) + #define ACPI_CSRT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_SHARED_INFO,f) +diff --git a/source/include/actbl1.h b/source/include/actbl1.h +index b76195f..ce4737d 100644 +--- a/source/include/actbl1.h ++++ b/source/include/actbl1.h +@@ -64,6 +64,7 @@ + #define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */ + #define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */ + #define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */ ++#define ACPI_SIG_CEDT "CEDT" /* CXL Early Discovery Table */ + #define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */ + #define ACPI_SIG_CSRT "CSRT" /* Core System Resource Table */ + #define ACPI_SIG_DBG2 "DBG2" /* Debug Port table type 2 */ +@@ -383,6 +384,56 @@ typedef struct acpi_table_boot + + } ACPI_TABLE_BOOT; + ++/******************************************************************************* ++ * ++ * CEDT - CXL Early Discovery Table ++ * Version 1 ++ * ++ * Conforms to the "CXL Early Discovery Table" (CXL 2.0) ++ * ++ ******************************************************************************/ ++ ++typedef struct acpi_table_cedt ++{ ++ ACPI_TABLE_HEADER Header; /* Common ACPI table header */ ++ ++} ACPI_TABLE_CEDT; ++ ++/* CEDT subtable header (Performance Record Structure) */ ++ ++typedef struct acpi_cedt_header ++{ ++ UINT8 Type; ++ UINT8 Reserved; ++ UINT16 Length; ++ ++} ACPI_CEDT_HEADER; ++ ++/* Values for Type field above */ ++ ++enum AcpiCedtType ++{ ++ ACPI_CEDT_TYPE_CHBS = 0, ++}; ++ ++ ++/* ++ * CEDT subtables ++ */ ++ ++/* 0: CXL Host Bridge Structure */ ++ ++typedef struct acpi_cedt_chbs ++{ ++ ACPI_CEDT_HEADER Header; ++ UINT32 Uid; ++ UINT32 CxlVersion; ++ UINT32 Reserved; ++ UINT64 Base; ++ UINT64 Length; ++ ++} ACPI_CEDT_CHBS; ++ + + /******************************************************************************* + * +diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c +index ef74f17..8aa35fe 100644 +--- a/source/tools/acpisrc/astable.c ++++ b/source/tools/acpisrc/astable.c +@@ -529,6 +529,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { + {"ACPI_TABLE_BERT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_BGRT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_BOOT", SRC_TYPE_STRUCT}, ++ {"ACPI_TABLE_CEDT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_CPEP", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_CSRT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DBG2", SRC_TYPE_STRUCT}, diff --git a/SOURCES/CEDT-support_02.patch b/SOURCES/CEDT-support_02.patch new file mode 100644 index 0000000..586dabb --- /dev/null +++ b/SOURCES/CEDT-support_02.patch @@ -0,0 +1,123 @@ +commit b980be9b7fd364f62f62655e458325581a4f239c +Author: Ben Widawsky +Date: Thu Feb 25 14:11:46 2021 -0800 + + CXL 2.0: CEDT: Add table and subtable dumping + + Signed-off-by: Ben Widawsky + +diff --git a/source/common/dmtable.c b/source/common/dmtable.c +index 137b5b9..f483a78 100644 +--- a/source/common/dmtable.c ++++ b/source/common/dmtable.c +@@ -376,7 +376,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = + {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert}, + {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt}, + {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot}, +- {ACPI_SIG_CEDT, NULL, NULL, NULL, NULL}, ++ {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, NULL, NULL}, + {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep}, + {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt}, + {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2}, +diff --git a/source/common/dmtbdump1.c b/source/common/dmtbdump1.c +index 0103a6c..19a810f 100644 +--- a/source/common/dmtbdump1.c ++++ b/source/common/dmtbdump1.c +@@ -221,6 +221,82 @@ AcpiDmDumpAsf ( + } + } + ++/******************************************************************************* ++ * ++ * FUNCTION: AcpiDmDumpCedt ++ * ++ * PARAMETERS: Table - A CEDT table ++ * ++ * RETURN: None ++ * ++ * DESCRIPTION: Format the contents of a CEDT. This table type consists ++ * of an open-ended number of subtables. ++ * ++ ******************************************************************************/ ++ ++void ++AcpiDmDumpCedt ( ++ ACPI_TABLE_HEADER *Table) ++{ ++ ACPI_STATUS Status; ++ ACPI_CEDT_HEADER *Subtable; ++ UINT32 Length = Table->Length; ++ UINT32 Offset = sizeof (ACPI_TABLE_CEDT); ++ ACPI_DMTABLE_INFO *InfoTable; ++ ++ ++ /* There is no main table (other than the standard ACPI header) */ ++ ++ Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Table, Offset); ++ while (Offset < Table->Length) ++ { ++ /* Common subtable header */ ++ ++ AcpiOsPrintf ("\n"); ++ Status = AcpiDmDumpTable (Length, Offset, Subtable, ++ Subtable->Length, AcpiDmTableInfoCedtHdr); ++ if (ACPI_FAILURE (Status)) ++ { ++ return; ++ } ++ ++ switch (Subtable->Type) ++ { ++ case ACPI_CEDT_TYPE_CHBS: ++ ++ InfoTable = AcpiDmTableInfoCedt0; ++ break; ++ ++ default: ++ ++ AcpiOsPrintf ("\n**** Unknown CEDT subtable type 0x%X\n\n", ++ Subtable->Type); ++ ++ /* Attempt to continue */ ++ ++ if (!Subtable->Length) ++ { ++ AcpiOsPrintf ("Invalid zero length subtable\n"); ++ return; ++ } ++ goto NextSubtable; ++ } ++ ++ Status = AcpiDmDumpTable (Length, Offset, Subtable, ++ Subtable->Length, InfoTable); ++ if (ACPI_FAILURE (Status)) ++ { ++ return; ++ } ++ ++NextSubtable: ++ /* Point to next subtable */ ++ ++ Offset += Subtable->Length; ++ Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Subtable, ++ Subtable->Length); ++ } ++} + + /******************************************************************************* + * +diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h +index 5e94ee3..d7f348f 100644 +--- a/source/include/acdisasm.h ++++ b/source/include/acdisasm.h +@@ -533,6 +533,10 @@ void + AcpiDmDumpAsf ( + ACPI_TABLE_HEADER *Table); + ++void ++AcpiDmDumpCedt ( ++ ACPI_TABLE_HEADER *Table); ++ + void + AcpiDmDumpCpep ( + ACPI_TABLE_HEADER *Table); diff --git a/SOURCES/CEDT-support_03.patch b/SOURCES/CEDT-support_03.patch new file mode 100644 index 0000000..3082e60 --- /dev/null +++ b/SOURCES/CEDT-support_03.patch @@ -0,0 +1,58 @@ +commit 187e2f286f503cce9f57748da639dfccaeaecf96 +Author: Ben Widawsky +Date: Thu Feb 25 14:19:51 2021 -0800 + + CXL 2.0: CEDT: Add template + + Signed-off-by: Ben Widawsky + +diff --git a/source/common/dmtable.c b/source/common/dmtable.c +index f483a78..5b204a8 100644 +--- a/source/common/dmtable.c ++++ b/source/common/dmtable.c +@@ -376,7 +376,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = + {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert}, + {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt}, + {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot}, +- {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, NULL, NULL}, ++ {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, NULL, TemplateCedt}, + {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep}, + {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt}, + {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2}, +diff --git a/source/compiler/dtcompiler.h b/source/compiler/dtcompiler.h +index 5136f75..fd20109 100644 +--- a/source/compiler/dtcompiler.h ++++ b/source/compiler/dtcompiler.h +@@ -587,6 +587,7 @@ extern const unsigned char TemplateAsf[]; + extern const unsigned char TemplateBoot[]; + extern const unsigned char TemplateBert[]; + extern const unsigned char TemplateBgrt[]; ++extern const unsigned char TemplateCedt[]; + extern const unsigned char TemplateCpep[]; + extern const unsigned char TemplateCsrt[]; + extern const unsigned char TemplateDbg2[]; +diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h +index e3fbd8b..275003c 100644 +--- a/source/compiler/dttemplate.h ++++ b/source/compiler/dttemplate.h +@@ -96,6 +96,20 @@ const unsigned char TemplateBoot[] = + 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00 /* 00000020 "(.. ...." */ + }; + ++const unsigned char TemplateCedt[] = ++{ ++ /* FIXME: This is from QEMU */ ++ 0x43,0x45,0x44,0x54,0x44,0x00,0x00,0x00, /* 00000000 "CEDTD..." */ ++ 0x01,0x3E,0x42,0x4F,0x43,0x48,0x53,0x20, /* 00000008 ".>BOCHS " */ ++ 0x42,0x58,0x50,0x43,0x20,0x20,0x20,0x20, /* 00000010 "BXPC " */ ++ 0x01,0x00,0x00,0x00,0x42,0x58,0x50,0x43, /* 00000018 "....BXPC" */ ++ 0x01,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000020 "...... ." */ ++ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000028 "........" */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD0, /* 00000030 "........" */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000038 "........" */ ++ 0x00,0x00,0x00,0x00 /* 00000040 "...." */ ++}; ++ + const unsigned char TemplateCpep[] = + { + 0x43,0x50,0x45,0x50,0x34,0x00,0x00,0x00, /* 00000000 "CPEP4..." */ diff --git a/SOURCES/CEDT-support_04.patch b/SOURCES/CEDT-support_04.patch new file mode 100644 index 0000000..d6f6154 --- /dev/null +++ b/SOURCES/CEDT-support_04.patch @@ -0,0 +1,278 @@ +commit 1e6dded267b13c4aa0c3e16de0fa89d3b9c880e9 +Author: Robert Moore +Date: Thu Mar 11 13:12:08 2021 -0800 + + iASL/TableCompiler: Add compilation support for CEDT table. + Also, update the CEDT template. + +diff --git a/source/common/dmtable.c b/source/common/dmtable.c +index 5b204a8..530e872 100644 +--- a/source/common/dmtable.c ++++ b/source/common/dmtable.c +@@ -76,6 +76,12 @@ static const char *AcpiDmAsfSubnames[] = + "Unknown Subtable Type" /* Reserved */ + }; + ++static const char *AcpiDmCedtSubnames[] = ++{ ++ "CXL Host Bridge Structure", ++ "Unknown Subtable Type" /* Reserved */ ++}; ++ + static const char *AcpiDmDmarSubnames[] = + { + "Hardware Unit Definition", +@@ -376,7 +382,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = + {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert}, + {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt}, + {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot}, +- {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, NULL, TemplateCedt}, ++ {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, DtCompileCedt, TemplateCedt}, + {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep}, + {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt}, + {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2}, +@@ -830,6 +836,7 @@ AcpiDmDumpTable ( + case ACPI_DMT_CHKSUM: + case ACPI_DMT_SPACEID: + case ACPI_DMT_ACCWIDTH: ++ case ACPI_DMT_CEDT: + case ACPI_DMT_IVRS: + case ACPI_DMT_GTDT: + case ACPI_DMT_MADT: +@@ -1240,6 +1247,20 @@ AcpiDmDumpTable ( + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAsfSubnames[Temp16]); + break; + ++ case ACPI_DMT_CEDT: ++ ++ /* CEDT subtable types */ ++ ++ Temp8 = *Target; ++ if (Temp8 > ACPI_CEDT_TYPE_RESERVED) ++ { ++ Temp8 = ACPI_CEDT_TYPE_RESERVED; ++ } ++ ++ AcpiOsPrintf (UINT8_FORMAT, *Target, ++ AcpiDmCedtSubnames[Temp8]); ++ break; ++ + case ACPI_DMT_DMAR: + + /* DMAR subtable types */ +diff --git a/source/common/dmtbinfo1.c b/source/common/dmtbinfo1.c +index cb41915..fb1c19a 100644 +--- a/source/common/dmtbinfo1.c ++++ b/source/common/dmtbinfo1.c +@@ -244,7 +244,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[] = + + ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[] = + { +- {ACPI_DMT_UINT8, ACPI_CEDT_OFFSET (Type), "Subtable Type", 0}, ++ {ACPI_DMT_CEDT, ACPI_CEDT_OFFSET (Type), "Subtable Type", 0}, + {ACPI_DMT_UINT8, ACPI_CEDT_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT16, ACPI_CEDT_OFFSET (Length), "Length", DT_LENGTH}, + ACPI_DMT_TERMINATOR +diff --git a/source/compiler/dtcompiler.h b/source/compiler/dtcompiler.h +index fd20109..9a78519 100644 +--- a/source/compiler/dtcompiler.h ++++ b/source/compiler/dtcompiler.h +@@ -419,6 +419,10 @@ ACPI_STATUS + DtCompileCpep ( + void **PFieldList); + ++ACPI_STATUS ++DtCompileCedt ( ++ void **PFieldList); ++ + ACPI_STATUS + DtCompileCsrt ( + void **PFieldList); +diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c +index 24d33c1..a3240f8 100644 +--- a/source/compiler/dttable1.c ++++ b/source/compiler/dttable1.c +@@ -234,6 +234,80 @@ DtCompileAsf ( + } + + ++/****************************************************************************** ++ * ++ * FUNCTION: DtCompileCedt ++ * ++ * PARAMETERS: List - Current field list pointer ++ * ++ * RETURN: Status ++ * ++ * DESCRIPTION: Compile CEDT. ++ * ++ *****************************************************************************/ ++ ++ACPI_STATUS ++DtCompileCedt ( ++ void **List) ++{ ++ ACPI_STATUS Status; ++ DT_SUBTABLE *Subtable; ++ DT_SUBTABLE *ParentTable; ++ DT_FIELD **PFieldList = (DT_FIELD **) List; ++ ACPI_CEDT_HEADER *CedtHeader; ++ DT_FIELD *SubtableStart; ++ ++ ++ /* Walk the parse tree */ ++ ++ while (*PFieldList) ++ { ++ SubtableStart = *PFieldList; ++ ++ /* CEDT Header */ ++ ++ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedtHdr, ++ &Subtable); ++ if (ACPI_FAILURE (Status)) ++ { ++ return (Status); ++ } ++ ++ ParentTable = DtPeekSubtable (); ++ DtInsertSubtable (ParentTable, Subtable); ++ DtPushSubtable (Subtable); ++ ++ CedtHeader = ACPI_CAST_PTR (ACPI_CEDT_HEADER, Subtable->Buffer); ++ ++ switch (CedtHeader->Type) ++ { ++ case ACPI_CEDT_TYPE_CHBS: ++ ++ break; ++ ++ default: ++ ++ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "CEDT"); ++ return (AE_ERROR); ++ } ++ ++ /* CEDT Subtable */ ++ ++ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt0, &Subtable); ++ if (ACPI_FAILURE (Status)) ++ { ++ return (Status); ++ } ++ ++ ParentTable = DtPeekSubtable (); ++ DtInsertSubtable (ParentTable, Subtable); ++ DtPopSubtable (); ++ } ++ ++ return (AE_OK); ++} ++ ++ + /****************************************************************************** + * + * FUNCTION: DtCompileCpep +diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h +index 275003c..82f352a 100644 +--- a/source/compiler/dttemplate.h ++++ b/source/compiler/dttemplate.h +@@ -98,16 +98,23 @@ const unsigned char TemplateBoot[] = + + const unsigned char TemplateCedt[] = + { +- /* FIXME: This is from QEMU */ +- 0x43,0x45,0x44,0x54,0x44,0x00,0x00,0x00, /* 00000000 "CEDTD..." */ +- 0x01,0x3E,0x42,0x4F,0x43,0x48,0x53,0x20, /* 00000008 ".>BOCHS " */ +- 0x42,0x58,0x50,0x43,0x20,0x20,0x20,0x20, /* 00000010 "BXPC " */ +- 0x01,0x00,0x00,0x00,0x42,0x58,0x50,0x43, /* 00000018 "....BXPC" */ +- 0x01,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000020 "...... ." */ +- 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000028 "........" */ +- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD0, /* 00000030 "........" */ +- 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000038 "........" */ +- 0x00,0x00,0x00,0x00 /* 00000040 "...." */ ++ 0x43,0x45,0x44,0x54,0x84,0x00,0x00,0x00, /* 00000000 "CEDT...." */ ++ 0x01,0x8B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ ++ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ ++ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ ++ 0x05,0x01,0x21,0x20,0x00,0x00,0x20,0x00, /* 00000020 "..! .. ." */ ++ 0x33,0x33,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000028 "33......" */ ++ 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xD5, /* 00000030 ".....!C." */ ++ 0x00,0x00,0x00,0x00,0x45,0x23,0x01,0x00, /* 00000038 "....E#.." */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000040 "...... ." */ ++ 0x44,0x44,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000048 "DD......" */ ++ 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xA5, /* 00000050 ".....!C." */ ++ 0x00,0x00,0x00,0x00,0x45,0x23,0xB1,0x00, /* 00000058 "....E#.." */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000060 "...... ." */ ++ 0x55,0x55,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000068 "UU......" */ ++ 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xB5, /* 00000070 ".....!C." */ ++ 0x00,0x00,0x00,0x00,0x45,0x23,0xB1,0x00, /* 00000078 "....E#.." */ ++ 0x00,0x00,0x00,0x00 /* 00000080 "...." */ + }; + + const unsigned char TemplateCpep[] = +diff --git a/source/compiler/dtutils.c b/source/compiler/dtutils.c +index 658726b..a5ef782 100644 +--- a/source/compiler/dtutils.c ++++ b/source/compiler/dtutils.c +@@ -455,6 +455,7 @@ DtGetFieldLength ( + case ACPI_DMT_CHKSUM: + case ACPI_DMT_SPACEID: + case ACPI_DMT_ACCWIDTH: ++ case ACPI_DMT_CEDT: + case ACPI_DMT_IVRS: + case ACPI_DMT_GTDT: + case ACPI_DMT_MADT: +diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h +index d7f348f..f50adef 100644 +--- a/source/include/acdisasm.h ++++ b/source/include/acdisasm.h +@@ -143,6 +143,7 @@ typedef enum + /* Types that are specific to particular ACPI tables */ + + ACPI_DMT_ASF, ++ ACPI_DMT_CEDT, + ACPI_DMT_DMAR, + ACPI_DMT_DMAR_SCOPE, + ACPI_DMT_EINJACT, +diff --git a/source/include/actbl1.h b/source/include/actbl1.h +index ce4737d..a551303 100644 +--- a/source/include/actbl1.h ++++ b/source/include/actbl1.h +@@ -384,6 +384,7 @@ typedef struct acpi_table_boot + + } ACPI_TABLE_BOOT; + ++ + /******************************************************************************* + * + * CEDT - CXL Early Discovery Table +@@ -414,6 +415,7 @@ typedef struct acpi_cedt_header + enum AcpiCedtType + { + ACPI_CEDT_TYPE_CHBS = 0, ++ ACPI_CEDT_TYPE_RESERVED = 1 + }; + + +diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c +index 8aa35fe..5fc0ab5 100644 +--- a/source/tools/acpisrc/astable.c ++++ b/source/tools/acpisrc/astable.c +@@ -534,6 +534,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { + {"ACPI_TABLE_CSRT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DBG2", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DBGP", SRC_TYPE_STRUCT}, ++ {"ACPI_TABLE_CEDT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DMAR", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DRTM", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_ECDT", SRC_TYPE_STRUCT}, +@@ -592,6 +593,8 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { + {"ACPI_ASF_REMOTE", SRC_TYPE_STRUCT}, + {"ACPI_ASF_RMCP", SRC_TYPE_STRUCT}, + {"ACPI_BERT_REGION", SRC_TYPE_STRUCT}, ++ {"ACPI_CEDT_CHBS", SRC_TYPE_STRUCT}, ++ {"ACPI_CEDT_HEADER", SRC_TYPE_STRUCT}, + {"ACPI_CPEP_POLLING", SRC_TYPE_STRUCT}, + {"ACPI_CSRT_GROUP", SRC_TYPE_STRUCT}, + {"ACPI_CSRT_DESCRIPTOR", SRC_TYPE_STRUCT}, diff --git a/SOURCES/CEDT-support_05.patch b/SOURCES/CEDT-support_05.patch new file mode 100644 index 0000000..41e14c0 --- /dev/null +++ b/SOURCES/CEDT-support_05.patch @@ -0,0 +1,31 @@ +commit 5ace82441a34f8d45725f12f6bd2677e79c186a6 +Author: Alison Schofield +Date: Thu May 20 13:33:02 2021 -0700 + + Add defines for the CXL Host Bridge Structure (CHBS) + + CXL 2.0 defines length and version field values for the CHBS. + Include them in the ACPI CEDT table definition. + + Signed-off-by: Alison Schofield + +diff --git a/source/include/actbl1.h b/source/include/actbl1.h +index a551303..51fee30 100644 +--- a/source/include/actbl1.h ++++ b/source/include/actbl1.h +@@ -418,6 +418,15 @@ enum AcpiCedtType + ACPI_CEDT_TYPE_RESERVED = 1 + }; + ++/* Values for version field above */ ++ ++#define ACPI_CEDT_CHBS_VERSION_CXL11 (0) ++#define ACPI_CEDT_CHBS_VERSION_CXL20 (1) ++ ++/* Values for length field above */ ++ ++#define ACPI_CEDT_CHBS_LENGTH_CXL11 (0x2000) ++#define ACPI_CEDT_CHBS_LENGTH_CXL20 (0x10000) + + /* + * CEDT subtables diff --git a/SOURCES/CEDT-support_06.patch b/SOURCES/CEDT-support_06.patch new file mode 100644 index 0000000..79e2bfd --- /dev/null +++ b/SOURCES/CEDT-support_06.patch @@ -0,0 +1,66 @@ +commit 699fc72e56936bebf3b9ba39b6e91bd957b44452 +Author: Alison Schofield +Date: Thu May 20 13:48:40 2021 -0700 + + Add the CFMWS structure definition to the CEDT table + + The CXL Fixed Memory Window Structure (CFMWS) is added to the + CXL Early Discovery Table (CEDT). This new structure is defined + in an ECN to the CXL 2.0 specification. + + https://www.computeexpresslink.org/spec-landing + + Signed-off-by: Alison Schofield + +diff --git a/source/include/actbl1.h b/source/include/actbl1.h +index 51fee30..f274a85 100644 +--- a/source/include/actbl1.h ++++ b/source/include/actbl1.h +@@ -415,7 +415,8 @@ typedef struct acpi_cedt_header + enum AcpiCedtType + { + ACPI_CEDT_TYPE_CHBS = 0, +- ACPI_CEDT_TYPE_RESERVED = 1 ++ ACPI_CEDT_TYPE_CFMWS = 1, ++ ACPI_CEDT_TYPE_RESERVED = 2, + }; + + /* Values for version field above */ +@@ -446,6 +447,37 @@ typedef struct acpi_cedt_chbs + } ACPI_CEDT_CHBS; + + ++/* 1: CXL Fixed Memory Window Structure */ ++ ++typedef struct acpi_cedt_cfmws ++{ ++ ACPI_CEDT_HEADER Header; ++ UINT32 Reserved1; ++ UINT64 BaseHpa; ++ UINT64 WindowSize; ++ UINT8 InterleaveWays; ++ UINT8 InterleaveArithmetic; ++ UINT16 Reserved2; ++ UINT32 Granularity; ++ UINT16 Restrictions; ++ UINT16 QtgId; ++ UINT32 InterleaveTargets[]; ++ ++} ACPI_CEDT_CFMWS; ++ ++/* Values for Interleave Arithmetic field above */ ++ ++#define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO (0) ++ ++/* Values for Restrictions field above */ ++ ++#define ACPI_CEDT_CFMWS_RESTRICT_TYPE2 (1) ++#define ACPI_CEDT_CFMWS_RESTRICT_TYPE3 (1<<1) ++#define ACPI_CEDT_CFMWS_RESTRICT_VOLATILE (1<<2) ++#define ACPI_CEDT_CFMWS_RESTRICT_PMEM (1<<3) ++#define ACPI_CEDT_CFMWS_RESTRICT_FIXED (1<<4) ++ ++ + /******************************************************************************* + * + * CPEP - Corrected Platform Error Polling table (ACPI 4.0) diff --git a/SOURCES/CEDT-support_07.patch b/SOURCES/CEDT-support_07.patch new file mode 100644 index 0000000..70e482f --- /dev/null +++ b/SOURCES/CEDT-support_07.patch @@ -0,0 +1,20 @@ +commit ec39d05939c799dc1a3635c766805924afdbbe9e +Author: Erik Kaneda +Date: Tue Jun 1 10:37:51 2021 -0700 + + Disassembler: add missing strings to decode subtable types + + Signed-off-by: Erik Kaneda + +diff --git a/source/common/dmtable.c b/source/common/dmtable.c +index 530e872..14aa927 100644 +--- a/source/common/dmtable.c ++++ b/source/common/dmtable.c +@@ -79,6 +79,7 @@ static const char *AcpiDmAsfSubnames[] = + static const char *AcpiDmCedtSubnames[] = + { + "CXL Host Bridge Structure", ++ "CXL Fixed Memory Window Structure", + "Unknown Subtable Type" /* Reserved */ + }; + diff --git a/SOURCES/CEDT-support_08.patch b/SOURCES/CEDT-support_08.patch new file mode 100644 index 0000000..511d9ae --- /dev/null +++ b/SOURCES/CEDT-support_08.patch @@ -0,0 +1,184 @@ +commit 19b11f91660b1a38a8e9655b0b1a4ad51ec4db1e +Author: Lawrence Hileman +Date: Fri Jan 7 16:33:40 2022 -0800 + + Add the subtable CFMWS to the CEDT table + +diff --git a/source/common/dmtbdump1.c b/source/common/dmtbdump1.c +index 19a810f..597bb3b 100644 +--- a/source/common/dmtbdump1.c ++++ b/source/common/dmtbdump1.c +@@ -242,7 +242,6 @@ AcpiDmDumpCedt ( + ACPI_CEDT_HEADER *Subtable; + UINT32 Length = Table->Length; + UINT32 Offset = sizeof (ACPI_TABLE_CEDT); +- ACPI_DMTABLE_INFO *InfoTable; + + + /* There is no main table (other than the standard ACPI header) */ +@@ -263,35 +262,50 @@ AcpiDmDumpCedt ( + switch (Subtable->Type) + { + case ACPI_CEDT_TYPE_CHBS: ++ Status = AcpiDmDumpTable (Length, Offset, Subtable, ++ Subtable->Length, AcpiDmTableInfoCedt0); ++ if (ACPI_FAILURE (Status)) { ++ return; ++ } ++ break; ++ ++ case ACPI_CEDT_TYPE_CFMWS: { ++ ACPI_CEDT_CFMWS *ptr = (ACPI_CEDT_CFMWS *) Subtable; ++ unsigned int i, max = 0x01 << (ptr->InterleaveWays); ++ ++ // print out table with first "Interleave target" ++ Status = AcpiDmDumpTable (Length, Offset, Subtable, ++ Subtable->Length, AcpiDmTableInfoCedt1); ++ if (ACPI_FAILURE (Status)) { ++ return; ++ } + +- InfoTable = AcpiDmTableInfoCedt0; ++ // Now, print out any interleave targets beyond the first. ++ for (i = 1; i < max; i++) { ++ unsigned int loc_offset = Offset + (i * 4) + ACPI_OFFSET(ACPI_CEDT_CFMWS, InterleaveTargets); ++ unsigned int *trg = &(ptr->InterleaveTargets[i]); ++ Status = AcpiDmDumpTable (Length, loc_offset, trg, ++ Subtable->Length, AcpiDmTableInfoCedt1_te); ++ if (ACPI_FAILURE (Status)) { ++ return; ++ } ++ } + break; ++ } + + default: +- + AcpiOsPrintf ("\n**** Unknown CEDT subtable type 0x%X\n\n", + Subtable->Type); + + /* Attempt to continue */ +- + if (!Subtable->Length) + { + AcpiOsPrintf ("Invalid zero length subtable\n"); + return; + } +- goto NextSubtable; +- } +- +- Status = AcpiDmDumpTable (Length, Offset, Subtable, +- Subtable->Length, InfoTable); +- if (ACPI_FAILURE (Status)) +- { +- return; + } + +-NextSubtable: + /* Point to next subtable */ +- + Offset += Subtable->Length; + Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Subtable, + Subtable->Length); +diff --git a/source/common/dmtbinfo1.c b/source/common/dmtbinfo1.c +index fb1c19a..9fbb8fa 100644 +--- a/source/common/dmtbinfo1.c ++++ b/source/common/dmtbinfo1.c +@@ -262,6 +262,28 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[] = + ACPI_DMT_TERMINATOR + }; + ++/* 1: CXL Fixed Memory Window Structure */ ++ ++ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1[] = ++{ ++ {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (Reserved1), "Reserved", 0}, ++ {ACPI_DMT_UINT64, ACPI_CEDT1_OFFSET (BaseHpa), "Window base address", 0}, ++ {ACPI_DMT_UINT64, ACPI_CEDT1_OFFSET (WindowSize), "Window size", 0}, ++ {ACPI_DMT_UINT8, ACPI_CEDT1_OFFSET (InterleaveWays), "Interleave Members (2^n)", 0}, ++ {ACPI_DMT_UINT8, ACPI_CEDT1_OFFSET (InterleaveArithmetic), "Interleave Arithmetic", 0}, ++ {ACPI_DMT_UINT16, ACPI_CEDT1_OFFSET (Reserved2), "Reserved", 0}, ++ {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (Granularity), "Granularity", 0}, ++ {ACPI_DMT_UINT16, ACPI_CEDT1_OFFSET (Restrictions), "Restrictions", 0}, ++ {ACPI_DMT_UINT16, ACPI_CEDT1_OFFSET (QtgId), "QtgId", 0}, ++ {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (InterleaveTargets), "First Target", 0}, ++ ACPI_DMT_TERMINATOR ++}; ++ ++ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1_te[] = ++{ ++ {ACPI_DMT_UINT32, ACPI_CEDT1_TE_OFFSET (InterleaveTarget), "Next Target", 0}, ++ ACPI_DMT_TERMINATOR ++}; + + /******************************************************************************* + * +diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c +index a3240f8..79550ab 100644 +--- a/source/compiler/dttable1.c ++++ b/source/compiler/dttable1.c +@@ -282,18 +282,18 @@ DtCompileCedt ( + switch (CedtHeader->Type) + { + case ACPI_CEDT_TYPE_CHBS: +- ++ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt0, &Subtable); ++ break; ++ case ACPI_CEDT_TYPE_CFMWS: ++ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt1, &Subtable); + break; + + default: +- + DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "CEDT"); + return (AE_ERROR); + } + + /* CEDT Subtable */ +- +- Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt0, &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); +diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h +index f50adef..233cef0 100644 +--- a/source/include/acdisasm.h ++++ b/source/include/acdisasm.h +@@ -259,6 +259,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[]; ++extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1[]; ++extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1_te[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[]; +diff --git a/source/include/actbinfo.h b/source/include/actbinfo.h +index 9735f22..91a3d2e 100644 +--- a/source/include/actbinfo.h ++++ b/source/include/actbinfo.h +@@ -106,6 +106,8 @@ + #define ACPI_ASF4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f) + #define ACPI_CEDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_HEADER, f) + #define ACPI_CEDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CHBS, f) ++#define ACPI_CEDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CFMWS, f) ++#define ACPI_CEDT1_TE_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CFMWS_TARGET_ELEMENT, f) + #define ACPI_CPEP0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f) + #define ACPI_CSRT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_GROUP,f) + #define ACPI_CSRT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_SHARED_INFO,f) +diff --git a/source/include/actbl1.h b/source/include/actbl1.h +index f274a85..3c46b60 100644 +--- a/source/include/actbl1.h ++++ b/source/include/actbl1.h +@@ -465,6 +465,11 @@ typedef struct acpi_cedt_cfmws + + } ACPI_CEDT_CFMWS; + ++typedef struct acpi_cedt_cfmws_target_element ++{ ++ UINT32 InterleaveTarget; ++} ACPI_CEDT_CFMWS_TARGET_ELEMENT; ++ + /* Values for Interleave Arithmetic field above */ + + #define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO (0) diff --git a/SOURCES/CEDT-support_09.patch b/SOURCES/CEDT-support_09.patch new file mode 100644 index 0000000..fe2a73a --- /dev/null +++ b/SOURCES/CEDT-support_09.patch @@ -0,0 +1,173 @@ +commit d9798f5275bb20ab88ac854ba04e6e3bdb22cf6d +Author: Lawrence Hileman +Date: Mon Jan 17 15:24:34 2022 -0800 + + Fix Compile issue with CEDT and add template + +diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c +index 79550ab..6eea2a4 100644 +--- a/source/compiler/dttable1.c ++++ b/source/compiler/dttable1.c +@@ -262,6 +262,7 @@ DtCompileCedt ( + + while (*PFieldList) + { ++ int InsertFlag = 1; // if CFMWS and has more than one target, then set to zero later + SubtableStart = *PFieldList; + + /* CEDT Header */ +@@ -283,24 +284,68 @@ DtCompileCedt ( + { + case ACPI_CEDT_TYPE_CHBS: + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt0, &Subtable); ++ if (ACPI_FAILURE (Status)) ++ { ++ return (Status); ++ } + break; +- case ACPI_CEDT_TYPE_CFMWS: ++ case ACPI_CEDT_TYPE_CFMWS: { ++ unsigned char *dump; ++ unsigned int idx, offset, max = 0; ++ ++ // Compile table with first "Interleave target" + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt1, &Subtable); ++ if (ACPI_FAILURE (Status)) ++ { ++ return (Status); ++ } ++ ++ // Look in buffer for the number of targets ++ offset = (unsigned int) ACPI_OFFSET (ACPI_CEDT_CFMWS, InterleaveWays); ++ dump = (unsigned char *) Subtable->Buffer - 4; // place at beginning of cedt1 ++ max = 0x01 << dump[offset]; // 2^max, so 0=1, 1=2, 2=4, 3=8. 8 is MAX ++ if (max > 8) max=1; // Error in encoding Interleaving Ways. ++ if (max == 1) // if only one target, then break here. ++ break; // break if only one target. ++ ++ // We need to add more interleave targets, so write the current Subtable. ++ ParentTable = DtPeekSubtable (); ++ DtInsertSubtable (ParentTable, Subtable); // Insert AcpiDmTableInfoCedt1 table so we can put in ++ DtPushSubtable (Subtable); // the targets > the first. ++ ++ // Now, find out all interleave targets beyond the first. ++ for (idx = 1; idx < max; idx++) { ++ ParentTable = DtPeekSubtable (); ++ ++ if (*PFieldList) ++ { ++ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt1_te, &Subtable); ++ if (ACPI_FAILURE (Status)) ++ { ++ return (Status); ++ } ++ if (Subtable) ++ { ++ DtInsertSubtable (ParentTable, Subtable); // got a target, so insert table. ++ InsertFlag = 0; ++ } ++ } ++ } ++ ++ DtPopSubtable (); ++ ParentTable = DtPeekSubtable (); + break; ++ } + + default: + DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "CEDT"); + return (AE_ERROR); + } + +- /* CEDT Subtable */ +- if (ACPI_FAILURE (Status)) +- { +- return (Status); +- } +- + ParentTable = DtPeekSubtable (); +- DtInsertSubtable (ParentTable, Subtable); ++ if (InsertFlag == 1) { ++ DtInsertSubtable (ParentTable, Subtable); ++ } + DtPopSubtable (); + } + +diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h +index 82f352a..ceddb93 100644 +--- a/source/compiler/dttemplate.h ++++ b/source/compiler/dttemplate.h +@@ -98,23 +98,58 @@ const unsigned char TemplateBoot[] = + + const unsigned char TemplateCedt[] = + { +- 0x43,0x45,0x44,0x54,0x84,0x00,0x00,0x00, /* 00000000 "CEDT...." */ +- 0x01,0x8B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ +- 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ +- 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ +- 0x05,0x01,0x21,0x20,0x00,0x00,0x20,0x00, /* 00000020 "..! .. ." */ +- 0x33,0x33,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000028 "33......" */ +- 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xD5, /* 00000030 ".....!C." */ +- 0x00,0x00,0x00,0x00,0x45,0x23,0x01,0x00, /* 00000038 "....E#.." */ ++ 0x43,0x45,0x44,0x54,0x9c,0x01,0x00,0x00, /* 00000000 "CEDT...." */ ++ 0x01,0x87,0x49,0x4e,0x54,0x45,0x4c,0x20, /* 00000008 "..INTEL " */ ++ 0x54,0x45,0x4d,0x50,0x4c,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ ++ 0x00,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */ ++ 0x17,0x12,0x21,0x20,0x00,0x00,0x20,0x00, /* 00000020 "..! .. ." */ ++ 0x00,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000028 ".^......" */ ++ 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 00000030 "........" */ ++ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000038 "..... .." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000040 "...... ." */ +- 0x44,0x44,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000048 "DD......" */ +- 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xA5, /* 00000050 ".....!C." */ +- 0x00,0x00,0x00,0x00,0x45,0x23,0xB1,0x00, /* 00000058 "....E#.." */ ++ 0x01,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000048 ".^......" */ ++ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000050 "..... .." */ ++ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000058 "..... .." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000060 "...... ." */ +- 0x55,0x55,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000068 "UU......" */ +- 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xB5, /* 00000070 ".....!C." */ +- 0x00,0x00,0x00,0x00,0x45,0x23,0xB1,0x00, /* 00000078 "....E#.." */ +- 0x00,0x00,0x00,0x00 /* 00000080 "...." */ ++ 0x02,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000068 ".^......" */ ++ 0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00, /* 00000070 ".....0.." */ ++ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000078 "..... .." */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000080 "...... ." */ ++ 0x03,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000088 ".^......" */ ++ 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, /* 00000090 ".....@.." */ ++ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000098 "..... .." */ ++ 0x00,0x00,0x00,0x00,0x01,0x00,0x28,0x00, /* 000000a0 "......(." */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000a8 "........" */ ++ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000b0 "........" */ ++ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000b8 "........" */ ++ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 000000c0 "........" */ ++ 0x00,0x5e,0xba,0x00,0x01,0x00,0x28,0x00, /* 000000c8 ".^....(." */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d0 "........" */ ++ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d8 "........" */ ++ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000e0 "........" */ ++ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 000000e8 "........" */ ++ 0x01,0x5e,0xba,0x00,0x01,0x00,0x28,0x00, /* 000000f0 ".^....(." */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000f8 "........" */ ++ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ ++ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ ++ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 00000110 "........" */ ++ 0x02,0x5e,0xba,0x00,0x01,0x00,0x28,0x00, /* 00000118 ".^....(." */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ ++ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */ ++ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */ ++ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 00000138 "........" */ ++ 0x03,0x5e,0xba,0x00,0x01,0x00,0x2c,0x00, /* 00000140 ".^....,." */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */ ++ 0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */ ++ 0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000158 "........" */ ++ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 00000160 "........" */ ++ 0x00,0x5e,0xba,0x00,0x01,0x5e,0xba,0x00, /* 00000160 ".^...^.." */ ++ 0x01,0x00,0x2c,0x00,0x00,0x00,0x00,0x00, /* 00000170 "..,....." */ ++ 0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00, /* 00000178 "........" */ ++ 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 00000180 "........" */ ++ 0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 00000188 "........" */ ++ 0x0a,0x00,0x01,0x00,0x02,0x5e,0xba,0x00, /* 00000190 ".....^.." */ ++ 0x03,0x5e,0xba,0x00 /* 00000198 ".^.." */ + }; + + const unsigned char TemplateCpep[] = diff --git a/SOURCES/CEDT-support_10.patch b/SOURCES/CEDT-support_10.patch new file mode 100644 index 0000000..4db7970 --- /dev/null +++ b/SOURCES/CEDT-support_10.patch @@ -0,0 +1,127 @@ +commit 0914618b553d6f3366e568409cebf2656891ca69 +Author: Robert Moore +Date: Thu Feb 17 14:24:24 2022 -0800 + + Automated cleanup; No functional changes + Removed some tabs and // comments. + +diff --git a/source/common/dmtbdump1.c b/source/common/dmtbdump1.c +index 597bb3b..76662a4 100644 +--- a/source/common/dmtbdump1.c ++++ b/source/common/dmtbdump1.c +@@ -273,14 +273,16 @@ AcpiDmDumpCedt ( + ACPI_CEDT_CFMWS *ptr = (ACPI_CEDT_CFMWS *) Subtable; + unsigned int i, max = 0x01 << (ptr->InterleaveWays); + +- // print out table with first "Interleave target" ++ /* print out table with first "Interleave target" */ ++ + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, AcpiDmTableInfoCedt1); + if (ACPI_FAILURE (Status)) { + return; + } + +- // Now, print out any interleave targets beyond the first. ++ /* Now, print out any interleave targets beyond the first. */ ++ + for (i = 1; i < max; i++) { + unsigned int loc_offset = Offset + (i * 4) + ACPI_OFFSET(ACPI_CEDT_CFMWS, InterleaveTargets); + unsigned int *trg = &(ptr->InterleaveTargets[i]); +diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c +index 6eea2a4..e2e0379 100644 +--- a/source/compiler/dttable1.c ++++ b/source/compiler/dttable1.c +@@ -262,7 +262,9 @@ DtCompileCedt ( + + while (*PFieldList) + { +- int InsertFlag = 1; // if CFMWS and has more than one target, then set to zero later ++ /* if CFMWS and has more than one target, then set to zero later */ ++ ++ int InsertFlag = 1; + SubtableStart = *PFieldList; + + /* CEDT Header */ +@@ -293,27 +295,30 @@ DtCompileCedt ( + unsigned char *dump; + unsigned int idx, offset, max = 0; + +- // Compile table with first "Interleave target" ++ /* Compile table with first "Interleave target" */ ++ + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt1, &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + +- // Look in buffer for the number of targets ++ /* Look in buffer for the number of targets */ + offset = (unsigned int) ACPI_OFFSET (ACPI_CEDT_CFMWS, InterleaveWays); +- dump = (unsigned char *) Subtable->Buffer - 4; // place at beginning of cedt1 +- max = 0x01 << dump[offset]; // 2^max, so 0=1, 1=2, 2=4, 3=8. 8 is MAX +- if (max > 8) max=1; // Error in encoding Interleaving Ways. +- if (max == 1) // if only one target, then break here. +- break; // break if only one target. ++ dump = (unsigned char *) Subtable->Buffer - 4; /* place at beginning of cedt1 */ ++ max = 0x01 << dump[offset]; /* 2^max, so 0=1, 1=2, 2=4, 3=8. 8 is MAX */ ++ if (max > 8) max=1; /* Error in encoding Interleaving Ways. */ ++ if (max == 1) /* if only one target, then break here. */ ++ break; /* break if only one target. */ ++ ++ /* We need to add more interleave targets, so write the current Subtable. */ + +- // We need to add more interleave targets, so write the current Subtable. + ParentTable = DtPeekSubtable (); +- DtInsertSubtable (ParentTable, Subtable); // Insert AcpiDmTableInfoCedt1 table so we can put in +- DtPushSubtable (Subtable); // the targets > the first. ++ DtInsertSubtable (ParentTable, Subtable); /* Insert AcpiDmTableInfoCedt1 table so we can put in */ ++ DtPushSubtable (Subtable); /* the targets > the first. */ ++ ++ /* Now, find out all interleave targets beyond the first. */ + +- // Now, find out all interleave targets beyond the first. + for (idx = 1; idx < max; idx++) { + ParentTable = DtPeekSubtable (); + +@@ -326,7 +331,7 @@ DtCompileCedt ( + } + if (Subtable) + { +- DtInsertSubtable (ParentTable, Subtable); // got a target, so insert table. ++ DtInsertSubtable (ParentTable, Subtable); /* got a target, so insert table. */ + InsertFlag = 0; + } + } +diff --git a/source/include/actbl1.h b/source/include/actbl1.h +index 3c46b60..b291aa2 100644 +--- a/source/include/actbl1.h ++++ b/source/include/actbl1.h +@@ -468,19 +468,20 @@ typedef struct acpi_cedt_cfmws + typedef struct acpi_cedt_cfmws_target_element + { + UINT32 InterleaveTarget; ++ + } ACPI_CEDT_CFMWS_TARGET_ELEMENT; + + /* Values for Interleave Arithmetic field above */ + +-#define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO (0) ++#define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO (0) + + /* Values for Restrictions field above */ + +-#define ACPI_CEDT_CFMWS_RESTRICT_TYPE2 (1) +-#define ACPI_CEDT_CFMWS_RESTRICT_TYPE3 (1<<1) +-#define ACPI_CEDT_CFMWS_RESTRICT_VOLATILE (1<<2) +-#define ACPI_CEDT_CFMWS_RESTRICT_PMEM (1<<3) +-#define ACPI_CEDT_CFMWS_RESTRICT_FIXED (1<<4) ++#define ACPI_CEDT_CFMWS_RESTRICT_TYPE2 (1) ++#define ACPI_CEDT_CFMWS_RESTRICT_TYPE3 (1<<1) ++#define ACPI_CEDT_CFMWS_RESTRICT_VOLATILE (1<<2) ++#define ACPI_CEDT_CFMWS_RESTRICT_PMEM (1<<3) ++#define ACPI_CEDT_CFMWS_RESTRICT_FIXED (1<<4) + + + /******************************************************************************* diff --git a/SOURCES/CEDT-support_11.patch b/SOURCES/CEDT-support_11.patch new file mode 100644 index 0000000..0198da8 --- /dev/null +++ b/SOURCES/CEDT-support_11.patch @@ -0,0 +1,18 @@ +commit 7021087eedb0d7156286e9e4f255e93c07816921 +Author: Robert Moore +Date: Fri Aug 26 12:20:07 2022 -0700 + + Remove a duplicate of ACPI_SIG_CEDT + +diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c +index 5fc0ab5..2946e0d 100644 +--- a/source/tools/acpisrc/astable.c ++++ b/source/tools/acpisrc/astable.c +@@ -534,7 +534,6 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { + {"ACPI_TABLE_CSRT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DBG2", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DBGP", SRC_TYPE_STRUCT}, +- {"ACPI_TABLE_CEDT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DMAR", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DRTM", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_ECDT", SRC_TYPE_STRUCT}, diff --git a/SOURCES/COPYING b/SOURCES/COPYING new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/SOURCES/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/SOURCES/OPT_LDFLAGS.patch b/SOURCES/OPT_LDFLAGS.patch new file mode 100644 index 0000000..a1ca276 --- /dev/null +++ b/SOURCES/OPT_LDFLAGS.patch @@ -0,0 +1,26 @@ +Index: acpica-unix2-20170728/generate/unix/Makefile.config +=================================================================== +--- acpica-unix2-20170728.orig/generate/unix/Makefile.config ++++ acpica-unix2-20170728/generate/unix/Makefile.config +@@ -23,6 +23,9 @@ + # OPT_CFLAGS can be overridden on the make command line by + # adding OPT_CFLAGS="..." to the invocation. + # ++# OPT_LDFLAGS can be overridden on the make command line by ++# adding OPT_LDFLAGS="..." to the invocation. ++# + # Notes: + # gcc should be version 4 or greater, otherwise some of the options + # used will not be recognized. +@@ -157,6 +160,11 @@ LDFLAGS +=-m32 + endif + + # ++# Common linker flags ++# ++OPT_LDFLAGS ?= ++ ++# + # Optionally disable optimizations. Optimization causes problems on + # some compilers such as gcc 4.4 + # diff --git a/SOURCES/README.Fedora b/SOURCES/README.Fedora new file mode 100644 index 0000000..c1c7f25 --- /dev/null +++ b/SOURCES/README.Fedora @@ -0,0 +1,26 @@ +Packaging Notes for Fedora +========================== +The upstream source contains documentation that may or may not be licensed +in a freely redistributable manner. In an excess of caution, the manuals in +question have been removed from the source we start with. You can still get +your own copies of the documentation from here: + + https://www.acpica.org/documentation/ + +The two manuals affected are: + + (1) ACPICA Reference Manual, describing the ACPI Component Architecture + in some detail, and + + (2) ASL Compiler Reference Manual, describing how to use iasl + +While there are man pages for the commands, they are very brief. The +documents above are recommended reading. + + +Test Cases +========== +The aapits tests do not currently build properly. They will be added to +this package once they do. In the meantime, ASL, template and misc tests +will be run as part of %check. + diff --git a/SOURCES/acpibin.1 b/SOURCES/acpibin.1 new file mode 100644 index 0000000..b8448a5 --- /dev/null +++ b/SOURCES/acpibin.1 @@ -0,0 +1,64 @@ +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH ACPIBIN 1 "January 23, 2013" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +acpibin \- ACPI binary AML file utility +.SH SYNOPSIS +.B acpibin +.RI [