From f32f7342b65e0eb943baeaa6ffbec8f00c7b4a06 Mon Sep 17 00:00:00 2001 From: Al Stone Date: May 31 2020 23:59:12 +0000 Subject: New upstream version 20200528 --- diff --git a/changes.txt b/changes.txt index ec64db2..32d7d56 100644 --- a/changes.txt +++ b/changes.txt @@ -1,8 +1,61 @@ ---------------------------------------- -30 April 2020. Summary of changes for version 20200430: +28 May 2020. Summary of changes for version 20200528: + + +1) ACPICA kernel-resident subsystem: + +Removed old/obsolete Visual Studio files which were used to build the +Windows versions of the ACPICA tools. Since we have moved to Visual +Studio 2017, we are no longer supporting Visual Studio 2006 and 2009 +project files. The new subdirectory and solution file are located at: + + acpica/generate/msvc2017/AcpiComponents.sln + + +2) iASL Compiler/Disassembler and ACPICA tools: + +iASL: added support for a new OperationRegion Address Space (subtype): +PlatformRtMechanism. Support for this new keyword is being released for +early prototyping. It will appear in the next release of the ACPI +specification. + +iASL: do not optimize the NameString parameter of the CondRefOf operator. +In the previous iASL compiler release, the NameString parameter of the +CondRefOf was optimized. There is evidence that some implementations of +the AML interpreter do not perform the recursive search-to-parent search +during the execution of the CondRefOf operator. Therefore, the CondRefOf +operator behaves differently when the NameString parameter is a single +name segment (a NameSeg) as opposed to a full NamePath (starting at the +root scope) or a NameString containing parent prefixes. + +iASL: Prevent an inadvertent remark message. This change prevents a +remark if within a control method the following exist: +1) An Operation Region is defined, and +2) A Field operator is defined that refers to the region. +This happens because at the top level, the Field operator does not +actually create a new named object, it simply references the operation +region. + +Removed support for the acpinames utility. The acpinames was a simple +utility used to populate and display the ACPI namespace without executing +any AML code. However, ACPICA now supports executable opcodes outside of +control methods. This means that executable AML opcodes such as If and +Store opcodes need to be executed during table load. Therefore, acpinames +would need to be updated to match the same behavior as the acpiexec +utility and since acpiexec can already dump the entire namespace (via the +'namespace' command), we no longer have the need to maintain acpinames. + + In order to dump the contents of the ACPI namepsace using acpiexec, +execute the following command from the command line: + + acpiexec -b "n" [aml files] +---------------------------------------- + + +30 April 2020. Summary of changes for version 20200430: 1) ACPICA kernel-resident subsystem: diff --git a/generate/release/build.sh b/generate/release/build.sh index a306408..da9f43a 100755 --- a/generate/release/build.sh +++ b/generate/release/build.sh @@ -217,7 +217,6 @@ generate_source_package () mkdir $TEMP_DIR/generate/unix/acpiexamples mkdir $TEMP_DIR/generate/unix/acpiexec mkdir $TEMP_DIR/generate/unix/acpihelp - mkdir $TEMP_DIR/generate/unix/acpinames mkdir $TEMP_DIR/generate/unix/acpisrc mkdir $TEMP_DIR/generate/unix/acpixtract mkdir $TEMP_DIR/generate/unix/iasl @@ -264,7 +263,6 @@ generate_source_package () cp generate/unix/acpiexamples/Makefile $TEMP_DIR/generate/unix/acpiexamples cp generate/unix/acpiexec/Makefile $TEMP_DIR/generate/unix/acpiexec cp generate/unix/acpihelp/Makefile $TEMP_DIR/generate/unix/acpihelp - cp generate/unix/acpinames/Makefile $TEMP_DIR/generate/unix/acpinames cp generate/unix/acpisrc/Makefile $TEMP_DIR/generate/unix/acpisrc cp generate/unix/acpixtract/Makefile $TEMP_DIR/generate/unix/acpixtract cp generate/unix/iasl/Makefile $TEMP_DIR/generate/unix/iasl @@ -295,11 +293,13 @@ generate_source_package () # Windows-specific activities # - # Copy project files for MS Visual Studio 2008 (VC++ 9.0) + # Copy project files for MS Visual Studio 2017 - mkdir $TEMP_DIR/generate/msvc9 - cp -r generate/msvc9/*.sln $TEMP_DIR/generate/msvc9/ - cp -r generate/msvc9/*.vcproj $TEMP_DIR/generate/msvc9/ + mkdir $TEMP_DIR/generate/msvc2017 + cp -r generate/msvc2017/*.sln $TEMP_DIR/generate/msvc2017/ + cp -r generate/msvc2017/*.dsp $TEMP_DIR/generate/msvc2017/ + cp -r generate/msvc2017/*.dsw $TEMP_DIR/generate/msvc2017/ + cp -r generate/msvc2017/*.vcxproj $TEMP_DIR/generate/msvc2017/ build_windows_package fi @@ -412,7 +412,6 @@ generate_binary_package() cp libraries/acpidump.exe $TEMP_DIR cp libraries/acpiexec.exe $TEMP_DIR cp libraries/acpihelp.exe $TEMP_DIR - cp libraries/acpinames.exe $TEMP_DIR cp libraries/acpisrc.exe $TEMP_DIR cp libraries/acpixtract.exe $TEMP_DIR cp libraries/iasl.exe $TEMP_DIR diff --git a/generate/unix/Makefile.config b/generate/unix/Makefile.config index 7428745..b466343 100644 --- a/generate/unix/Makefile.config +++ b/generate/unix/Makefile.config @@ -2,8 +2,8 @@ # Makefile.config # # Common configuration and setup file to generate the ACPICA tools and -# utilities: the iASL compiler, acpiexec, acpihelp, acpinames, acpisrc, -# acpixtract, acpibin. +# utilities: the iASL compiler, acpiexec, acpihelp, acpisrc, acpixtract, +# acpibin. # # This file is included by the individual makefiles for each tool. # @@ -33,7 +33,7 @@ # not be necessary to change it. # .SUFFIXES : -PROGS = acpibin acpidump acpiexamples acpiexec acpihelp acpinames acpisrc acpixtract iasl +PROGS = acpibin acpidump acpiexamples acpiexec acpihelp acpisrc acpixtract iasl ACPI_HOST ?= _CYGWIN CC ?= gcc @@ -129,7 +129,6 @@ ACPIDUMP = $(ACPICA_TOOLS)/acpidump ACPIEXAMPLES = $(ACPICA_TOOLS)/examples ACPIEXEC = $(ACPICA_TOOLS)/acpiexec ACPIHELP = $(ACPICA_TOOLS)/acpihelp -ACPINAMES = $(ACPICA_TOOLS)/acpinames ACPISRC = $(ACPICA_TOOLS)/acpisrc ACPIXTRACT = $(ACPICA_TOOLS)/acpixtract ASL_COMPILER = $(ACPICA_SRC)/compiler diff --git a/generate/unix/acpinames/Makefile b/generate/unix/acpinames/Makefile deleted file mode 100644 index 90d3afe..0000000 --- a/generate/unix/acpinames/Makefile +++ /dev/null @@ -1,178 +0,0 @@ -# -# acpinames - Load ACPI table and dump namespace. This is a subset -# of the AcpiExec functionality, it is intended to demonstrate -# the configurability of ACPICA. -# - -# -# Note: This makefile is intended to be used from within the native -# ACPICA directory structure, from under generate/unix. It specifically -# places all object files in a generate/unix subdirectory, not within -# the various ACPICA source directories. This prevents collisions -# between different compilations of the same source file with different -# compile options, and prevents pollution of the source code. -# -include ../Makefile.config -FINAL_PROG = ../$(BINDIR)/acpinames -PROG = $(OBJDIR)/acpinames - -# -# Search paths for source files -# -vpath %.c \ - $(ACPINAMES)\ - $(ACPICA_DISPATCHER)\ - $(ACPICA_EVENTS)\ - $(ACPICA_EXECUTER)\ - $(ACPICA_HARDWARE)\ - $(ACPICA_NAMESPACE)\ - $(ACPICA_PARSER)\ - $(ACPICA_TABLES)\ - $(ACPICA_UTILITIES)\ - $(ACPICA_COMMON)\ - $(ACPICA_OSL) - -HEADERS = \ - $(wildcard $(ACPINAMES)/*.h) - -OBJECTS = \ - $(OBJDIR)/acfileio.o\ - $(OBJDIR)/anmain.o\ - $(OBJDIR)/anstubs.o\ - $(OBJDIR)/antables.o\ - $(OBJDIR)/cmfsize.o\ - $(OBJDIR)/dscontrol.o\ - $(OBJDIR)/dsdebug.o\ - $(OBJDIR)/dsfield.o\ - $(OBJDIR)/dsinit.o\ - $(OBJDIR)/dsmethod.o\ - $(OBJDIR)/dsmthdat.o\ - $(OBJDIR)/dsobject.o\ - $(OBJDIR)/dsopcode.o\ - $(OBJDIR)/dspkginit.o\ - $(OBJDIR)/dsutils.o\ - $(OBJDIR)/dswexec.o\ - $(OBJDIR)/dswload.o\ - $(OBJDIR)/dswload2.o\ - $(OBJDIR)/dswscope.o\ - $(OBJDIR)/dswstate.o\ - $(OBJDIR)/evhandler.o\ - $(OBJDIR)/evmisc.o\ - $(OBJDIR)/evregion.o\ - $(OBJDIR)/evrgnini.o\ - $(OBJDIR)/evxfregn.o\ - $(OBJDIR)/exconcat.o\ - $(OBJDIR)/exconfig.o\ - $(OBJDIR)/exconvrt.o\ - $(OBJDIR)/excreate.o\ - $(OBJDIR)/exdump.o\ - $(OBJDIR)/exfield.o\ - $(OBJDIR)/exfldio.o\ - $(OBJDIR)/exmisc.o\ - $(OBJDIR)/exmutex.o\ - $(OBJDIR)/exnames.o\ - $(OBJDIR)/exoparg1.o\ - $(OBJDIR)/exoparg2.o\ - $(OBJDIR)/exoparg3.o\ - $(OBJDIR)/exoparg6.o\ - $(OBJDIR)/exprep.o\ - $(OBJDIR)/exregion.o\ - $(OBJDIR)/exresnte.o\ - $(OBJDIR)/exresolv.o\ - $(OBJDIR)/exresop.o\ - $(OBJDIR)/exserial.o\ - $(OBJDIR)/exstore.o\ - $(OBJDIR)/exstoren.o\ - $(OBJDIR)/exstorob.o\ - $(OBJDIR)/exsystem.o\ - $(OBJDIR)/exutils.o\ - $(OBJDIR)/getopt.o\ - $(OBJDIR)/hwpci.o\ - $(OBJDIR)/hwvalid.o\ - $(OBJDIR)/nsaccess.o\ - $(OBJDIR)/nsalloc.o\ - $(OBJDIR)/nsarguments.o\ - $(OBJDIR)/nsconvert.o\ - $(OBJDIR)/nsdump.o\ - $(OBJDIR)/nseval.o\ - $(OBJDIR)/nsinit.o\ - $(OBJDIR)/nsload.o\ - $(OBJDIR)/nsnames.o\ - $(OBJDIR)/nsobject.o\ - $(OBJDIR)/nsparse.o\ - $(OBJDIR)/nspredef.o\ - $(OBJDIR)/nsprepkg.o\ - $(OBJDIR)/nsrepair.o\ - $(OBJDIR)/nsrepair2.o\ - $(OBJDIR)/nssearch.o\ - $(OBJDIR)/nsutils.o\ - $(OBJDIR)/nswalk.o\ - $(OBJDIR)/nsxfeval.o\ - $(OBJDIR)/nsxfname.o\ - $(OBJDIR)/nsxfobj.o\ - $(OBJDIR)/osunixxf.o\ - $(OBJDIR)/psargs.o\ - $(OBJDIR)/psloop.o\ - $(OBJDIR)/psobject.o\ - $(OBJDIR)/psopcode.o\ - $(OBJDIR)/psopinfo.o\ - $(OBJDIR)/psparse.o\ - $(OBJDIR)/psscope.o\ - $(OBJDIR)/pstree.o\ - $(OBJDIR)/psutils.o\ - $(OBJDIR)/pswalk.o\ - $(OBJDIR)/psxface.o\ - $(OBJDIR)/tbdata.o\ - $(OBJDIR)/tbfadt.o\ - $(OBJDIR)/tbfind.o\ - $(OBJDIR)/tbinstal.o\ - $(OBJDIR)/tbprint.o\ - $(OBJDIR)/tbutils.o\ - $(OBJDIR)/tbxface.o\ - $(OBJDIR)/tbxfload.o\ - $(OBJDIR)/tbxfroot.o\ - $(OBJDIR)/utaddress.o\ - $(OBJDIR)/utalloc.o\ - $(OBJDIR)/utascii.o\ - $(OBJDIR)/utbuffer.o\ - $(OBJDIR)/utcache.o\ - $(OBJDIR)/utcopy.o\ - $(OBJDIR)/utdebug.o\ - $(OBJDIR)/utdecode.o\ - $(OBJDIR)/utdelete.o\ - $(OBJDIR)/uterror.o\ - $(OBJDIR)/uteval.o\ - $(OBJDIR)/utexcep.o\ - $(OBJDIR)/utglobal.o\ - $(OBJDIR)/uthex.o\ - $(OBJDIR)/utids.o\ - $(OBJDIR)/utinit.o\ - $(OBJDIR)/utlock.o\ - $(OBJDIR)/utmath.o\ - $(OBJDIR)/utmisc.o\ - $(OBJDIR)/utmutex.o\ - $(OBJDIR)/utnonansi.o\ - $(OBJDIR)/utobject.o\ - $(OBJDIR)/utosi.o\ - $(OBJDIR)/utownerid.o\ - $(OBJDIR)/utpredef.o\ - $(OBJDIR)/utresrc.o\ - $(OBJDIR)/utstate.o\ - $(OBJDIR)/utstring.o\ - $(OBJDIR)/utstrsuppt.o\ - $(OBJDIR)/utstrtoul64.o\ - $(OBJDIR)/utxface.o\ - $(OBJDIR)/utxferror.o\ - $(OBJDIR)/utxfinit.o - -# -# Flags specific to acpinames utility -# -CFLAGS += \ - -DACPI_NAMES_APP\ - -I$(ACPINAMES) - -# -# Common Rules -# -include ../Makefile.rules diff --git a/source/compiler/aslcompiler.l b/source/compiler/aslcompiler.l index c221f12..548820f 100644 --- a/source/compiler/aslcompiler.l +++ b/source/compiler/aslcompiler.l @@ -585,6 +585,7 @@ NamePathTail [.]{NameSeg} "GeneralPurposeIo" { count (0); return (PARSEOP_REGIONSPACE_GPIO); } /* ACPI 5.0 */ "GenericSerialBus" { count (0); return (PARSEOP_REGIONSPACE_GSBUS); } /* ACPI 5.0 */ "PCC" { count (0); return (PARSEOP_REGIONSPACE_PCC); } /* ACPI 5.0 */ +"PlatformRtMechanism" { count (0); return (PARSEOP_REGIONSPACE_PRM); } "FFixedHW" { count (0); return (PARSEOP_REGIONSPACE_FFIXEDHW); } /* ResourceTypeKeyword: Resource Usage - Resource Descriptors */ diff --git a/source/compiler/aslkeywords.y b/source/compiler/aslkeywords.y index 41d97aa..a9a1673 100644 --- a/source/compiler/aslkeywords.y +++ b/source/compiler/aslkeywords.y @@ -286,6 +286,7 @@ RegionSpaceKeyword | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_GPIO);} | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_GSBUS);} | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_PCC);} + | PARSEOP_REGIONSPACE_PRM {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_PRM);} | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_FFIXEDHW);} ; diff --git a/source/compiler/aslmap.c b/source/compiler/aslmap.c index d0c5d68..b37e7e2 100644 --- a/source/compiler/aslmap.c +++ b/source/compiler/aslmap.c @@ -377,6 +377,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* REGIONSPACE_PCC */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PLATFORM_COMM, 0, 0), /* REGIONSPACE_PCI */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PCI_CONFIG, 0, 0), /* REGIONSPACE_PCIBAR */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PCI_BAR_TARGET, 0, 0), +/* REGIONSPACE_PRM */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PLATFORM_RT, 0, 0), /* REGIONSPACE_SMBUS */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_SMBUS, 0, 0), /* REGISTER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* RELEASE */ OP_TABLE_ENTRY (AML_RELEASE_OP, 0, 0, 0), diff --git a/source/compiler/aslmethod.c b/source/compiler/aslmethod.c index 2762ff0..3a9177e 100644 --- a/source/compiler/aslmethod.c +++ b/source/compiler/aslmethod.c @@ -616,7 +616,7 @@ MtCheckNamedObjectInMethod ( } OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode); - if (OpInfo->Class == AML_CLASS_NAMED_OBJECT) + if ((OpInfo->Class == AML_CLASS_NAMED_OBJECT) && (Op->Asl.AmlOpcode != AML_FIELD_OP)) { /* * 1) Mark the method as a method that creates named objects. @@ -631,6 +631,9 @@ MtCheckNamedObjectInMethod ( * Reason: If a thread blocks within the method for any reason, and * another thread enters the method, the method will fail because * an attempt will be made to create the same object twice. + * + * Note: The Field opcode is disallowed here because Field() does not + * create a new named object. */ ExternalPath = AcpiNsGetNormalizedPathname (MethodInfo->Op->Asl.Node, TRUE); diff --git a/source/compiler/asltokens.y b/source/compiler/asltokens.y index 8ffa83b..c83ac97 100644 --- a/source/compiler/asltokens.y +++ b/source/compiler/asltokens.y @@ -314,6 +314,7 @@ NoEcho(' %token PARSEOP_REGIONSPACE_PCC %token PARSEOP_REGIONSPACE_PCI %token PARSEOP_REGIONSPACE_PCIBAR +%token PARSEOP_REGIONSPACE_PRM %token PARSEOP_REGIONSPACE_SMBUS %token PARSEOP_REGISTER %token PARSEOP_RELEASE diff --git a/source/compiler/aslxref.c b/source/compiler/aslxref.c index b8f3d75..0e2d7dc 100644 --- a/source/compiler/aslxref.c +++ b/source/compiler/aslxref.c @@ -713,9 +713,24 @@ XfNamespaceLocateBegin ( Node->Flags |= ANOBJ_IS_REFERENCED; } - /* Attempt to optimize the NamePath */ - - OptOptimizeNamePath (Op, OpInfo->Flags, WalkState, Path, Node); + /* + * Attempt to optimize the NamePath + * + * One special case: CondRefOf operator - not all AML interpreter + * implementations expect optimized namepaths as a parameter to this + * operator. They require relative name paths with prefix operators or + * namepaths starting with the root scope. + * + * Other AML interpreter implementations do not perform the namespace + * search that starts at the current scope and recursively searching the + * parent scope until the root scope. The lack of search is only known to + * occur for the namestring parameter for the CondRefOf operator. + */ + if ((Op->Asl.Parent) && + (Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_CONDREFOF)) + { + OptOptimizeNamePath (Op, OpInfo->Flags, WalkState, Path, Node); + } /* * 1) Dereference an alias (A name reference that is an alias) diff --git a/source/components/debugger/dbdisply.c b/source/components/debugger/dbdisply.c index a3dbb7d..c49d438 100644 --- a/source/components/debugger/dbdisply.c +++ b/source/components/debugger/dbdisply.c @@ -96,6 +96,8 @@ static ACPI_ADR_SPACE_TYPE AcpiGbl_SpaceIdList[] = ACPI_ADR_SPACE_IPMI, ACPI_ADR_SPACE_GPIO, ACPI_ADR_SPACE_GSBUS, + ACPI_ADR_SPACE_PLATFORM_COMM, + ACPI_ADR_SPACE_PLATFORM_RT, ACPI_ADR_SPACE_DATA_TABLE, ACPI_ADR_SPACE_FIXED_HARDWARE }; diff --git a/source/components/utilities/utdecode.c b/source/components/utilities/utdecode.c index 5726f2f..3c85500 100644 --- a/source/components/utilities/utdecode.c +++ b/source/components/utilities/utdecode.c @@ -106,17 +106,18 @@ const UINT8 AcpiGbl_NsProperties[ACPI_NUM_NS_TYPES] = const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] = { - "SystemMemory", /* 0x00 */ - "SystemIO", /* 0x01 */ - "PCI_Config", /* 0x02 */ - "EmbeddedControl", /* 0x03 */ - "SMBus", /* 0x04 */ - "SystemCMOS", /* 0x05 */ - "PCIBARTarget", /* 0x06 */ - "IPMI", /* 0x07 */ - "GeneralPurposeIo", /* 0x08 */ - "GenericSerialBus", /* 0x09 */ - "PCC" /* 0x0A */ + "SystemMemory", /* 0x00 */ + "SystemIO", /* 0x01 */ + "PCI_Config", /* 0x02 */ + "EmbeddedControl", /* 0x03 */ + "SMBus", /* 0x04 */ + "SystemCMOS", /* 0x05 */ + "PCIBARTarget", /* 0x06 */ + "IPMI", /* 0x07 */ + "GeneralPurposeIo", /* 0x08 */ + "GenericSerialBus", /* 0x09 */ + "PCC", /* 0x0A */ + "PlatformRtMechanism" /* 0x0B */ }; diff --git a/source/include/acpixf.h b/source/include/acpixf.h index c371ccd..1fa5770 100644 --- a/source/include/acpixf.h +++ b/source/include/acpixf.h @@ -46,7 +46,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20200430 +#define ACPI_CA_VERSION 0x20200528 #include "acconfig.h" #include "actypes.h" diff --git a/source/include/actypes.h b/source/include/actypes.h index ad5c21d..cb8d7cd 100644 --- a/source/include/actypes.h +++ b/source/include/actypes.h @@ -860,8 +860,9 @@ typedef UINT8 ACPI_ADR_SPACE_TYPE; #define ACPI_ADR_SPACE_GPIO (ACPI_ADR_SPACE_TYPE) 8 #define ACPI_ADR_SPACE_GSBUS (ACPI_ADR_SPACE_TYPE) 9 #define ACPI_ADR_SPACE_PLATFORM_COMM (ACPI_ADR_SPACE_TYPE) 10 +#define ACPI_ADR_SPACE_PLATFORM_RT (ACPI_ADR_SPACE_TYPE) 11 -#define ACPI_NUM_PREDEFINED_REGIONS 11 +#define ACPI_NUM_PREDEFINED_REGIONS 12 /* * Special Address Spaces diff --git a/source/os_specific/service_layers/oslinuxtbl.c b/source/os_specific/service_layers/oslinuxtbl.c index 12e9028..5e2b34a 100644 --- a/source/os_specific/service_layers/oslinuxtbl.c +++ b/source/os_specific/service_layers/oslinuxtbl.c @@ -84,7 +84,6 @@ static ACPI_STATUS OslReadTableFromFile ( char *Filename, ACPI_SIZE FileOffset, - char *Signature, ACPI_TABLE_HEADER **Table); static ACPI_STATUS @@ -1382,8 +1381,6 @@ OslTableNameFromFile ( * * PARAMETERS: Filename - File that contains the desired table * FileOffset - Offset of the table in file - * Signature - Optional ACPI Signature for desired table. - * A null terminated 4-character string. * Table - Where a pointer to the table is returned * * RETURN: Status; Table buffer is returned if AE_OK. @@ -1396,7 +1393,6 @@ static ACPI_STATUS OslReadTableFromFile ( char *Filename, ACPI_SIZE FileOffset, - char *Signature, ACPI_TABLE_HEADER **Table) { FILE *TableFile; @@ -1428,6 +1424,8 @@ OslReadTableFromFile ( goto Exit; } +#ifdef ACPI_OBSOLETE_FUNCTIONS + /* If signature is specified, it must match the table */ if (Signature) @@ -1449,6 +1447,7 @@ OslReadTableFromFile ( goto Exit; } } +#endif TableLength = ApGetTableLength (&Header); if (TableLength == 0) @@ -1580,7 +1579,7 @@ OslGetCustomizedTable ( /* There is no physical address saved for customized tables, use zero */ *Address = 0; - Status = OslReadTableFromFile (TableFilename, 0, NULL, Table); + Status = OslReadTableFromFile (TableFilename, 0, Table); return (Status); } diff --git a/source/tools/acpinames/acpinames.h b/source/tools/acpinames/acpinames.h deleted file mode 100644 index b2f7a88..0000000 --- a/source/tools/acpinames/acpinames.h +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************************************** - * - * Module Name: acpinames.h - Common include for AcpiNames utility - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2020, Intel Corp. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce at minimum a disclaimer - * substantially similar to the "NO WARRANTY" disclaimer below - * ("Disclaimer") and any redistribution must be conditioned upon - * including a substantially similar Disclaimer requirement for further - * binary redistribution. - * 3. Neither the names of the above-listed copyright holders nor the names - * of any contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * NO WARRANTY - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - */ - -#ifndef _ACPINAMES_H -#define _ACPINAMES_H - -#include "acpi.h" -#include "accommon.h" -#include "acapps.h" -#include "acutils.h" -#include "acnamesp.h" -#include "actables.h" -#include "acinterp.h" - -#include - -#define ACPI_MAX_INIT_TABLES (32) - -extern BOOLEAN AcpiGbl_NsLoadOnly; - - -ACPI_STATUS -AnBuildLocalTables ( - ACPI_NEW_TABLE_DESC *TableList); - -#endif diff --git a/source/tools/acpinames/anmain.c b/source/tools/acpinames/anmain.c deleted file mode 100644 index 732fde0..0000000 --- a/source/tools/acpinames/anmain.c +++ /dev/null @@ -1,308 +0,0 @@ -/****************************************************************************** - * - * Module Name: anmain - Main routine for the AcpiNames utility - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2020, Intel Corp. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce at minimum a disclaimer - * substantially similar to the "NO WARRANTY" disclaimer below - * ("Disclaimer") and any redistribution must be conditioned upon - * including a substantially similar Disclaimer requirement for further - * binary redistribution. - * 3. Neither the names of the above-listed copyright holders nor the names - * of any contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * NO WARRANTY - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - */ - -#include "acpinames.h" -#include "actables.h" -#include "errno.h" - -#define _COMPONENT ACPI_TOOLS - ACPI_MODULE_NAME ("anmain") - - -/* Local prototypes */ - -static int -AnDumpEntireNamespace ( - ACPI_NEW_TABLE_DESC *ListHead); - - -/* - * Main routine for the ACPI user-space namespace utility. - * - * Portability note: The utility depends upon the host for command-line - * wildcard support - it is not implemented locally. For example: - * - * Linux/Unix systems: Shell expands wildcards automatically. - * - * Windows: The setargv.obj module must be linked in to automatically - * expand wildcards. - */ -BOOLEAN AcpiGbl_NsLoadOnly = FALSE; - - -#define AN_UTILITY_NAME "ACPI Namespace Dump Utility" -#define AN_SUPPORTED_OPTIONS "?hlv^x:" - - -/****************************************************************************** - * - * FUNCTION: usage - * - * PARAMETERS: None - * - * RETURN: None - * - * DESCRIPTION: Print a usage message - * - *****************************************************************************/ - -static void -usage ( - void) -{ - - ACPI_USAGE_HEADER ("AcpiNames [options] AMLfile"); - ACPI_OPTION ("-?", "Display this message"); - ACPI_OPTION ("-l", "Load namespace only, no display"); - ACPI_OPTION ("-v", "Display version information"); - ACPI_OPTION ("-vd", "Display build date and time"); - ACPI_OPTION ("-x ", "Debug output level"); -} - - -/****************************************************************************** - * - * FUNCTION: main - * - * PARAMETERS: argc, argv - * - * RETURN: Status (pass/fail) - * - * DESCRIPTION: Main routine for NsDump utility - * - *****************************************************************************/ - -int ACPI_SYSTEM_XFACE -main ( - int argc, - char **argv) -{ - ACPI_NEW_TABLE_DESC *ListHead = NULL; - ACPI_STATUS Status; - int j; - - - ACPI_DEBUG_INITIALIZE (); /* For debug version only */ - - /* Init debug globals and ACPICA */ - - AcpiDbgLevel = ACPI_NORMAL_DEFAULT | ACPI_LV_TABLES; - AcpiDbgLayer = 0xFFFFFFFF; - - /* Set flags so that the interpreter is not used */ - - Status = AcpiInitializeSubsystem (); - ACPI_CHECK_OK (AcpiInitializeSubsystem, Status); - if (ACPI_FAILURE (Status)) - { - return (-1); - } - - printf (ACPI_COMMON_SIGNON (AN_UTILITY_NAME)); - if (argc < 2) - { - usage (); - return (0); - } - - /* Get the command line options */ - - while ((j = AcpiGetopt (argc, argv, AN_SUPPORTED_OPTIONS)) != ACPI_OPT_END) switch(j) - { - case 'l': - - AcpiGbl_NsLoadOnly = TRUE; - break; - - case 'v': - - switch (AcpiGbl_Optarg[0]) - { - case '^': /* -v: (Version): signon already emitted, just exit */ - - exit (0); - - case 'd': - - printf (ACPI_COMMON_BUILD_TIME); - return (0); - - default: - - printf ("Unknown option: -v%s\n", AcpiGbl_Optarg); - return (-1); - } - break; - - case 'x': - - AcpiDbgLevel = strtoul (AcpiGbl_Optarg, NULL, 0); - printf ("Debug Level: 0x%8.8X\n", AcpiDbgLevel); - break; - - case '?': - case 'h': - default: - - usage(); - return (0); - } - - /* Get each of the ACPI table files on the command line */ - - while (argv[AcpiGbl_Optind]) - { - /* Get all ACPI AML tables in this file */ - - Status = AcGetAllTablesFromFile (argv[AcpiGbl_Optind], - ACPI_GET_ALL_TABLES, &ListHead); - if (ACPI_FAILURE (Status)) - { - return (-1); - } - - AcpiGbl_Optind++; - } - - printf ("\n"); - - /* - * The next argument is the filename for the DSDT or SSDT. - * Open the file, build namespace and dump it. - */ - return (AnDumpEntireNamespace (ListHead)); -} - - -/****************************************************************************** - * - * FUNCTION: AnDumpEntireNamespace - * - * PARAMETERS: AmlFilename - Filename for DSDT or SSDT AML table - * - * RETURN: Status (pass/fail) - * - * DESCRIPTION: Build an ACPI namespace for the input AML table, and dump the - * formatted namespace contents. - * - *****************************************************************************/ - -static int -AnDumpEntireNamespace ( - ACPI_NEW_TABLE_DESC *ListHead) -{ - ACPI_STATUS Status; - ACPI_HANDLE Handle; - - - /* - * Build a local XSDT with all tables. Normally, here is where the - * RSDP search is performed to find the ACPI tables - */ - Status = AnBuildLocalTables (ListHead); - if (ACPI_FAILURE (Status)) - { - return (-1); - } - - /* Initialize table manager, get XSDT */ - - Status = AcpiInitializeTables (NULL, ACPI_MAX_INIT_TABLES, TRUE); - if (ACPI_FAILURE (Status)) - { - printf ("**** Could not initialize ACPI table manager, %s\n", - AcpiFormatException (Status)); - return (-1); - } - - /* Build the namespace from the tables */ - - Status = AcpiLoadTables (); - if (Status == AE_CTRL_TERMINATE) - { - /* At least one table load failed -- terminate with error */ - - return (-1); - } - - if (ACPI_FAILURE (Status)) - { - printf ("**** While creating namespace, %s\n", - AcpiFormatException (Status)); - return (-1); - } - - if (AcpiGbl_NsLoadOnly) - { - printf ("**** Namespace successfully loaded\n"); - return (0); - } - - /* - * NOTE: - * We don't need to do any further ACPICA initialization, since we don't - * have any hardware, nor is the interpreter configured. - * - * Namely, we don't need these calls: - * AcpiEnableSubsystem - * AcpiInitializeObjects - */ - - - /* - * Perform a namespace walk to dump the contents - */ - AcpiOsPrintf ("\nACPI Namespace:\n"); - - AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, - ACPI_UINT32_MAX, ACPI_OWNER_ID_MAX, AcpiGbl_RootNode); - - - /* Example: get a handle to the _GPE scope */ - - Status = AcpiGetHandle (NULL, "\\_GPE", &Handle); - ACPI_CHECK_OK (AcpiGetHandle, Status); - - AcDeleteTableList (ListHead); - return (0); -} diff --git a/source/tools/acpinames/anstubs.c b/source/tools/acpinames/anstubs.c deleted file mode 100644 index ff0cded..0000000 --- a/source/tools/acpinames/anstubs.c +++ /dev/null @@ -1,400 +0,0 @@ -/****************************************************************************** - * - * Module Name: anstubs - Stub routines for the AcpiNames utility - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2020, Intel Corp. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce at minimum a disclaimer - * substantially similar to the "NO WARRANTY" disclaimer below - * ("Disclaimer") and any redistribution must be conditioned upon - * including a substantially similar Disclaimer requirement for further - * binary redistribution. - * 3. Neither the names of the above-listed copyright holders nor the names - * of any contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * NO WARRANTY - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - */ - -#include "acpinames.h" - -#include -#include -#include - -#define _COMPONENT ACPI_TOOLS - ACPI_MODULE_NAME ("anstubs") - - -/****************************************************************************** - * - * DESCRIPTION: Stubs used to facilitate linkage of the NsDump utility. - * - *****************************************************************************/ - - -/* Utilities */ - -#ifdef ACPI_OBSOLETE_FUNCTIONS - -ACPI_STATUS -AcpiUtCopyIobjectToEobject ( - ACPI_OPERAND_OBJECT *Obj, - ACPI_BUFFER *RetBuffer) -{ - ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED, - "Stubbed function")); - - return (AE_NOT_IMPLEMENTED); -} - -ACPI_STATUS -AcpiUtCopyEobjectToIobject ( - ACPI_OBJECT *Obj, - ACPI_OPERAND_OBJECT **InternalObj) -{ - ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED, - "Stubbed function")); - - return (AE_NOT_IMPLEMENTED); -} - -ACPI_STATUS -AcpiUtCopyIobjectToIobject ( - ACPI_OPERAND_OBJECT *SourceDesc, - ACPI_OPERAND_OBJECT **DestDesc, - ACPI_WALK_STATE *WalkState) -{ - ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED, - "Stubbed function")); - - return (AE_NOT_IMPLEMENTED); -} -#endif - -/* Hardware */ - -UINT32 -AcpiHwGetMode ( - void) -{ - return (0); -} - -/* Event manager */ - -#ifdef ACPI_OBSOLETE_FUNCTIONS - -ACPI_STATUS -AcpiEvInstallRegionHandlers ( - void) -{ - return (AE_OK); -} - -ACPI_STATUS -AcpiEvInitializeOpRegions ( - void) -{ - return (AE_OK); -} - -ACPI_STATUS -AcpiEvInitializeRegion ( - ACPI_OPERAND_OBJECT *RegionObj) -{ - return (AE_OK); -} -#endif - -ACPI_STATUS -AcpiEvInstallXruptHandlers ( - void) -{ - return (AE_OK); -} - -ACPI_STATUS -AcpiEvInitializeEvents ( - void) -{ - return (AE_OK); -} - - -/* AML Interpreter */ - -#ifdef ACPI_OBSOLETE_FUNCTIONS - -ACPI_STATUS -AcpiExReadDataFromField ( - ACPI_WALK_STATE *WalkState, - ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_OPERAND_OBJECT **RetBufferDesc) -{ - ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED, - "Stubbed function")); - - return (AE_NOT_IMPLEMENTED); -} - -ACPI_STATUS -AcpiExWriteDataToField ( - ACPI_OPERAND_OBJECT *SourceDesc, - ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_OPERAND_OBJECT **ResultDesc) -{ - ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED, - "Stubbed function")); - - return (AE_NOT_IMPLEMENTED); -} - -ACPI_STATUS -AcpiExStoreObjectToNode ( - ACPI_OPERAND_OBJECT *SourceDesc, - ACPI_NAMESPACE_NODE *Node, - ACPI_WALK_STATE *WalkState, - UINT8 ImplicitConversion) -{ - ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED, - "Stubbed function")); - - return (AE_NOT_IMPLEMENTED); -} - -/* Namespace manager */ - -ACPI_STATUS -AcpiNsEvaluate ( - ACPI_EVALUATE_INFO *Info) -{ - ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED, - "Stubbed function")); - - return (AE_NOT_IMPLEMENTED); -} -#endif - -void -AcpiExDoDebugObject ( - ACPI_OPERAND_OBJECT *SourceDesc, - UINT32 Level, - UINT32 Index) -{ - return; -} - -void -AcpiExStartTraceMethod ( - ACPI_NAMESPACE_NODE *MethodNode, - ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_WALK_STATE *WalkState) -{ - return; -} - -void -AcpiExStopTraceMethod ( - ACPI_NAMESPACE_NODE *MethodNode, - ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_WALK_STATE *WalkState) -{ - return; -} - -void -AcpiExStartTraceOpcode ( - ACPI_PARSE_OBJECT *Op, - ACPI_WALK_STATE *WalkState) -{ - return; -} - -void -AcpiExStopTraceOpcode ( - ACPI_PARSE_OBJECT *Op, - ACPI_WALK_STATE *WalkState) - -{ - return; -} - -void -AcpiExTracePoint ( - ACPI_TRACE_EVENT_TYPE Type, - BOOLEAN Begin, - UINT8 *Aml, - char *Pathname) -{ - return; -} - - -/* Dispatcher */ - -#ifdef ACPI_OBSOLETE_FUNCTIONS - -ACPI_STATUS -AcpiDsAutoSerializeMethod ( - ACPI_NAMESPACE_NODE *Node, - ACPI_OPERAND_OBJECT *ObjDesc) -{ - return (AE_OK); -} - -ACPI_STATUS -AcpiDsInitializeRegion ( - ACPI_HANDLE ObjHandle) -{ - return (AE_OK); -} - -ACPI_STATUS -AcpiDsCallControlMethod ( - ACPI_THREAD_STATE *Thread, - ACPI_WALK_STATE *WalkState, - ACPI_PARSE_OBJECT *Op) -{ - ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED, - "Stubbed function")); - - return (AE_NOT_IMPLEMENTED); -} - -ACPI_STATUS -AcpiDsRestartControlMethod ( - ACPI_WALK_STATE *WalkState, - ACPI_OPERAND_OBJECT *ReturnDesc) -{ - ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED, - "Stubbed function")); - - return (AE_NOT_IMPLEMENTED); -} - -void -AcpiDsTerminateControlMethod ( - ACPI_OPERAND_OBJECT *MethodDesc, - ACPI_WALK_STATE *WalkState) -{ -} - -ACPI_STATUS -AcpiDsMethodError ( - ACPI_STATUS Status, - ACPI_WALK_STATE *WalkState) -{ - ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED, - "Stubbed function")); - - return (AE_NOT_IMPLEMENTED); -} - -ACPI_STATUS -AcpiDsBeginMethodExecution ( - ACPI_NAMESPACE_NODE *MethodNode, - ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_WALK_STATE *WalkState) -{ - ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED, - "Stubbed function")); - - return (AE_NOT_IMPLEMENTED); -} - -ACPI_STATUS -AcpiDsGetPredicateValue ( - ACPI_WALK_STATE *WalkState, - ACPI_OPERAND_OBJECT *ResultObj) -{ - ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED, - "Stubbed function")); - - return (AE_NOT_IMPLEMENTED); -} -#endif - -ACPI_STATUS -AcpiDsGetBufferFieldArguments ( - ACPI_OPERAND_OBJECT *ObjDesc) -{ - return (AE_OK); -} - -ACPI_STATUS -AcpiDsGetBankFieldArguments ( - ACPI_OPERAND_OBJECT *ObjDesc) -{ - return (AE_OK); -} - -ACPI_STATUS -AcpiDsGetRegionArguments ( - ACPI_OPERAND_OBJECT *RgnDesc) -{ - return (AE_OK); -} - -ACPI_STATUS -AcpiDsGetBufferArguments ( - ACPI_OPERAND_OBJECT *ObjDesc) -{ - return (AE_OK); -} - -ACPI_STATUS -AcpiDsGetPackageArguments ( - ACPI_OPERAND_OBJECT *ObjDesc) -{ - return (AE_OK); -} - -#ifdef ACPI_OBSOLETE_FUNCTIONS - -ACPI_STATUS -AcpiDsExecBeginOp ( - ACPI_WALK_STATE *WalkState, - ACPI_PARSE_OBJECT **OutOp) -{ - ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED, - "Stubbed function")); - - return (AE_NOT_IMPLEMENTED); -} - -ACPI_STATUS -AcpiDsExecEndOp ( - ACPI_WALK_STATE *State) -{ - ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED, - "Stubbed function")); - - return (AE_NOT_IMPLEMENTED); -} -#endif diff --git a/source/tools/acpinames/antables.c b/source/tools/acpinames/antables.c deleted file mode 100644 index 0fc746b..0000000 --- a/source/tools/acpinames/antables.c +++ /dev/null @@ -1,356 +0,0 @@ -/****************************************************************************** - * - * Module Name: antables - ACPI table setup/install for AcpiNames utility - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2020, Intel Corp. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce at minimum a disclaimer - * substantially similar to the "NO WARRANTY" disclaimer below - * ("Disclaimer") and any redistribution must be conditioned upon - * including a substantially similar Disclaimer requirement for further - * binary redistribution. - * 3. Neither the names of the above-listed copyright holders nor the names - * of any contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * NO WARRANTY - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - */ - -#include "acpinames.h" - -#define _COMPONENT ACPI_TOOLS - ACPI_MODULE_NAME ("antables") - -/* Local prototypes */ - -static void -AnInitializeTableHeader ( - ACPI_TABLE_HEADER *Header, - char *Signature, - UINT32 Length); - - -/* Non-AML tables that are constructed locally and installed */ - -static ACPI_TABLE_RSDP LocalRSDP; -static ACPI_TABLE_FACS LocalFACS; - -/* - * We need a local FADT so that the hardware subcomponent will function, - * even though the underlying OSD HW access functions don't do anything. - */ -static ACPI_TABLE_FADT LocalFADT; - -/* - * Use XSDT so that both 32- and 64-bit versions of this utility will - * function automatically. - */ -static ACPI_TABLE_XSDT *LocalXSDT; - -#define BASE_XSDT_TABLES 1 -#define BASE_XSDT_SIZE (sizeof (ACPI_TABLE_XSDT) + \ - ((BASE_XSDT_TABLES -1) * sizeof (UINT64))) - - -/****************************************************************************** - * - * FUNCTION: AnInitializeTableHeader - * - * PARAMETERS: Header - A valid standard ACPI table header - * Signature - Signature to insert - * Length - Length of the table - * - * RETURN: None. Header is modified. - * - * DESCRIPTION: Initialize the table header for a local ACPI table. - * - *****************************************************************************/ - -static void -AnInitializeTableHeader ( - ACPI_TABLE_HEADER *Header, - char *Signature, - UINT32 Length) -{ - - ACPI_COPY_NAMESEG (Header->Signature, Signature); - Header->Length = Length; - - Header->OemRevision = 0x1001; - memcpy (Header->OemId, "Intel ", ACPI_OEM_ID_SIZE); - memcpy (Header->OemTableId, "AcpiExec", ACPI_OEM_TABLE_ID_SIZE); - ACPI_COPY_NAMESEG (Header->AslCompilerId, "INTL"); - Header->AslCompilerRevision = ACPI_CA_VERSION; - - /* Set the checksum, must set to zero first */ - - Header->Checksum = 0; - Header->Checksum = (UINT8) -AcpiTbChecksum ( - (void *) Header, Header->Length); -} - - -/****************************************************************************** - * - * FUNCTION: AnBuildLocalTables - * - * PARAMETERS: TableCount - Number of tables on the command line - * TableList - List of actual tables from files - * - * RETURN: Status - * - * DESCRIPTION: Build a complete ACPI table chain, with a local RSDP, XSDT, - * FADT, FACS, and the input DSDT/SSDT. - * - *****************************************************************************/ - -ACPI_STATUS -AnBuildLocalTables ( - ACPI_NEW_TABLE_DESC *TableList) -{ - UINT32 TableCount = 0; - ACPI_PHYSICAL_ADDRESS DsdtAddress = 0; - UINT32 XsdtSize; - ACPI_NEW_TABLE_DESC *NextTable; - UINT32 NextIndex; - ACPI_TABLE_FADT *ExternalFadt = NULL; - - - /* - * Update the table count. For the DSDT, it is not put into the XSDT. - * For the FADT, this table is already accounted for since we usually - * install a local FADT. - */ - NextTable = TableList; - while (NextTable) - { - if (!ACPI_COMPARE_NAMESEG (NextTable->Table->Signature, ACPI_SIG_DSDT) && - !ACPI_COMPARE_NAMESEG (NextTable->Table->Signature, ACPI_SIG_FADT)) - { - TableCount++; - } - - NextTable = NextTable->Next; - } - - XsdtSize = BASE_XSDT_SIZE + (TableCount * sizeof (UINT64)); - - /* Build an XSDT */ - - LocalXSDT = AcpiOsAllocate (XsdtSize); - if (!LocalXSDT) - { - return (AE_NO_MEMORY); - } - - memset (LocalXSDT, 0, XsdtSize); - LocalXSDT->TableOffsetEntry[0] = ACPI_PTR_TO_PHYSADDR (&LocalFADT); - - /* - * Install the user tables. The DSDT must be installed in the FADT. - * All other tables are installed directly into the XSDT. - * - * Note: The tables are loaded in reverse order from the incoming - * input, which makes it match the command line order. - */ - NextIndex = BASE_XSDT_TABLES; - NextTable = TableList; - while (NextTable) - { - /* - * Incoming DSDT or FADT are special cases. All other tables are - * just immediately installed into the XSDT. - */ - if (ACPI_COMPARE_NAMESEG (NextTable->Table->Signature, ACPI_SIG_DSDT)) - { - if (DsdtAddress) - { - printf ("Already found a DSDT, only one allowed\n"); - return (AE_ALREADY_EXISTS); - } - - /* The incoming user table is a DSDT */ - - DsdtAddress = ACPI_PTR_TO_PHYSADDR (NextTable->Table); - } - else if (ACPI_COMPARE_NAMESEG (NextTable->Table->Signature, ACPI_SIG_FADT)) - { - ExternalFadt = - ACPI_CAST_PTR (ACPI_TABLE_FADT, NextTable->Table); - LocalXSDT->TableOffsetEntry[0] = - ACPI_PTR_TO_PHYSADDR (NextTable->Table); - } - else - { - /* Install the table in the XSDT */ - - LocalXSDT->TableOffsetEntry[TableCount - NextIndex + 1] = - ACPI_PTR_TO_PHYSADDR (NextTable->Table); - NextIndex++; - } - - NextTable = NextTable->Next; - } - - /* Build an RSDP. Contains a valid XSDT only, no RSDT */ - - memset (&LocalRSDP, 0, sizeof (ACPI_TABLE_RSDP)); - ACPI_MAKE_RSDP_SIG (LocalRSDP.Signature); - memcpy (LocalRSDP.OemId, "Intel", 6); - - LocalRSDP.Revision = 2; - LocalRSDP.XsdtPhysicalAddress = ACPI_PTR_TO_PHYSADDR (LocalXSDT); - LocalRSDP.Length = sizeof (ACPI_TABLE_XSDT); - - /* Set checksums for both XSDT and RSDP */ - - AnInitializeTableHeader ((void *) LocalXSDT, ACPI_SIG_XSDT, XsdtSize); - - LocalRSDP.Checksum = 0; - LocalRSDP.Checksum = (UINT8) -AcpiTbChecksum ( - (void *) &LocalRSDP, ACPI_RSDP_CHECKSUM_LENGTH); - - if (!DsdtAddress) - { - return (AE_SUPPORT); - } - - /* - * Build an FADT. There are two options for the FADT: - * 1) Incoming external FADT specified on the command line - * 2) A fully featured local FADT - */ - memset (&LocalFADT, 0, sizeof (ACPI_TABLE_FADT)); - - if (ExternalFadt) - { - /* - * Use the external FADT, but we must update the DSDT/FACS - * addresses as well as the checksum - */ - ExternalFadt->Dsdt = (UINT32) DsdtAddress; - ExternalFadt->Facs = ACPI_PTR_TO_PHYSADDR (&LocalFACS); - - /* - * If there room in the FADT for the XDsdt and XFacs 64-bit - * pointers, use them. - */ - if (ExternalFadt->Header.Length > ACPI_PTR_DIFF ( - &ExternalFadt->XDsdt, ExternalFadt)) - { - ExternalFadt->Dsdt = 0; - ExternalFadt->Facs = 0; - ExternalFadt->XDsdt = DsdtAddress; - ExternalFadt->XFacs = ACPI_PTR_TO_PHYSADDR (&LocalFACS); - } - - /* Complete the external FADT with the checksum */ - - ExternalFadt->Header.Checksum = 0; - ExternalFadt->Header.Checksum = (UINT8) -AcpiTbChecksum ( - (void *) ExternalFadt, ExternalFadt->Header.Length); - } - else - { - /* - * Build a local FADT so we can test the hardware/event init - */ - LocalFADT.Header.Revision = 5; - - /* Setup FADT header and DSDT/FACS addresses */ - - LocalFADT.Dsdt = 0; - LocalFADT.Facs = 0; - - LocalFADT.XDsdt = DsdtAddress; - LocalFADT.XFacs = ACPI_PTR_TO_PHYSADDR (&LocalFACS); - - /* Miscellaneous FADT fields */ - - LocalFADT.Gpe0BlockLength = 16; - LocalFADT.Gpe0Block = 0x00001234; - - LocalFADT.Gpe1BlockLength = 6; - LocalFADT.Gpe1Block = 0x00005678; - LocalFADT.Gpe1Base = 96; - - LocalFADT.Pm1EventLength = 4; - LocalFADT.Pm1aEventBlock = 0x00001aaa; - LocalFADT.Pm1bEventBlock = 0x00001bbb; - - LocalFADT.Pm1ControlLength = 2; - LocalFADT.Pm1aControlBlock = 0xB0; - - LocalFADT.PmTimerLength = 4; - LocalFADT.PmTimerBlock = 0xA0; - - LocalFADT.Pm2ControlBlock = 0xC0; - LocalFADT.Pm2ControlLength = 1; - - /* Setup one example X-64 field */ - - LocalFADT.XPm1bEventBlock.SpaceId = ACPI_ADR_SPACE_SYSTEM_IO; - LocalFADT.XPm1bEventBlock.Address = LocalFADT.Pm1bEventBlock; - LocalFADT.XPm1bEventBlock.BitWidth = (UINT8) - ACPI_MUL_8 (LocalFADT.Pm1EventLength); - } - - AnInitializeTableHeader ((void *) &LocalFADT, - ACPI_SIG_FADT, sizeof (ACPI_TABLE_FADT)); - - /* Build a FACS */ - - memset (&LocalFACS, 0, sizeof (ACPI_TABLE_FACS)); - ACPI_COPY_NAMESEG (LocalFACS.Signature, ACPI_SIG_FACS); - - LocalFACS.Length = sizeof (ACPI_TABLE_FACS); - LocalFACS.GlobalLock = 0x11AA0011; - return (AE_OK); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsGetRootPointer - * - * PARAMETERS: None - * - * RETURN: Address of the RSDP - * - * DESCRIPTION: Return a local RSDP, used to dynamically load tables via the - * standard ACPI mechanism. - * - *****************************************************************************/ - -ACPI_PHYSICAL_ADDRESS -AcpiOsGetRootPointer ( - void) -{ - - return (ACPI_PTR_TO_PHYSADDR (&LocalRSDP)); -}