diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2015-08-25 19:41:12 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2015-08-25 19:41:12 +0000 |
commit | c25a97c7b4f09b4c9efa992434d341f5b89629ff (patch) | |
tree | 2fa9d2167f719968f73daa4ec16528a068d308ad /source/tools | |
parent | 136eac2a0638d3c751b1987603f71a9ae26879fd (diff) | |
download | src-test2-c25a97c7b4f09b4c9efa992434d341f5b89629ff.tar.gz src-test2-c25a97c7b4f09b4c9efa992434d341f5b89629ff.zip |
Notes
Diffstat (limited to 'source/tools')
-rw-r--r-- | source/tools/acpiexec/aeexec.c | 3 | ||||
-rw-r--r-- | source/tools/acpiexec/aemain.c | 74 | ||||
-rw-r--r-- | source/tools/acpiexec/aetables.c | 75 | ||||
-rw-r--r-- | source/tools/acpihelp/ahdecode.c | 2 | ||||
-rw-r--r-- | source/tools/acpinames/acpinames.h | 2 | ||||
-rw-r--r-- | source/tools/acpinames/anmain.c | 142 | ||||
-rw-r--r-- | source/tools/acpinames/anstubs.c | 42 | ||||
-rw-r--r-- | source/tools/acpinames/antables.c | 115 | ||||
-rw-r--r-- | source/tools/acpisrc/astable.c | 2 |
9 files changed, 324 insertions, 133 deletions
diff --git a/source/tools/acpiexec/aeexec.c b/source/tools/acpiexec/aeexec.c index 28ac7afb25f5..518c20e94520 100644 --- a/source/tools/acpiexec/aeexec.c +++ b/source/tools/acpiexec/aeexec.c @@ -665,7 +665,8 @@ AeMiscellaneousTests ( ReturnBuf.Length = 32; ReturnBuf.Pointer = Buffer; - Status = AcpiGetName (ACPI_ROOT_OBJECT, ACPI_FULL_PATHNAME, &ReturnBuf); + Status = AcpiGetName (ACPI_ROOT_OBJECT, + ACPI_FULL_PATHNAME_NO_TRAILING, &ReturnBuf); AE_CHECK_OK (AcpiGetName, Status); /* Get Devices */ diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c index 026e5fb9ae39..6e839e9a27dc 100644 --- a/source/tools/acpiexec/aemain.c +++ b/source/tools/acpiexec/aemain.c @@ -90,12 +90,13 @@ BOOLEAN AcpiGbl_DbOpt_NoRegionSupport = FALSE; UINT8 AcpiGbl_UseHwReducedFadt = FALSE; BOOLEAN AcpiGbl_DoInterfaceTests = FALSE; BOOLEAN AcpiGbl_LoadTestTables = FALSE; +BOOLEAN AcpiGbl_AeLoadOnly = FALSE; static UINT8 AcpiGbl_ExecutionMode = AE_MODE_COMMAND_LOOP; static char BatchBuffer[AE_BUFFER_SIZE]; /* Batch command buffer */ static AE_TABLE_DESC *AeTableListHead = NULL; #define ACPIEXEC_NAME "AML Execution/Debug Utility" -#define AE_SUPPORTED_OPTIONS "?b:d:e:f^ghm^orv^:x:" +#define AE_SUPPORTED_OPTIONS "?b:d:e:f^ghi:lm^rv^:x:" /* Stubs for the disassembler */ @@ -158,8 +159,12 @@ usage ( ACPI_OPTION ("-et", "Enable debug semaphore timeout"); printf ("\n"); + ACPI_OPTION ("-fi <File>", "Specify namespace initialization file"); ACPI_OPTION ("-fv <Value>", "Operation Region initialization fill value"); - ACPI_OPTION ("-fi <file>", "Specify namespace initialization file"); + printf ("\n"); + + ACPI_OPTION ("-i <Count>", "Maximum iterations for AML while loops"); + ACPI_OPTION ("-l", "Load tables and namespace only"); ACPI_OPTION ("-r", "Use hardware-reduced FADT V5"); ACPI_OPTION ("-v", "Display version information"); ACPI_OPTION ("-vi", "Verbose initialization output"); @@ -189,6 +194,7 @@ AeDoOptions ( char **argv) { int j; + UINT32 Temp; while ((j = AcpiGetopt (argc, argv, AE_SUPPORTED_OPTIONS)) != ACPI_OPT_END) switch (j) @@ -332,6 +338,25 @@ AeDoOptions ( usage(); return (0); + case 'i': + + Temp = strtoul (AcpiGbl_Optarg, NULL, 0); + if (!Temp || (Temp > ACPI_UINT16_MAX)) + { + printf ("%s: Invalid max loops value\n", AcpiGbl_Optarg); + return (1); + } + + AcpiGbl_MaxLoopIterations = (UINT16) Temp; + printf ("Max Loop Iterations is %u (0x%X)\n", + AcpiGbl_MaxLoopIterations, AcpiGbl_MaxLoopIterations); + break; + + case 'l': + + AcpiGbl_AeLoadOnly = TRUE; + break; + case 'm': AcpiGbl_ExecutionMode = AE_MODE_BATCH_SINGLE; @@ -349,11 +374,6 @@ AeDoOptions ( } break; - case 'o': - - AcpiGbl_DbOpt_Disasm = TRUE; - break; - case 'r': AcpiGbl_UseHwReducedFadt = TRUE; @@ -444,6 +464,20 @@ main ( goto ErrorExit; } + /* ACPICA runtime configuration */ + + AcpiGbl_MaxLoopIterations = 400; + + + /* Initialize the AML debugger */ + + Status = AcpiInitializeDebugger (); + AE_CHECK_OK (AcpiInitializeDebugger, Status); + if (ACPI_FAILURE (Status)) + { + goto ErrorExit; + } + printf (ACPI_COMMON_SIGNON (ACPIEXEC_NAME)); if (argc < 2) { @@ -478,7 +512,7 @@ main ( Status = AcpiUtReadTableFromFile (argv[AcpiGbl_Optind], &Table); if (ACPI_FAILURE (Status)) { - printf ("**** Could not get table from file %s, %s\n", + fprintf (stderr, "**** Could not get table from file %s, %s\n", argv[AcpiGbl_Optind], AcpiFormatException (Status)); goto ErrorExit; } @@ -488,9 +522,9 @@ main ( if (!ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FADT) && !AcpiUtIsAmlTable (Table)) { - ACPI_INFO ((AE_INFO, - "Table [%4.4s] is not an AML table, ignoring", - Table->Signature)); + fprintf (stderr, " %s: [%4.4s] is not an AML table - ignoring\n", + argv[AcpiGbl_Optind], Table->Signature); + AcpiOsFree (Table); } else @@ -519,6 +553,17 @@ main ( } Status = AeInstallTables (); + + /* + * Exit namespace initialization for the "load namespace only" option. + * No control methods will be executed. However, still enter the + * the debugger. + */ + if (AcpiGbl_AeLoadOnly) + { + goto EnterDebugger; + } + if (ACPI_FAILURE (Status)) { printf ("**** Could not load ACPI tables, %s\n", @@ -602,6 +647,10 @@ EnterDebugger: case AE_MODE_BATCH_SINGLE: AcpiDbExecute (BatchBuffer, NULL, NULL, EX_NO_SINGLE_STEP); + + /* Shut down the debugger */ + + AcpiTerminateDebugger (); Status = AcpiTerminate (); break; } @@ -666,6 +715,9 @@ AcpiDbRunBatchMode ( } } + /* Shut down the debugger */ + + AcpiTerminateDebugger (); Status = AcpiTerminate (); return (Status); } diff --git a/source/tools/acpiexec/aetables.c b/source/tools/acpiexec/aetables.c index ebb6aeb0e8d6..75dea6127327 100644 --- a/source/tools/acpiexec/aetables.c +++ b/source/tools/acpiexec/aetables.c @@ -87,7 +87,6 @@ static ACPI_TABLE_XSDT *LocalXSDT; #define BASE_XSDT_SIZE ((BASE_XSDT_TABLES) * sizeof (UINT64)) #define ACPI_MAX_INIT_TABLES (32) -static ACPI_TABLE_DESC Tables[ACPI_MAX_INIT_TABLES]; /****************************************************************************** @@ -155,7 +154,13 @@ AeInitializeTableHeader ( strncpy (Header->OemId, "Intel", ACPI_OEM_ID_SIZE); strncpy (Header->OemTableId, "AcpiExec", ACPI_OEM_TABLE_ID_SIZE); strncpy (Header->AslCompilerId, "INTL", ACPI_NAME_SIZE); - Header->AslCompilerRevision = 0x20131218; + Header->AslCompilerRevision = ACPI_CA_VERSION; + + /* Set the checksum, must set to zero first */ + + Header->Checksum = 0; + Header->Checksum = (UINT8) -AcpiTbChecksum ( + (void *) Header, Header->Length); } @@ -216,8 +221,6 @@ AeBuildLocalTables ( } memset (LocalXSDT, 0, XsdtSize); - AeInitializeTableHeader ((void *) LocalXSDT, ACPI_SIG_XSDT, XsdtSize); - LocalXSDT->TableOffsetEntry[0] = ACPI_PTR_TO_PHYSADDR (&LocalFADT); NextIndex = 1; @@ -307,9 +310,7 @@ AeBuildLocalTables ( /* Set checksums for both XSDT and RSDP */ - LocalXSDT->Header.Checksum = 0; - LocalXSDT->Header.Checksum = (UINT8) -AcpiTbChecksum ( - (void *) LocalXSDT, LocalXSDT->Header.Length); + AeInitializeTableHeader ((void *) LocalXSDT, ACPI_SIG_XSDT, XsdtSize); LocalRSDP.Checksum = 0; LocalRSDP.Checksum = (UINT8) -AcpiTbChecksum ( @@ -334,8 +335,8 @@ AeBuildLocalTables ( if (ExternalFadt) { /* - * Use the external FADT, but we must update the DSDT/FACS addresses - * as well as the checksum + * Use the external FADT, but we must update the DSDT/FACS + * addresses as well as the checksum */ ExternalFadt->Dsdt = (UINT32) DsdtAddress; if (!AcpiGbl_ReducedHardware) @@ -343,19 +344,24 @@ AeBuildLocalTables ( ExternalFadt->Facs = ACPI_PTR_TO_PHYSADDR (&LocalFACS); } - /* Is there room in the FADT for the XDsdst and XFacs 64-bit pointers? */ - - if (ExternalFadt->Header.Length > ACPI_PTR_DIFF (&ExternalFadt->XDsdt, ExternalFadt)) + /* + * 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->XDsdt = DsdtAddress; + ExternalFadt->Dsdt = 0; + ExternalFadt->Facs = 0; + ExternalFadt->XDsdt = DsdtAddress; if (!AcpiGbl_ReducedHardware) { ExternalFadt->XFacs = ACPI_PTR_TO_PHYSADDR (&LocalFACS); } } - /* Complete the FADT with the checksum */ + /* Complete the external FADT with the checksum */ ExternalFadt->Header.Checksum = 0; ExternalFadt->Header.Checksum = (UINT8) -AcpiTbChecksum ( @@ -364,12 +370,8 @@ AeBuildLocalTables ( else if (AcpiGbl_UseHwReducedFadt) { memcpy (&LocalFADT, HwReducedFadtCode, ACPI_FADT_V5_SIZE); - LocalFADT.Dsdt = (UINT32) DsdtAddress; + LocalFADT.Dsdt = 0; LocalFADT.XDsdt = DsdtAddress; - - LocalFADT.Header.Checksum = 0; - LocalFADT.Header.Checksum = (UINT8) -AcpiTbChecksum ( - (void *) &LocalFADT, LocalFADT.Header.Length); } else { @@ -377,7 +379,6 @@ AeBuildLocalTables ( * Build a local FADT so we can test the hardware/event init */ LocalFADT.Header.Revision = 5; - AeInitializeTableHeader ((void *) &LocalFADT, ACPI_SIG_FADT, sizeof (ACPI_TABLE_FADT)); /* Setup FADT header and DSDT/FACS addresses */ @@ -413,15 +414,13 @@ AeBuildLocalTables ( LocalFADT.XPm1bEventBlock.SpaceId = ACPI_ADR_SPACE_SYSTEM_IO; LocalFADT.XPm1bEventBlock.Address = LocalFADT.Pm1bEventBlock; - LocalFADT.XPm1bEventBlock.BitWidth = (UINT8) ACPI_MUL_8 (LocalFADT.Pm1EventLength); - - /* Complete the FADT with the checksum */ - - LocalFADT.Header.Checksum = 0; - LocalFADT.Header.Checksum = (UINT8) -AcpiTbChecksum ( - (void *) &LocalFADT, LocalFADT.Header.Length); + LocalFADT.XPm1bEventBlock.BitWidth = (UINT8) + ACPI_MUL_8 (LocalFADT.Pm1EventLength); } + AeInitializeTableHeader ((void *) &LocalFADT, + ACPI_SIG_FADT, sizeof (ACPI_TABLE_FADT)); + /* Build a FACS */ memset (&LocalFACS, 0, sizeof (ACPI_TABLE_FACS)); @@ -443,6 +442,8 @@ AeBuildLocalTables ( LocalTEST.Revision = 1; LocalTEST.Length = sizeof (ACPI_TABLE_HEADER); + + LocalTEST.Checksum = 0; LocalTEST.Checksum = (UINT8) -AcpiTbChecksum ( (void *) &LocalTEST, LocalTEST.Length); @@ -455,6 +456,8 @@ AeBuildLocalTables ( LocalBADTABLE.Revision = 1; LocalBADTABLE.Length = sizeof (ACPI_TABLE_HEADER); + + LocalBADTABLE.Checksum = 0; LocalBADTABLE.Checksum = (UINT8) -AcpiTbChecksum ( (void *) &LocalBADTABLE, LocalBADTABLE.Length); } @@ -482,14 +485,12 @@ AeInstallTables ( ACPI_STATUS Status; ACPI_TABLE_HEADER Header; ACPI_TABLE_HEADER *Table; + UINT32 i; - Status = AcpiInitializeTables (Tables, ACPI_MAX_INIT_TABLES, TRUE); + Status = AcpiInitializeTables (NULL, ACPI_MAX_INIT_TABLES, TRUE); AE_CHECK_OK (AcpiInitializeTables, Status); - Status = AcpiReallocateRootTable (); - AE_CHECK_OK (AcpiReallocateRootTable, Status); - Status = AcpiLoadTables (); AE_CHECK_OK (AcpiLoadTables, Status); @@ -536,6 +537,18 @@ AeInstallTables ( AE_CHECK_STATUS (AcpiGetTable, Status, AE_NOT_FOUND); } + /* Check that we can get all of the ACPI tables */ + + for (i = 0; ; i++) + { + Status = AcpiGetTableByIndex (i, &Table); + if ((Status == AE_BAD_PARAMETER) || !Table) + { + break; + } + AE_CHECK_OK (AcpiGetTableByIndex, Status); + } + return (AE_OK); } diff --git a/source/tools/acpihelp/ahdecode.c b/source/tools/acpihelp/ahdecode.c index 7e6d7c8b7427..8684c6a1c042 100644 --- a/source/tools/acpihelp/ahdecode.c +++ b/source/tools/acpihelp/ahdecode.c @@ -170,7 +170,7 @@ AhFindPredefinedNames ( strncpy (&Name[1], NamePrefix, 7); Length = strlen (Name); - if (Length > 4) + if (Length > ACPI_NAME_SIZE) { printf ("%.8s: Predefined name must be 4 characters maximum\n", Name); return; diff --git a/source/tools/acpinames/acpinames.h b/source/tools/acpinames/acpinames.h index c38b2a004fce..62d006974f92 100644 --- a/source/tools/acpinames/acpinames.h +++ b/source/tools/acpinames/acpinames.h @@ -47,10 +47,12 @@ #include "acpi.h" #include "accommon.h" #include "acapps.h" +#include "acutils.h" #include "../acpiexec/aecommon.h" #include <stdio.h> #define ACPI_MAX_INIT_TABLES (32) +extern BOOLEAN AcpiGbl_NsLoadOnly; #endif diff --git a/source/tools/acpinames/anmain.c b/source/tools/acpinames/anmain.c index 0ebfdf6dbc18..a613ac2613c3 100644 --- a/source/tools/acpinames/anmain.c +++ b/source/tools/acpinames/anmain.c @@ -42,18 +42,35 @@ */ #include "acpinames.h" +#include "actables.h" #define _COMPONENT ACPI_TOOLS ACPI_MODULE_NAME ("anmain") -extern ACPI_TABLE_DESC Tables[]; +/* Local prototypes */ +static int +NsDumpEntireNamespace ( + UINT32 TableCount); + +/* + * 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. + */ static AE_TABLE_DESC *AeTableListHead = NULL; +BOOLEAN AcpiGbl_NsLoadOnly = FALSE; #define AN_UTILITY_NAME "ACPI Namespace Dump Utility" -#define AN_SUPPORTED_OPTIONS "?hv" +#define AN_SUPPORTED_OPTIONS "?hlvx:" /****************************************************************************** @@ -75,7 +92,9 @@ usage ( 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 ("-x <DebugLevel>", "Debug output level"); } @@ -94,45 +113,12 @@ usage ( static int NsDumpEntireNamespace ( - char *AmlFilename) + UINT32 TableCount) { ACPI_STATUS Status; - ACPI_TABLE_HEADER *Table = NULL; - UINT32 TableCount = 0; - AE_TABLE_DESC *TableDesc; ACPI_HANDLE Handle; - /* Open the binary AML file and read the entire table */ - - Status = AcpiUtReadTableFromFile (AmlFilename, &Table); - if (ACPI_FAILURE (Status)) - { - printf ("**** Could not get input table %s, %s\n", AmlFilename, - AcpiFormatException (Status)); - return (-1); - } - - /* Table must be a DSDT. SSDTs are not currently supported */ - - if (!ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT)) - { - printf ("**** Input table signature is [%4.4s], must be [DSDT]\n", - Table->Signature); - return (-1); - } - - /* - * Allocate and link a table descriptor (allows for future expansion to - * multiple input files) - */ - TableDesc = AcpiOsAllocate (sizeof (AE_TABLE_DESC)); - TableDesc->Table = Table; - TableDesc->Next = AeTableListHead; - AeTableListHead = TableDesc; - - TableCount++; - /* * Build a local XSDT with all tables. Normally, here is where the * RSDP search is performed to find the ACPI tables @@ -145,7 +131,7 @@ NsDumpEntireNamespace ( /* Initialize table manager, get XSDT */ - Status = AcpiInitializeTables (Tables, ACPI_MAX_INIT_TABLES, TRUE); + Status = AcpiInitializeTables (NULL, ACPI_MAX_INIT_TABLES, TRUE); if (ACPI_FAILURE (Status)) { printf ("**** Could not initialize ACPI table manager, %s\n", @@ -153,26 +139,29 @@ NsDumpEntireNamespace ( return (-1); } - /* Reallocate root table to dynamic memory */ + /* Load the ACPI namespace */ - Status = AcpiReallocateRootTable (); - if (ACPI_FAILURE (Status)) + Status = AcpiTbLoadNamespace (); + if (Status == AE_CTRL_TERMINATE) { - printf ("**** Could not reallocate root table, %s\n", - AcpiFormatException (Status)); + /* At least one table load failed -- terminate with error */ + return (-1); } - /* Load the ACPI namespace */ - - Status = AcpiLoadTables (); if (ACPI_FAILURE (Status)) { - printf ("**** Could not load ACPI tables, %s\n", + printf ("**** While creating namespace, %s\n", AcpiFormatException (Status)); return (-1); } + if (AcpiGbl_NsLoadOnly) + { + printf ("**** Namespace successfully loaded\n"); + return (0); + } + /* * Enable ACPICA. These calls don't do much for this * utility, since we only dump the namespace. There is no @@ -236,7 +225,10 @@ main ( int argc, char **argv) { + AE_TABLE_DESC *TableDesc; + ACPI_TABLE_HEADER *Table = NULL; ACPI_STATUS Status; + UINT32 TableCount; int j; @@ -244,7 +236,7 @@ main ( /* Init debug globals and ACPICA */ - AcpiDbgLevel = ACPI_LV_TABLES; + AcpiDbgLevel = ACPI_NORMAL_DEFAULT | ACPI_LV_TABLES; AcpiDbgLayer = 0xFFFFFFFF; Status = AcpiInitializeSubsystem (); @@ -265,10 +257,21 @@ main ( while ((j = AcpiGetopt (argc, argv, AN_SUPPORTED_OPTIONS)) != ACPI_OPT_END) switch(j) { + case 'l': + + AcpiGbl_NsLoadOnly = TRUE; + break; + case 'v': /* -v: (Version): signon already emitted, just exit */ return (0); + case 'x': + + AcpiDbgLevel = strtoul (AcpiGbl_Optarg, NULL, 0); + printf ("Debug Level: 0x%8.8X\n", AcpiDbgLevel); + break; + case '?': case 'h': default: @@ -277,9 +280,52 @@ main ( return (0); } + TableCount = 0; + + /* Get each of the ACPI table files on the command line */ + + while (argv[AcpiGbl_Optind]) + { + /* Get one entire table */ + + Status = AcpiUtReadTableFromFile (argv[AcpiGbl_Optind], &Table); + if (ACPI_FAILURE (Status)) + { + fprintf (stderr, "**** Could not get table from file %s, %s\n", + argv[AcpiGbl_Optind], AcpiFormatException (Status)); + return (-1); + } + + /* Ignore non-AML tables, we can't use them. Except for an FADT */ + + if (!ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FADT) && + !AcpiUtIsAmlTable (Table)) + { + fprintf (stderr, " %s: [%4.4s] is not an AML table - ignoring\n", + argv[AcpiGbl_Optind], Table->Signature); + + AcpiOsFree (Table); + } + else + { + /* Allocate and link a table descriptor */ + + TableDesc = AcpiOsAllocate (sizeof (AE_TABLE_DESC)); + TableDesc->Table = Table; + TableDesc->Next = AeTableListHead; + AeTableListHead = TableDesc; + + TableCount++; + } + + AcpiGbl_Optind++; + } + + printf ("\n"); + /* * The next argument is the filename for the DSDT or SSDT. * Open the file, build namespace and dump it. */ - return (NsDumpEntireNamespace (argv[AcpiGbl_Optind])); + return (NsDumpEntireNamespace (TableCount)); } diff --git a/source/tools/acpinames/anstubs.c b/source/tools/acpinames/anstubs.c index f8b1d2d6ae82..ed165a9f68d4 100644 --- a/source/tools/acpinames/anstubs.c +++ b/source/tools/acpinames/anstubs.c @@ -85,6 +85,14 @@ AcpiUtCopyIobjectToIobject ( return (AE_NOT_IMPLEMENTED); } +/* Hardware */ + +UINT32 +AcpiHwGetMode ( + void) +{ + return (0); +} /* Event manager */ @@ -110,6 +118,20 @@ AcpiEvInitializeRegion ( return (AE_OK); } +ACPI_STATUS +AcpiEvInstallXruptHandlers ( + void) +{ + return (AE_OK); +} + +ACPI_STATUS +AcpiEvInitializeEvents ( + void) +{ + return (AE_OK); +} + /* AML Interpreter */ @@ -132,13 +154,6 @@ AcpiExWriteDataToField ( } ACPI_STATUS -AcpiExPrepFieldValue ( - ACPI_CREATE_FIELD_INFO *Info) -{ - return (AE_OK); -} - -ACPI_STATUS AcpiExStoreObjectToNode ( ACPI_OPERAND_OBJECT *SourceDesc, ACPI_NAMESPACE_NODE *Node, @@ -222,9 +237,16 @@ AcpiExTracePoint ( /* Dispatcher */ ACPI_STATUS -AcpiDsInitializeObjects ( - UINT32 TableIndex, - ACPI_NAMESPACE_NODE *StartNode) +AcpiDsAutoSerializeMethod ( + ACPI_NAMESPACE_NODE *Node, + ACPI_OPERAND_OBJECT *ObjDesc) +{ + return (AE_OK); +} + +ACPI_STATUS +AcpiDsInitializeRegion ( + ACPI_HANDLE ObjHandle) { return (AE_OK); } diff --git a/source/tools/acpinames/antables.c b/source/tools/acpinames/antables.c index 9646ba4974f7..1dbf692992cf 100644 --- a/source/tools/acpinames/antables.c +++ b/source/tools/acpinames/antables.c @@ -48,6 +48,13 @@ /* Local prototypes */ +static void +AeInitializeTableHeader ( + ACPI_TABLE_HEADER *Header, + char *Signature, + UINT32 Length); + + /* Non-AML tables that are constructed locally and installed */ static ACPI_TABLE_RSDP LocalRSDP; @@ -69,7 +76,43 @@ static ACPI_TABLE_XSDT *LocalXSDT; #define BASE_XSDT_SIZE (sizeof (ACPI_TABLE_XSDT) + \ ((BASE_XSDT_TABLES -1) * sizeof (UINT64))) -ACPI_TABLE_DESC Tables[ACPI_MAX_INIT_TABLES]; + +/****************************************************************************** + * + * FUNCTION: AeInitializeTableHeader + * + * 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 +AeInitializeTableHeader ( + ACPI_TABLE_HEADER *Header, + char *Signature, + UINT32 Length) +{ + + ACPI_MOVE_NAME (Header->Signature, Signature); + Header->Length = Length; + + Header->OemRevision = 0x1001; + strncpy (Header->OemId, "Intel", ACPI_OEM_ID_SIZE); + strncpy (Header->OemTableId, "AcpiName", ACPI_OEM_TABLE_ID_SIZE); + strncpy (Header->AslCompilerId, "INTL", ACPI_NAME_SIZE); + Header->AslCompilerRevision = ACPI_CA_VERSION; + + /* Set the checksum, must set to zero first */ + + Header->Checksum = 0; + Header->Checksum = (UINT8) -AcpiTbChecksum ( + (void *) Header, Header->Length); +} /****************************************************************************** @@ -99,9 +142,9 @@ AeBuildLocalTables ( /* - * Update the table count. For DSDT, it is not put into the XSDT. For - * FADT, this is already accounted for since we usually install a - * local FADT. + * 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) @@ -125,15 +168,14 @@ AeBuildLocalTables ( } memset (LocalXSDT, 0, XsdtSize); - ACPI_MOVE_NAME (LocalXSDT->Header.Signature, ACPI_SIG_XSDT); - LocalXSDT->Header.Length = XsdtSize; - LocalXSDT->Header.Revision = 1; - 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; @@ -158,32 +200,35 @@ AeBuildLocalTables ( else if (ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_FADT)) { ExternalFadt = ACPI_CAST_PTR (ACPI_TABLE_FADT, NextTable->Table); - LocalXSDT->TableOffsetEntry[2] = ACPI_PTR_TO_PHYSADDR (NextTable->Table); + LocalXSDT->TableOffsetEntry[0] = ACPI_PTR_TO_PHYSADDR (NextTable->Table); } else { /* Install the table in the XSDT */ - LocalXSDT->TableOffsetEntry[NextIndex] = ACPI_PTR_TO_PHYSADDR (NextTable->Table); + LocalXSDT->TableOffsetEntry[TableCount - NextIndex + 1] = + ACPI_PTR_TO_PHYSADDR (NextTable->Table); NextIndex++; } NextTable = NextTable->Next; } - /* Build an RSDP */ + /* 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, "I_TEST", 6); + 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 */ - LocalXSDT->Header.Checksum = (UINT8) -AcpiTbChecksum ( - (void *) LocalXSDT, LocalXSDT->Header.Length); + AeInitializeTableHeader ((void *) LocalXSDT, ACPI_SIG_XSDT, XsdtSize); + + LocalRSDP.Checksum = 0; LocalRSDP.Checksum = (UINT8) -AcpiTbChecksum ( (void *) &LocalRSDP, ACPI_RSDP_CHECKSUM_LENGTH); @@ -192,21 +237,36 @@ AeBuildLocalTables ( 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 + * 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 (ExternalFadt->Header.Length > ACPI_PTR_DIFF (&ExternalFadt->XDsdt, ExternalFadt)) + /* + * 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 FADT with the checksum */ + + /* Complete the external FADT with the checksum */ ExternalFadt->Header.Checksum = 0; ExternalFadt->Header.Checksum = (UINT8) -AcpiTbChecksum ( @@ -217,8 +277,7 @@ AeBuildLocalTables ( /* * Build a local FADT so we can test the hardware/event init */ - memset (&LocalFADT, 0, sizeof (ACPI_TABLE_FADT)); - ACPI_MOVE_NAME (LocalFADT.Header.Signature, ACPI_SIG_FADT); + LocalFADT.Header.Revision = 5; /* Setup FADT header and DSDT/FACS addresses */ @@ -228,9 +287,6 @@ AeBuildLocalTables ( LocalFADT.XDsdt = DsdtAddress; LocalFADT.XFacs = ACPI_PTR_TO_PHYSADDR (&LocalFACS); - LocalFADT.Header.Revision = 3; - LocalFADT.Header.Length = sizeof (ACPI_TABLE_FADT); - /* Miscellaneous FADT fields */ LocalFADT.Gpe0BlockLength = 16; @@ -257,15 +313,13 @@ AeBuildLocalTables ( LocalFADT.XPm1bEventBlock.SpaceId = ACPI_ADR_SPACE_SYSTEM_IO; LocalFADT.XPm1bEventBlock.Address = LocalFADT.Pm1bEventBlock; - LocalFADT.XPm1bEventBlock.BitWidth = (UINT8) ACPI_MUL_8 (LocalFADT.Pm1EventLength); - - /* Complete the FADT with the checksum */ - - LocalFADT.Header.Checksum = 0; - LocalFADT.Header.Checksum = (UINT8) -AcpiTbChecksum ( - (void *) &LocalFADT, LocalFADT.Header.Length); + LocalFADT.XPm1bEventBlock.BitWidth = (UINT8) + ACPI_MUL_8 (LocalFADT.Pm1EventLength); } + AeInitializeTableHeader ((void *) &LocalFADT, + ACPI_SIG_FADT, sizeof (ACPI_TABLE_FADT)); + /* Build a FACS */ memset (&LocalFACS, 0, sizeof (ACPI_TABLE_FACS)); @@ -273,7 +327,6 @@ AeBuildLocalTables ( LocalFACS.Length = sizeof (ACPI_TABLE_FACS); LocalFACS.GlobalLock = 0x11AA0011; - return (AE_OK); } diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c index 6cc27131dda3..8781c80e2595 100644 --- a/source/tools/acpisrc/astable.c +++ b/source/tools/acpisrc/astable.c @@ -296,6 +296,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_OBJECT_HANDLER", SRC_TYPE_SIMPLE}, {"ACPI_OBJECT_INDEX_FIELD", SRC_TYPE_STRUCT}, {"ACPI_OBJECT_INTEGER", SRC_TYPE_STRUCT}, + {"ACPI_OBJECT_INFO", SRC_TYPE_STRUCT}, {"ACPI_OBJECT_LIST", SRC_TYPE_STRUCT}, {"ACPI_OBJECT_METHOD", SRC_TYPE_STRUCT}, {"ACPI_OBJECT_MUTEX", SRC_TYPE_STRUCT}, @@ -351,6 +352,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_RASF_SHARED_MEMORY", SRC_TYPE_STRUCT}, {"ACPI_REPAIR_FUNCTION", SRC_TYPE_SIMPLE}, {"ACPI_REPAIR_INFO", SRC_TYPE_STRUCT}, + {"ACPI_REG_WALK_INFO", SRC_TYPE_STRUCT}, {"ACPI_RESOURCE", SRC_TYPE_STRUCT}, {"ACPI_RESOURCE_HANDLER", SRC_TYPE_SIMPLE}, {"ACPI_RESOURCE_ADDRESS", SRC_TYPE_STRUCT}, |