From owner-svn-src-head@freebsd.org Sat Sep 30 20:28:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05490E2E9F9; Sat, 30 Sep 2017 20:28:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FF067F6FD; Sat, 30 Sep 2017 20:28:51 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8UKSoJt033261; Sat, 30 Sep 2017 20:28:50 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8UKSoxO033255; Sat, 30 Sep 2017 20:28:50 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201709302028.v8UKSoxO033255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Sat, 30 Sep 2017 20:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324136 - in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/dispatcher sys/contrib/dev/acpica/components/ha... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/dispatcher sys/contrib/dev/acpica/components/hardware sys/contrib/dev/ac... X-SVN-Commit-Revision: 324136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Sep 2017 20:28:52 -0000 Author: jkim Date: Sat Sep 30 20:28:50 2017 New Revision: 324136 URL: https://svnweb.freebsd.org/changeset/base/324136 Log: Revert r324109. This commit broke a number of systems. Reported by: lwhsu, kib Requested by: ngie Deleted: head/sys/contrib/dev/acpica/compiler/aslallocate.c head/sys/contrib/dev/acpica/compiler/aslcache.c Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/ahtable.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/asldebug.c head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslhelp.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/aslmapenter.c head/sys/contrib/dev/acpica/compiler/aslmaputils.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslmethod.c head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/compiler/aslparseop.c head/sys/contrib/dev/acpica/compiler/aslprintf.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslsupport.l head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/cvcompiler.c head/sys/contrib/dev/acpica/compiler/cvparser.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dtexpress.c head/sys/contrib/dev/acpica/compiler/dtfield.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/dtparser.y head/sys/contrib/dev/acpica/compiler/dtsubtable.c head/sys/contrib/dev/acpica/compiler/dttable.c head/sys/contrib/dev/acpica/compiler/dttable1.c head/sys/contrib/dev/acpica/compiler/dttable2.c head/sys/contrib/dev/acpica/compiler/dttemplate.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/compiler/dtutils.c head/sys/contrib/dev/acpica/compiler/prexpress.c head/sys/contrib/dev/acpica/compiler/prmacros.c head/sys/contrib/dev/acpica/compiler/prparser.y head/sys/contrib/dev/acpica/compiler/prscan.c head/sys/contrib/dev/acpica/compiler/prutils.c head/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c head/sys/contrib/dev/acpica/components/hardware/hwtimer.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/namespace/nssearch.c head/sys/contrib/dev/acpica/components/parser/psobject.c head/sys/contrib/dev/acpica/components/parser/psutils.c head/sys/contrib/dev/acpica/components/utilities/utinit.c head/sys/contrib/dev/acpica/components/utilities/utmath.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/dev/acpica/acpi_cpu.c head/usr.sbin/acpi/iasl/Makefile Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Sat Sep 30 20:07:57 2017 (r324135) +++ head/sys/contrib/dev/acpica/changes.txt Sat Sep 30 20:28:50 2017 (r324136) @@ -1,104 +1,4 @@ ---------------------------------------- -29 September 2017. Summary of changes for version 20170929: - - -1) ACPICA kernel-resident subsystem: - -Redesigned and implemented an improved ASL While() loop timeout -mechanism. This mechanism is used to prevent infinite loops in the kernel -AML interpreter caused by either non-responsive hardware or incorrect AML -code. The new implementation uses AcpiOsGetTimer instead of a simple -maximum loop count, and is thus more accurate and constant across -different machines. The default timeout is currently 30 seconds, but this -may be adjusted later. - -Renamed the ACPI_AML_INFINITE_LOOP exception to AE_AML_LOOP_TIMEOUT to -better reflect the new implementation of the loop timeout mechanism. - -Updated the AcpiGetTimerDuration interface to cleanup the 64-bit support -and to fix an off-by-one error. Jung-uk Kim. - -Fixed an EFI build problem by updating the makefiles to for a new file -that was added, utstrsuppt.c - - -2) iASL Compiler/Disassembler and Tools: - -Implemented full support for the PDTT, SDEV, and TPM2 ACPI tables. This -includes support in the table disassembler, compiler, and template -generator. - -iASL: Added an exception for an illegal type of recursive method -invocation. If a method creates named objects, the first recursive call -will fail at runtime. This change adds an error detection at compile time -to catch the problem up front. Note: Marking such a method as -"serialized" will not help with this problem, because the same thread can -acquire the method mutex more than once. Example compiler and runtime -output: - - Method (MTH1) - { - Name (INT1, 1) - MTH1 () - } - - dsdt.asl 22: MTH1 () - Error 6152 - ^ Illegal recursive call to method - that creates named objects (MTH1) - -Previous runtime exception: - ACPI Error: [INT1] Namespace lookup failure, - AE_ALREADY_EXISTS (20170831/dswload2-465) - -iASL: Updated support for External() opcodes to improve namespace -management and error detection. These changes are related to issues seen -with multiple-segment namespace pathnames within External declarations, -such as below: - - External(\_SB.PCI0.GFX0, DeviceObj) - External(\_SB.PCI0.GFX0.ALSI) - -iASL: Implemented support for multi-line error/warning messages. This -enables more detailed and helpful error messages as below, from the -initial deployment for the duplicate names error: - - DSDT.iiii 1692: Device(PEG2) { - Error 6074 - ^ Name already exists in scope -(PEG2) - - Original name creation/declaration below: - DSDT.iiii 93: External(\_SB.PCI0.PEG2, DeviceObj) - -AcpiXtract: Added additional flexibility to support differing input hex -dump formats. Specifically, hex dumps that contain partial disassembly -and/or comments within the ACPI table data definition. There exist some -dump utilities seen in the field that create this type of hex dump (such -as Simics). For example: - - DSDT @ 0xdfffd0c0 (10999 bytes) - Signature DSDT - Length 10999 - Revision 1 - Checksum 0xf3 (Ok) - OEM_ID BXPC - OEM_table_id BXDSDT - OEM_revision 1 - Creator_id 1280593481 - Creator_revision 537399345 - 0000: 44 53 44 54 f7 2a 00 00 01 f3 42 58 50 43 00 00 - ... - 2af0: 5f 4c 30 46 00 a4 01 - -Test suite: Miscellaneous changes/fixes: - More cleanup and simplification of makefiles - Continue compilation of test cases after a compile failure - Do not perform binary compare unless both files actually exist - -iASL: Performed some code/module restructuring. Moved all memory -allocation functions to new modules. Two new files, aslallocate.c and -aslcache.c - ----------------------------------------- 31 August 2017. Summary of changes for version 20170831: Modified: head/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adfile.c Sat Sep 30 20:07:57 2017 (r324135) +++ head/sys/contrib/dev/acpica/common/adfile.c Sat Sep 30 20:28:50 2017 (r324136) @@ -314,7 +314,7 @@ FlGenerateFilename ( * Copy the original filename to a new buffer. Leave room for the worst * case where we append the suffix, an added dot and the null terminator. */ - NewFilename = UtLocalCacheCalloc ((ACPI_SIZE) + NewFilename = UtStringCacheCalloc ((ACPI_SIZE) strlen (InputFilename) + strlen (Suffix) + 2); strcpy (NewFilename, InputFilename); @@ -358,7 +358,7 @@ FlStrdup ( char *NewString; - NewString = UtLocalCacheCalloc ((ACPI_SIZE) strlen (String) + 1); + NewString = UtStringCacheCalloc ((ACPI_SIZE) strlen (String) + 1); strcpy (NewString, String); return (NewString); } Modified: head/sys/contrib/dev/acpica/common/ahtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahtable.c Sat Sep 30 20:07:57 2017 (r324135) +++ head/sys/contrib/dev/acpica/common/ahtable.c Sat Sep 30 20:28:50 2017 (r324136) @@ -232,7 +232,6 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_MTMR, "MID Timer Table"}, {ACPI_SIG_NFIT, "NVDIMM Firmware Interface Table"}, {ACPI_SIG_PCCT, "Platform Communications Channel Table"}, - {ACPI_SIG_PDTT, "Platform Debug Trigger Table"}, {ACPI_SIG_PMTT, "Platform Memory Topology Table"}, {ACPI_SIG_PPTT, "Processor Properties Topology Table"}, {ACPI_SIG_RASF, "RAS Features Table"}, @@ -241,7 +240,6 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_S3PT, "S3 Performance Table"}, {ACPI_SIG_SBST, "Smart Battery Specification Table"}, {ACPI_SIG_SDEI, "Software Delegated Exception Interface Table"}, - {ACPI_SIG_SDEV, "Secure Devices table"}, {ACPI_SIG_SLIC, "Software Licensing Description Table"}, {ACPI_SIG_SLIT, "System Locality Information Table"}, {ACPI_SIG_SPCR, "Serial Port Console Redirection table"}, Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Sat Sep 30 20:07:57 2017 (r324135) +++ head/sys/contrib/dev/acpica/common/dmtable.c Sat Sep 30 20:28:50 2017 (r324136) @@ -154,6 +154,7 @@ #include #include #include +#include /* This module used for application-level code only */ @@ -289,9 +290,9 @@ static const char *AcpiDmHestSubnames[] = "IA-32 Machine Check Exception", "IA-32 Corrected Machine Check", "IA-32 Non-Maskable Interrupt", - "Unknown Subtable Type", /* 3 - Reserved */ - "Unknown Subtable Type", /* 4 - Reserved */ - "Unknown Subtable Type", /* 5 - Reserved */ + "Unknown SubTable Type", /* 3 - Reserved */ + "Unknown SubTable Type", /* 4 - Reserved */ + "Unknown SubTable Type", /* 5 - Reserved */ "PCI Express Root Port AER", "PCI Express AER (AER Endpoint)", "PCI Express/PCI-X Bridge AER", @@ -373,7 +374,7 @@ static const char *AcpiDmPmttSubnames[] = { "Socket", /* ACPI_PMTT_TYPE_SOCKET */ "Memory Controller", /* ACPI_PMTT_TYPE_CONTROLLER */ - "Physical Component (DIMM)", /* ACPI_PMTT_TYPE_DIMM */ + "Physical Component (DIMM)", /* ACPI_PMTT_TYPE_DIMM */ "Unknown Subtable Type" /* Reserved */ }; @@ -381,17 +382,10 @@ static const char *AcpiDmPpttSubnames[] = { "Processor Hierarchy Node", /* ACPI_PPTT_TYPE_PROCESSOR */ "Cache Type", /* ACPI_PPTT_TYPE_CACHE */ - "ID", /* ACPI_PPTT_TYPE_ID */ + "ID", /* ACPI_PMTT_TYPE_ID */ "Unknown Subtable Type" /* Reserved */ }; -static const char *AcpiDmSdevSubnames[] = -{ - "Namespace Device", /* ACPI_SDEV_TYPE_NAMESPACE_DEVICE */ - "PCIe Endpoint Device", /* ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE */ - "Unknown Subtable Type" /* Reserved */ -}; - static const char *AcpiDmSratSubnames[] = { "Processor Local APIC/SAPIC Affinity", @@ -402,23 +396,6 @@ static const char *AcpiDmSratSubnames[] = "Unknown Subtable Type" /* Reserved */ }; -static const char *AcpiDmTpm2Subnames[] = -{ - "Illegal Start Method value", - "Reserved", - "ACPI Start Method", - "Reserved", - "Reserved", - "Reserved", - "Memory Mapped I/O", - "Command Response Buffer", - "Command Response Buffer with ACPI Start Method", - "Reserved", - "Reserved", - "Command Response Buffer with ARM SMC", - "Unknown Subtable Type" /* Reserved */ -}; - static const char *AcpiDmIvrsSubnames[] = { "Hardware Definition Block", @@ -510,7 +487,6 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_MTMR, NULL, AcpiDmDumpMtmr, DtCompileMtmr, TemplateMtmr}, {ACPI_SIG_NFIT, AcpiDmTableInfoNfit, AcpiDmDumpNfit, DtCompileNfit, TemplateNfit}, {ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct}, - {ACPI_SIG_PDTT, AcpiDmTableInfoPdtt, AcpiDmDumpPdtt, DtCompilePdtt, TemplatePdtt}, {ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt}, {ACPI_SIG_PPTT, NULL, AcpiDmDumpPptt, DtCompilePptt, TemplatePptt}, {ACPI_SIG_RASF, AcpiDmTableInfoRasf, NULL, NULL, TemplateRasf}, @@ -518,7 +494,6 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt}, {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst}, {ACPI_SIG_SDEI, AcpiDmTableInfoSdei, NULL, NULL, TemplateSdei}, - {ACPI_SIG_SDEV, AcpiDmTableInfoSdev, AcpiDmDumpSdev, DtCompileSdev, TemplateSdev}, {ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic}, {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit}, {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr}, @@ -526,7 +501,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat}, {ACPI_SIG_STAO, NULL, AcpiDmDumpStao, DtCompileStao, TemplateStao}, {ACPI_SIG_TCPA, NULL, AcpiDmDumpTcpa, DtCompileTcpa, TemplateTcpa}, - {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, AcpiDmDumpTpm2, DtCompileTpm2, TemplateTpm2}, + {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, NULL, NULL, TemplateTpm2}, {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi}, {ACPI_SIG_VRTC, AcpiDmTableInfoVrtc, AcpiDmDumpVrtc, DtCompileVrtc, TemplateVrtc}, {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet}, @@ -942,7 +917,6 @@ AcpiDmDumpTable ( case ACPI_DMT_PCCT: case ACPI_DMT_PMTT: case ACPI_DMT_PPTT: - case ACPI_DMT_SDEV: case ACPI_DMT_SRAT: case ACPI_DMT_ASF: case ACPI_DMT_HESTNTYP: @@ -974,7 +948,6 @@ AcpiDmDumpTable ( case ACPI_DMT_NAME4: case ACPI_DMT_SIG: case ACPI_DMT_LPIT: - case ACPI_DMT_TPM2: ByteLength = 4; break; @@ -1610,20 +1583,6 @@ AcpiDmDumpTable ( CurrentOffset, NULL); break; - case ACPI_DMT_SDEV: - - /* SDEV subtable types */ - - Temp8 = *Target; - if (Temp8 > ACPI_SDEV_TYPE_RESERVED) - { - Temp8 = ACPI_SDEV_TYPE_RESERVED; - } - - AcpiOsPrintf (UINT8_FORMAT, *Target, - AcpiDmSdevSubnames[Temp8]); - break; - case ACPI_DMT_SRAT: /* SRAT subtable types */ @@ -1637,22 +1596,6 @@ AcpiDmDumpTable ( AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmSratSubnames[Temp8]); break; - - case ACPI_DMT_TPM2: - - /* TPM2 Start Method types */ - - Temp8 = *Target; - if (Temp8 > ACPI_TPM2_RESERVED) - { - Temp8 = ACPI_TPM2_RESERVED; - } - - AcpiOsPrintf (UINT8_FORMAT, *Target, - AcpiDmTpm2Subnames[Temp8]); - break; - - case ACPI_DMT_FADTPM: Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump.c Sat Sep 30 20:07:57 2017 (r324135) +++ head/sys/contrib/dev/acpica/common/dmtbdump.c Sat Sep 30 20:28:50 2017 (r324136) @@ -623,7 +623,7 @@ AcpiDmDumpAsf ( { ACPI_STATUS Status; UINT32 Offset = sizeof (ACPI_TABLE_HEADER); - ACPI_ASF_INFO *Subtable; + ACPI_ASF_INFO *SubTable; ACPI_DMTABLE_INFO *InfoTable; ACPI_DMTABLE_INFO *DataInfoTable = NULL; UINT8 *DataTable = NULL; @@ -636,13 +636,13 @@ AcpiDmDumpAsf ( /* No main table, only subtables */ - Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset); + SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ - Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, - Subtable->Header.Length, AcpiDmTableInfoAsfHdr); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + SubTable->Header.Length, AcpiDmTableInfoAsfHdr); if (ACPI_FAILURE (Status)) { return; @@ -650,7 +650,7 @@ AcpiDmDumpAsf ( /* The actual type is the lower 7 bits of Type */ - Type = (UINT8) (Subtable->Header.Type & 0x7F); + Type = (UINT8) (SubTable->Header.Type & 0x7F); switch (Type) { @@ -663,9 +663,9 @@ AcpiDmDumpAsf ( InfoTable = AcpiDmTableInfoAsf1; DataInfoTable = AcpiDmTableInfoAsf1a; - DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ALERT)); - DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->Alerts; - DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->DataLength; + DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ALERT)); + DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->Alerts; + DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->DataLength; DataOffset = Offset + sizeof (ACPI_ASF_ALERT); break; @@ -673,9 +673,9 @@ AcpiDmDumpAsf ( InfoTable = AcpiDmTableInfoAsf2; DataInfoTable = AcpiDmTableInfoAsf2a; - DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_REMOTE)); - DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->Controls; - DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->DataLength; + DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_REMOTE)); + DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->Controls; + DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->DataLength; DataOffset = Offset + sizeof (ACPI_ASF_REMOTE); break; @@ -687,20 +687,20 @@ AcpiDmDumpAsf ( case ACPI_ASF_TYPE_ADDRESS: InfoTable = AcpiDmTableInfoAsf4; - DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ADDRESS)); - DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, Subtable)->Devices; + DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ADDRESS)); + DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, SubTable)->Devices; DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS); break; default: AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n", - Subtable->Header.Type); + SubTable->Header.Type); return; } - Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, - Subtable->Header.Length, InfoTable); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + SubTable->Header.Length, InfoTable); if (ACPI_FAILURE (Status)) { return; @@ -762,15 +762,15 @@ AcpiDmDumpAsf ( /* Point to next subtable */ - if (!Subtable->Header.Length) + if (!SubTable->Header.Length) { AcpiOsPrintf ("Invalid zero subtable header length\n"); return; } - Offset += Subtable->Header.Length; - Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Subtable, - Subtable->Header.Length); + Offset += SubTable->Header.Length; + SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, SubTable, + SubTable->Header.Length); } } @@ -793,7 +793,7 @@ AcpiDmDumpCpep ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_CPEP_POLLING *Subtable; + ACPI_CPEP_POLLING *SubTable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_CPEP); @@ -808,12 +808,12 @@ AcpiDmDumpCpep ( /* Subtables */ - Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset); + SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Header.Length, AcpiDmTableInfoCpep0); + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Header.Length, AcpiDmTableInfoCpep0); if (ACPI_FAILURE (Status)) { return; @@ -821,9 +821,9 @@ AcpiDmDumpCpep ( /* Point to next subtable */ - Offset += Subtable->Header.Length; - Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Subtable, - Subtable->Header.Length); + Offset += SubTable->Header.Length; + SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable, + SubTable->Header.Length); } } @@ -846,9 +846,9 @@ AcpiDmDumpCsrt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_CSRT_GROUP *Subtable; + ACPI_CSRT_GROUP *SubTable; ACPI_CSRT_SHARED_INFO *SharedInfoTable; - ACPI_CSRT_DESCRIPTOR *SubSubtable; + ACPI_CSRT_DESCRIPTOR *SubSubTable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_CSRT); UINT32 SubOffset; @@ -860,14 +860,14 @@ AcpiDmDumpCsrt ( /* Subtables (Resource Groups) */ - Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset); + SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset); while (Offset < Table->Length) { /* Resource group subtable */ AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoCsrt0); + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Length, AcpiDmTableInfoCsrt0); if (ACPI_FAILURE (Status)) { return; @@ -887,19 +887,19 @@ AcpiDmDumpCsrt ( return; } - SubOffset += Subtable->SharedInfoLength; + SubOffset += SubTable->SharedInfoLength; /* Sub-Subtables (Resource Descriptors) */ - SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table, + SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table, Offset + SubOffset); - while ((SubOffset < Subtable->Length) && + while ((SubOffset < SubTable->Length) && ((Offset + SubOffset) < Table->Length)) { AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubtable, - SubSubtable->Length, AcpiDmTableInfoCsrt2); + Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubTable, + SubSubTable->Length, AcpiDmTableInfoCsrt2); if (ACPI_FAILURE (Status)) { return; @@ -909,7 +909,7 @@ AcpiDmDumpCsrt ( /* Resource-specific info buffer */ - InfoLength = SubSubtable->Length - SubSubOffset; + InfoLength = SubSubTable->Length - SubSubOffset; if (InfoLength) { Status = AcpiDmDumpTable (Length, @@ -924,16 +924,16 @@ AcpiDmDumpCsrt ( /* Point to next sub-subtable */ - SubOffset += SubSubtable->Length; - SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubtable, - SubSubtable->Length); + SubOffset += SubSubTable->Length; + SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubTable, + SubSubTable->Length); } /* Point to next subtable */ - Offset += Subtable->Length; - Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Subtable, - Subtable->Length); + Offset += SubTable->Length; + SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable, + SubTable->Length); } } @@ -956,7 +956,7 @@ AcpiDmDumpDbg2 ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_DBG2_DEVICE *Subtable; + ACPI_DBG2_DEVICE *SubTable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_DBG2); UINT32 i; @@ -975,12 +975,12 @@ AcpiDmDumpDbg2 ( /* Subtables */ - Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset); + SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoDbg2Device); + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Length, AcpiDmTableInfoDbg2Device); if (ACPI_FAILURE (Status)) { return; @@ -988,15 +988,15 @@ AcpiDmDumpDbg2 ( /* Dump the BaseAddress array */ - for (i = 0; i < Subtable->RegisterCount; i++) + for (i = 0; i < SubTable->RegisterCount; i++) { - ArrayOffset = Subtable->BaseAddressOffset + + ArrayOffset = SubTable->BaseAddressOffset + (sizeof (ACPI_GENERIC_ADDRESS) * i); AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) Subtable + ArrayOffset; + Array = (UINT8 *) SubTable + ArrayOffset; Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - Subtable->Length, AcpiDmTableInfoDbg2Addr); + SubTable->Length, AcpiDmTableInfoDbg2Addr); if (ACPI_FAILURE (Status)) { return; @@ -1005,15 +1005,15 @@ AcpiDmDumpDbg2 ( /* Dump the AddressSize array */ - for (i = 0; i < Subtable->RegisterCount; i++) + for (i = 0; i < SubTable->RegisterCount; i++) { - ArrayOffset = Subtable->AddressSizeOffset + + ArrayOffset = SubTable->AddressSizeOffset + (sizeof (UINT32) * i); AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) Subtable + ArrayOffset; + Array = (UINT8 *) SubTable + ArrayOffset; Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - Subtable->Length, AcpiDmTableInfoDbg2Size); + SubTable->Length, AcpiDmTableInfoDbg2Size); if (ACPI_FAILURE (Status)) { return; @@ -1023,12 +1023,12 @@ AcpiDmDumpDbg2 ( /* Dump the Namestring (required) */ AcpiOsPrintf ("\n"); - ArrayOffset = Subtable->NamepathOffset; + ArrayOffset = SubTable->NamepathOffset; AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) Subtable + ArrayOffset; + Array = (UINT8 *) SubTable + ArrayOffset; Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - Subtable->Length, AcpiDmTableInfoDbg2Name); + SubTable->Length, AcpiDmTableInfoDbg2Name); if (ACPI_FAILURE (Status)) { return; @@ -1036,10 +1036,10 @@ AcpiDmDumpDbg2 ( /* Dump the OemData (optional) */ - if (Subtable->OemDataOffset) + if (SubTable->OemDataOffset) { - Status = AcpiDmDumpTable (Length, Offset + Subtable->OemDataOffset, - Table, Subtable->OemDataLength, + Status = AcpiDmDumpTable (Length, Offset + SubTable->OemDataOffset, + Table, SubTable->OemDataLength, AcpiDmTableInfoDbg2OemData); if (ACPI_FAILURE (Status)) { @@ -1049,9 +1049,9 @@ AcpiDmDumpDbg2 ( /* Point to next subtable */ - Offset += Subtable->Length; - Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Subtable, - Subtable->Length); + Offset += SubTable->Length; + SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, SubTable, + SubTable->Length); } } @@ -1074,7 +1074,7 @@ AcpiDmDumpDmar ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_DMAR_HEADER *Subtable; + ACPI_DMAR_HEADER *SubTable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_DMAR); ACPI_DMTABLE_INFO *InfoTable; @@ -1094,14 +1094,14 @@ AcpiDmDumpDmar ( /* Subtables */ - Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset); + SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoDmarHdr); + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Length, AcpiDmTableInfoDmarHdr); if (ACPI_FAILURE (Status)) { return; @@ -1109,7 +1109,7 @@ AcpiDmDumpDmar ( AcpiOsPrintf ("\n"); - switch (Subtable->Type) + switch (SubTable->Type) { case ACPI_DMAR_TYPE_HARDWARE_UNIT: @@ -1144,12 +1144,12 @@ AcpiDmDumpDmar ( default: AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", - Subtable->Type); + SubTable->Type); return; } - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, InfoTable); + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; @@ -1158,16 +1158,16 @@ AcpiDmDumpDmar ( /* * Dump the optional device scope entries */ - if ((Subtable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) || - (Subtable->Type == ACPI_DMAR_TYPE_NAMESPACE)) + if ((SubTable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) || + (SubTable->Type == ACPI_DMAR_TYPE_NAMESPACE)) { /* These types do not support device scopes */ goto NextSubtable; } - ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable, ScopeOffset); - while (ScopeOffset < Subtable->Length) + ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset); + while (ScopeOffset < SubTable->Length) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable, @@ -1208,9 +1208,9 @@ AcpiDmDumpDmar ( NextSubtable: /* Point to next subtable */ - Offset += Subtable->Length; - Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Subtable, - Subtable->Length); + Offset += SubTable->Length; + SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable, + SubTable->Length); } } @@ -1343,7 +1343,7 @@ AcpiDmDumpEinj ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_WHEA_HEADER *Subtable; + ACPI_WHEA_HEADER *SubTable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_EINJ); @@ -1358,11 +1358,11 @@ AcpiDmDumpEinj ( /* Subtables */ - Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); + SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, + Status = AcpiDmDumpTable (Length, Offset, SubTable, sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0); if (ACPI_FAILURE (Status)) { @@ -1372,7 +1372,7 @@ AcpiDmDumpEinj ( /* Point to next subtable (each subtable is of fixed length) */ Offset += sizeof (ACPI_WHEA_HEADER); - Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable, + SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable, sizeof (ACPI_WHEA_HEADER)); } } @@ -1396,7 +1396,7 @@ AcpiDmDumpErst ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_WHEA_HEADER *Subtable; + ACPI_WHEA_HEADER *SubTable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_ERST); @@ -1411,11 +1411,11 @@ AcpiDmDumpErst ( /* Subtables */ - Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); + SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, + Status = AcpiDmDumpTable (Length, Offset, SubTable, sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0); if (ACPI_FAILURE (Status)) { @@ -1425,7 +1425,7 @@ AcpiDmDumpErst ( /* Point to next subtable (each subtable is of fixed length) */ Offset += sizeof (ACPI_WHEA_HEADER); - Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable, + SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable, sizeof (ACPI_WHEA_HEADER)); } } @@ -1449,7 +1449,7 @@ AcpiDmDumpFpdt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_FPDT_HEADER *Subtable; + ACPI_FPDT_HEADER *SubTable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_FPDT); ACPI_DMTABLE_INFO *InfoTable; @@ -1459,20 +1459,20 @@ AcpiDmDumpFpdt ( /* Subtables */ - Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset); + SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoFpdtHdr); + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Length, AcpiDmTableInfoFpdtHdr); if (ACPI_FAILURE (Status)) { return; } - switch (Subtable->Type) + switch (SubTable->Type) { case ACPI_FPDT_TYPE_BOOT: @@ -1487,31 +1487,31 @@ AcpiDmDumpFpdt ( default: AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", - Subtable->Type); + SubTable->Type); /* Attempt to continue */ - if (!Subtable->Length) + if (!SubTable->Length) { AcpiOsPrintf ("Invalid zero length subtable\n"); return; } - goto NextSubtable; + goto NextSubTable; } - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, InfoTable); + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } -NextSubtable: +NextSubTable: /* Point to next subtable */ - Offset += Subtable->Length; - Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable, - Subtable->Length); + Offset += SubTable->Length; + SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable, + SubTable->Length); } } @@ -1534,11 +1534,11 @@ AcpiDmDumpGtdt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_GTDT_HEADER *Subtable; + ACPI_GTDT_HEADER *SubTable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_GTDT); ACPI_DMTABLE_INFO *InfoTable; - UINT32 SubtableLength; + UINT32 SubTableLength; UINT32 GtCount; ACPI_GTDT_TIMER_ENTRY *GtxTable; @@ -1553,34 +1553,34 @@ AcpiDmDumpGtdt ( /* Subtables */ - Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset); + SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoGtdtHdr); + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Length, AcpiDmTableInfoGtdtHdr); if (ACPI_FAILURE (Status)) { return; } GtCount = 0; - switch (Subtable->Type) + switch (SubTable->Type) { case ACPI_GTDT_TYPE_TIMER_BLOCK: - SubtableLength = sizeof (ACPI_GTDT_TIMER_BLOCK); + SubTableLength = sizeof (ACPI_GTDT_TIMER_BLOCK); GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK, - Subtable))->TimerCount; + SubTable))->TimerCount; InfoTable = AcpiDmTableInfoGtdt0; break; case ACPI_GTDT_TYPE_WATCHDOG: - SubtableLength = sizeof (ACPI_GTDT_WATCHDOG); + SubTableLength = sizeof (ACPI_GTDT_WATCHDOG); InfoTable = AcpiDmTableInfoGtdt1; break; @@ -1590,12 +1590,12 @@ AcpiDmDumpGtdt ( /* Cannot continue on unknown type - no length */ AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n", - Subtable->Type); + SubTable->Type); return; } - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, InfoTable); + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; @@ -1603,15 +1603,15 @@ AcpiDmDumpGtdt ( /* Point to end of current subtable (each subtable above is of fixed length) */ - Offset += SubtableLength; + Offset += SubTableLength; /* If there are any Gt Timer Blocks from above, dump them now */ if (GtCount) { GtxTable = ACPI_ADD_PTR ( - ACPI_GTDT_TIMER_ENTRY, Subtable, SubtableLength); - SubtableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY); + ACPI_GTDT_TIMER_ENTRY, SubTable, SubTableLength); + SubTableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY); while (GtCount) { @@ -1630,7 +1630,7 @@ AcpiDmDumpGtdt ( /* Point to next subtable */ - Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Subtable, SubtableLength); + SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, SubTable, SubTableLength); } } @@ -1653,11 +1653,11 @@ AcpiDmDumpHest ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_HEST_HEADER *Subtable; + ACPI_HEST_HEADER *SubTable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_HEST); ACPI_DMTABLE_INFO *InfoTable; - UINT32 SubtableLength; + UINT32 SubTableLength; UINT32 BankCount; ACPI_HEST_IA_ERROR_BANK *BankTable; @@ -1672,70 +1672,70 @@ AcpiDmDumpHest ( /* Subtables */ - Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset); + SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset); while (Offset < Table->Length) { BankCount = 0; - switch (Subtable->Type) + switch (SubTable->Type) { case ACPI_HEST_TYPE_IA32_CHECK: *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***