diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2014-01-15 00:10:20 +0000 | 
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2014-01-15 00:10:20 +0000 | 
| commit | 39f274c358ed4902e03f3785abb7d32d5ed2bfec (patch) | |
| tree | 454f2ab26ed17be123260e9052adc018fef302dc /source/tools | |
| parent | 86e94f4ac956e0aed23de30c7a458d215f54749a (diff) | |
Diffstat (limited to 'source/tools')
37 files changed, 558 insertions, 203 deletions
| diff --git a/source/tools/acpibin/abcompare.c b/source/tools/acpibin/abcompare.c index dc21a4eaa83c..6bf5f9638cd8 100644 --- a/source/tools/acpibin/abcompare.c +++ b/source/tools/acpibin/abcompare.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpibin/abmain.c b/source/tools/acpibin/abmain.c index a4ca919bd7c2..6eb6eb195d2d 100644 --- a/source/tools/acpibin/abmain.c +++ b/source/tools/acpibin/abmain.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpibin/acpibin.h b/source/tools/acpibin/acpibin.h index ed1ec2f4583f..515f155fea91 100644 --- a/source/tools/acpibin/acpibin.h +++ b/source/tools/acpibin/acpibin.h @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpidump/acpidump.h b/source/tools/acpidump/acpidump.h index 203108fc3f6f..e3b705bdce50 100644 --- a/source/tools/acpidump/acpidump.h +++ b/source/tools/acpidump/acpidump.h @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -90,10 +90,6 @@ typedef struct ap_dump_action  } AP_DUMP_ACTION; -/* Local RSDP signature (Not the same as the actual signature which is "RSD PTR ") */ - -#define AP_DUMP_SIG_RSDP            "RSDP" -  #define AP_MAX_ACTIONS              32  #define AP_DUMP_ALL_TABLES          0 diff --git a/source/tools/acpidump/apdump.c b/source/tools/acpidump/apdump.c index d216cf5e45e5..d11919b7db61 100644 --- a/source/tools/acpidump/apdump.c +++ b/source/tools/acpidump/apdump.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -385,11 +385,7 @@ ApDumpTableByName (      /* To be friendly, handle tables whose signatures do not match the name */ -    if (ACPI_COMPARE_NAME (LocalSignature, AP_DUMP_SIG_RSDP)) -    { -        strcpy (LocalSignature, AP_DUMP_SIG_RSDP); -    } -    else if (ACPI_COMPARE_NAME (LocalSignature, "FADT")) +    if (ACPI_COMPARE_NAME (LocalSignature, "FADT"))      {          strcpy (LocalSignature, ACPI_SIG_FADT);      } diff --git a/source/tools/acpidump/apfiles.c b/source/tools/acpidump/apfiles.c index 5c4b0dce4dc5..e719f54f17f4 100644 --- a/source/tools/acpidump/apfiles.c +++ b/source/tools/acpidump/apfiles.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -129,7 +129,7 @@ ApWriteToBinaryFile (      if (ACPI_VALIDATE_RSDP_SIG (Table->Signature))      { -        ACPI_MOVE_NAME (Filename, AP_DUMP_SIG_RSDP); +        ACPI_MOVE_NAME (Filename, ACPI_RSDP_NAME);      }      else      { diff --git a/source/tools/acpidump/apmain.c b/source/tools/acpidump/apmain.c index b9e62eb17e8f..38c6d925666a 100644 --- a/source/tools/acpidump/apmain.c +++ b/source/tools/acpidump/apmain.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpiexec/aecommon.h b/source/tools/acpiexec/aecommon.h index b2148680facb..c27338d3d5a0 100644 --- a/source/tools/acpiexec/aecommon.h +++ b/source/tools/acpiexec/aecommon.h @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -68,6 +68,7 @@ extern UINT8                AcpiGbl_RegionFillValue;  extern UINT8                AcpiGbl_UseHwReducedFadt;  extern BOOLEAN              AcpiGbl_DisplayRegionAccess;  extern BOOLEAN              AcpiGbl_DoInterfaceTests; +extern BOOLEAN              AcpiGbl_LoadTestTables;  /* Check for unexpected exceptions */ diff --git a/source/tools/acpiexec/aeexec.c b/source/tools/acpiexec/aeexec.c index 8f6d6da48554..e76e7b9b0127 100644 --- a/source/tools/acpiexec/aeexec.c +++ b/source/tools/acpiexec/aeexec.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -150,13 +150,15 @@ AfInstallGpeBlock (  {      ACPI_STATUS                 Status;      ACPI_HANDLE                 Handle; -    ACPI_HANDLE                 Handle2 = NULL; -    ACPI_HANDLE                 Handle3 = NULL;      ACPI_GENERIC_ADDRESS        BlockAddress;      ACPI_HANDLE                 GpeDevice; +    ACPI_OBJECT_TYPE            Type; +    /* _GPE should always exist */ +      Status = AcpiGetHandle (NULL, "\\_GPE", &Handle); +    AE_CHECK_OK (AcpiGetHandle, Status);      if (ACPI_FAILURE (Status))      {          return; @@ -166,17 +168,26 @@ AfInstallGpeBlock (      BlockAddress.SpaceId = ACPI_ADR_SPACE_SYSTEM_MEMORY;      BlockAddress.Address = 0x76540000; -    Status = AcpiGetHandle (NULL, "\\GPE2", &Handle2); +    /* Attempt to install a GPE block on GPE2 (if present) */ + +    Status = AcpiGetHandle (NULL, "\\GPE2", &Handle);      if (ACPI_SUCCESS (Status))      { -        Status = AcpiInstallGpeBlock (Handle2, &BlockAddress, 7, 8); +        Status = AcpiGetType (Handle, &Type); +        if (ACPI_FAILURE (Status) || +           (Type != ACPI_TYPE_DEVICE)) +        { +            return; +        } + +        Status = AcpiInstallGpeBlock (Handle, &BlockAddress, 7, 8);          AE_CHECK_OK (AcpiInstallGpeBlock, Status); -        Status = AcpiInstallGpeHandler (Handle2, 8, +        Status = AcpiInstallGpeHandler (Handle, 8,              ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);          AE_CHECK_OK (AcpiInstallGpeHandler, Status); -        Status = AcpiEnableGpe (Handle2, 8); +        Status = AcpiEnableGpe (Handle, 8);          AE_CHECK_OK (AcpiEnableGpe, Status);          Status = AcpiGetGpeDevice (0x30, &GpeDevice); @@ -191,14 +202,23 @@ AfInstallGpeBlock (          Status = AcpiGetGpeDevice (AcpiCurrentGpeCount, &GpeDevice);          AE_CHECK_STATUS (AcpiGetGpeDevice, Status, AE_NOT_EXIST); -        Status = AcpiRemoveGpeHandler (Handle2, 8, AeGpeHandler); +        Status = AcpiRemoveGpeHandler (Handle, 8, AeGpeHandler);          AE_CHECK_OK (AcpiRemoveGpeHandler, Status);      } -    Status = AcpiGetHandle (NULL, "\\GPE3", &Handle3); +    /* Attempt to install a GPE block on GPE3 (if present) */ + +    Status = AcpiGetHandle (NULL, "\\GPE3", &Handle);      if (ACPI_SUCCESS (Status))      { -        Status = AcpiInstallGpeBlock (Handle3, &BlockAddress, 8, 11); +        Status = AcpiGetType (Handle, &Type); +        if (ACPI_FAILURE (Status) || +           (Type != ACPI_TYPE_DEVICE)) +        { +            return; +        } + +        Status = AcpiInstallGpeBlock (Handle, &BlockAddress, 8, 11);          AE_CHECK_OK (AcpiInstallGpeBlock, Status);      }  } diff --git a/source/tools/acpiexec/aehandlers.c b/source/tools/acpiexec/aehandlers.c index aa6540d0c33f..b89a431abf45 100644 --- a/source/tools/acpiexec/aehandlers.c +++ b/source/tools/acpiexec/aehandlers.c @@ -4,42 +4,114 @@   *   *****************************************************************************/ -/* - * Copyright (C) 2000 - 2013, Intel Corp. +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, 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. - */ + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/  #include "aecommon.h" @@ -149,18 +221,22 @@ static AE_DEBUG_REGIONS     AeRegions;  BOOLEAN                     AcpiGbl_DisplayRegionAccess = FALSE;  /* - * We will override some of the default region handlers, especially the - * SystemMemory handler, which must be implemented locally. Do not override - * the PCI_Config handler since we would like to exercise the default handler - * code. These handlers are installed "early" - before any _REG methods + * We will override some of the default region handlers, especially + * the SystemMemory handler, which must be implemented locally. + * These handlers are installed "early" - before any _REG methods   * are executed - since they are special in the sense that the ACPI spec   * declares that they must "always be available". Cannot override the   * DataTable region handler either -- needed for test execution. + * + * NOTE: The local region handler will simulate access to these address + * spaces by creating a memory buffer behind each operation region.   */  static ACPI_ADR_SPACE_TYPE  DefaultSpaceIdList[] =  {      ACPI_ADR_SPACE_SYSTEM_MEMORY, -    ACPI_ADR_SPACE_SYSTEM_IO +    ACPI_ADR_SPACE_SYSTEM_IO, +    ACPI_ADR_SPACE_PCI_CONFIG, +    ACPI_ADR_SPACE_EC  };  /* @@ -1152,13 +1228,20 @@ AeRegionHandler (      ACPI_OPERAND_OBJECT     *RegionObject = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, RegionContext);      UINT8                   *Buffer = ACPI_CAST_PTR (UINT8, Value); +    UINT8                   *OldBuffer; +    UINT8                   *NewBuffer;      ACPI_PHYSICAL_ADDRESS   BaseAddress; +    ACPI_PHYSICAL_ADDRESS   BaseAddressEnd; +    ACPI_PHYSICAL_ADDRESS   RegionAddress; +    ACPI_PHYSICAL_ADDRESS   RegionAddressEnd;      ACPI_SIZE               Length;      BOOLEAN                 BufferExists; +    BOOLEAN                 BufferResize;      AE_REGION               *RegionElement;      void                    *BufferValue;      ACPI_STATUS             Status;      UINT32                  ByteWidth; +    UINT32                  RegionLength;      UINT32                  i;      UINT8                   SpaceId;      ACPI_CONNECTION_INFO    *MyContext; @@ -1441,21 +1524,119 @@ AeRegionHandler (       * Search through the linked list for this region's buffer       */      BufferExists = FALSE; +    BufferResize = FALSE;      RegionElement = AeRegions.RegionList;      if (AeRegions.NumberOfRegions)      { +        BaseAddressEnd = BaseAddress + Length - 1;          while (!BufferExists && RegionElement)          { -            if (RegionElement->Address == BaseAddress && -                RegionElement->Length == Length && -                RegionElement->SpaceId == SpaceId) +            RegionAddress = RegionElement->Address; +            RegionAddressEnd = RegionElement->Address + RegionElement->Length - 1; +            RegionLength = RegionElement->Length; + +            /* +             * Overlapping Region Support +             * +             * While searching through the region buffer list, determine if an +             * overlap exists between the requested buffer space and the current +             * RegionElement space. If there is an overlap then replace the old +             * buffer with a new buffer of increased size before continuing to +             * do the read or write +             */ +            if (RegionElement->SpaceId != SpaceId || +                BaseAddressEnd < RegionAddress || +                BaseAddress > RegionAddressEnd)              { -                BufferExists = TRUE; +                /* +                 * Requested buffer is outside of the current RegionElement +                 * bounds +                 */ +                RegionElement = RegionElement->NextRegion;              }              else              { -                RegionElement = RegionElement->NextRegion; +                /* +                 * Some amount of buffer space sharing exists. There are 4 cases +                 * to consider: +                 * +                 * 1. Right overlap +                 * 2. Left overlap +                 * 3. Left and right overlap +                 * 4. Fully contained - no resizing required +                 */ +                BufferExists = TRUE; + +                if ((BaseAddress >= RegionAddress) && +                    (BaseAddress <= RegionAddressEnd) && +                    (BaseAddressEnd > RegionAddressEnd)) +                { +                    /* Right overlap */ + +                    RegionElement->Length = BaseAddress - +                        RegionAddress + Length; +                    BufferResize = TRUE; +                } + +                 else if ((BaseAddressEnd >= RegionAddress) && +                         (BaseAddressEnd <= RegionAddressEnd) && +                         (BaseAddress < RegionAddress)) +                { +                    /* Left overlap */ + +                    RegionElement->Address = BaseAddress; +                    RegionElement->Length = RegionAddress - +                        BaseAddress + RegionElement->Length; +                    BufferResize = TRUE; +                } + +                else if ((BaseAddress < RegionAddress) && +                         (BaseAddressEnd > RegionAddressEnd)) +                { +                    /* Left and right overlap */ + +                    RegionElement->Address = BaseAddress; +                    RegionElement->Length = Length; +                    BufferResize = TRUE; +                } + +                /* +                 * only remaining case is fully contained for which we don't +                 * need to do anything +                 */ +                if (BufferResize) +                { +                    NewBuffer = AcpiOsAllocate (RegionElement->Length); +                    if (!NewBuffer) +                    { +                        return (AE_NO_MEMORY); +                    } + +                    OldBuffer = RegionElement->Buffer; +                    RegionElement->Buffer = NewBuffer; +                    NewBuffer = NULL; + +                    /* Initialize the region with the default fill value */ + +                    ACPI_MEMSET (RegionElement->Buffer, +                        AcpiGbl_RegionFillValue, RegionElement->Length); + +                    /* +                     * Get BufferValue to point (within the new buffer) to the +                     * base address of the old buffer +                     */ +                    BufferValue = (UINT8 *) RegionElement->Buffer + +                        (UINT64) RegionAddress - +                        (UINT64) RegionElement->Address; + +                    /* +                     * Copy the old buffer to its same location within the new +                     * buffer +                     */ +                    ACPI_MEMCPY (BufferValue, OldBuffer, RegionLength); +                    AcpiOsFree (OldBuffer); +                }              }          }      } @@ -1465,9 +1646,8 @@ AeRegionHandler (       */      if (!BufferExists)      { -        /* -         * Do the memory allocations first -         */ +        /* Do the memory allocations first */ +          RegionElement = AcpiOsAllocate (sizeof (AE_REGION));          if (!RegionElement)          { @@ -1492,8 +1672,8 @@ AeRegionHandler (          /*           * Increment the number of regions and put this one -         *  at the head of the list as it will probably get accessed -         *  more often anyway. +         * at the head of the list as it will probably get accessed +         * more often anyway.           */          AeRegions.NumberOfRegions += 1; @@ -1505,9 +1685,8 @@ AeRegionHandler (          AeRegions.RegionList = RegionElement;      } -    /* -     * Calculate the size of the memory copy -     */ +    /* Calculate the size of the memory copy */ +      ByteWidth = (BitWidth / 8);      if (BitWidth % 8) diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c index 3562ff9141ae..165e512d7b4c 100644 --- a/source/tools/acpiexec/aemain.c +++ b/source/tools/acpiexec/aemain.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -58,7 +58,6 @@   * Windows: The setargv.obj module must be linked in to automatically   * expand wildcards.   */ -  extern BOOLEAN              AcpiGbl_DebugTimeout;  /* Local prototypes */ @@ -90,6 +89,7 @@ BOOLEAN                     AcpiGbl_IgnoreErrors = FALSE;  BOOLEAN                     AcpiGbl_DbOpt_NoRegionSupport = FALSE;  UINT8                       AcpiGbl_UseHwReducedFadt = FALSE;  BOOLEAN                     AcpiGbl_DoInterfaceTests = FALSE; +BOOLEAN                     AcpiGbl_LoadTestTables = FALSE;  static UINT8                AcpiGbl_ExecutionMode = AE_MODE_COMMAND_LOOP;  static char                 BatchBuffer[AE_BUFFER_SIZE];    /* Batch command buffer */  static AE_TABLE_DESC        *AeTableListHead = NULL; @@ -131,6 +131,7 @@ usage (      ACPI_OPTION ("-ef",                 "Enable display of final memory statistics");      ACPI_OPTION ("-ei",                 "Enable additional tests for ACPICA interfaces"); +    ACPI_OPTION ("-el",                 "Enable loading of additional test tables");      ACPI_OPTION ("-em",                 "Enable Interpreter Serialized Mode");      ACPI_OPTION ("-es",                 "Enable Interpreter Slack Mode");      ACPI_OPTION ("-et",                 "Enable debug semaphore timeout"); @@ -233,6 +234,11 @@ AeDoOptions (              AcpiGbl_DoInterfaceTests = TRUE;              break; +        case 'l': + +            AcpiGbl_LoadTestTables = TRUE; +            break; +          case 'm':              AcpiGbl_AllMethodsSerialized = TRUE; @@ -450,6 +456,8 @@ main (          AcpiGbl_Optind++;      } +    printf ("\n"); +      /* Build a local RSDT with all tables and let ACPICA process the RSDT */      Status = AeBuildLocalTables (TableCount, AeTableListHead); diff --git a/source/tools/acpiexec/aetables.c b/source/tools/acpiexec/aetables.c index 452546dd73f6..67559af45ed1 100644 --- a/source/tools/acpiexec/aetables.c +++ b/source/tools/acpiexec/aetables.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -49,6 +49,12 @@  /* Local prototypes */ +static void +AeInitializeTableHeader ( +    ACPI_TABLE_HEADER       *Header, +    char                    *Signature, +    UINT32                  Length); +  void  AeTableOverride (      ACPI_TABLE_HEADER       *ExistingTable, @@ -81,9 +87,8 @@ static ACPI_TABLE_FADT          LocalFADT;   */  static ACPI_TABLE_XSDT          *LocalXSDT; -#define BASE_XSDT_TABLES        10 -#define BASE_XSDT_SIZE          (sizeof (ACPI_TABLE_XSDT) + \ -                                    ((BASE_XSDT_TABLES -1) * sizeof (UINT64))) +#define BASE_XSDT_TABLES        9 +#define BASE_XSDT_SIZE          ((BASE_XSDT_TABLES) * sizeof (UINT64))  #define ACPI_MAX_INIT_TABLES    (32)  static ACPI_TABLE_DESC          Tables[ACPI_MAX_INIT_TABLES]; @@ -104,6 +109,12 @@ AeTableOverride (      ACPI_TABLE_HEADER       **NewTable)  { +    if (!AcpiGbl_LoadTestTables) +    { +        *NewTable = NULL; +        return; +    } +      /* This code exercises the table override mechanism in the core */      if (ACPI_COMPARE_NAME (ExistingTable->Signature, ACPI_SIG_DSDT)) @@ -122,6 +133,38 @@ AeTableOverride (  /******************************************************************************   * + * 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; +    ACPI_STRNCPY (Header->OemId, "Intel", ACPI_OEM_ID_SIZE); +    ACPI_STRNCPY (Header->OemTableId, "AcpiExec", ACPI_OEM_TABLE_ID_SIZE); +    ACPI_STRNCPY (Header->AslCompilerId, "INTL", ACPI_NAME_SIZE); +    Header->AslCompilerRevision = 0x20131218; +} + + +/****************************************************************************** + *   * FUNCTION:    AeBuildLocalTables   *   * PARAMETERS:  TableCount      - Number of tables on the command line @@ -147,9 +190,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) @@ -162,7 +205,11 @@ AeBuildLocalTables (          NextTable = NextTable->Next;      } -    XsdtSize = BASE_XSDT_SIZE + (TableCount * sizeof (UINT64)); +    XsdtSize = (((TableCount + 1) * sizeof (UINT64)) + sizeof (ACPI_TABLE_HEADER)); +    if (AcpiGbl_LoadTestTables) +    { +        XsdtSize += BASE_XSDT_SIZE; +    }      /* Build an XSDT */ @@ -173,41 +220,18 @@ AeBuildLocalTables (      }      ACPI_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 (&LocalTEST); -    LocalXSDT->TableOffsetEntry[1] = ACPI_PTR_TO_PHYSADDR (&LocalBADTABLE); -    LocalXSDT->TableOffsetEntry[2] = ACPI_PTR_TO_PHYSADDR (&LocalFADT); - -    /* Install two SSDTs to test multiple table support */ - -    LocalXSDT->TableOffsetEntry[3] = ACPI_PTR_TO_PHYSADDR (&Ssdt1Code); -    LocalXSDT->TableOffsetEntry[4] = ACPI_PTR_TO_PHYSADDR (&Ssdt2Code); - -    /* Install the OEM1 table to test LoadTable */ +    AeInitializeTableHeader ((void *) LocalXSDT, ACPI_SIG_XSDT, XsdtSize); -    LocalXSDT->TableOffsetEntry[5] = ACPI_PTR_TO_PHYSADDR (&Oem1Code); - -    /* Install the OEMx table to test LoadTable */ - -    LocalXSDT->TableOffsetEntry[6] = ACPI_PTR_TO_PHYSADDR (&OemxCode); - -     /* Install the ECDT table to test _REG */ - -    LocalXSDT->TableOffsetEntry[7] = ACPI_PTR_TO_PHYSADDR (&EcdtCode); - -    /* Install two UEFIs to test multiple table support */ - -    LocalXSDT->TableOffsetEntry[8] = ACPI_PTR_TO_PHYSADDR (&Uefi1Code); -    LocalXSDT->TableOffsetEntry[9] = ACPI_PTR_TO_PHYSADDR (&Uefi2Code); +    LocalXSDT->TableOffsetEntry[0] = ACPI_PTR_TO_PHYSADDR (&LocalFADT); +    NextIndex = 1;      /*       * 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)      { @@ -225,38 +249,73 @@ AeBuildLocalTables (              /* The incoming user table is a DSDT */ -            DsdtAddress = ACPI_PTR_TO_PHYSADDR (&DsdtCode); +            DsdtAddress = ACPI_PTR_TO_PHYSADDR (NextTable->Table);              DsdtToInstallOverride = NextTable->Table;          }          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 */ +    /* Install the optional extra local tables */ + +    if (AcpiGbl_LoadTestTables) +    { +        LocalXSDT->TableOffsetEntry[NextIndex++] = ACPI_PTR_TO_PHYSADDR (&LocalTEST); +        LocalXSDT->TableOffsetEntry[NextIndex++] = ACPI_PTR_TO_PHYSADDR (&LocalBADTABLE); + +        /* Install two SSDTs to test multiple table support */ + +        LocalXSDT->TableOffsetEntry[NextIndex++] = ACPI_PTR_TO_PHYSADDR (&Ssdt1Code); +        LocalXSDT->TableOffsetEntry[NextIndex++] = ACPI_PTR_TO_PHYSADDR (&Ssdt2Code); + +        /* Install the OEM1 table to test LoadTable */ + +        LocalXSDT->TableOffsetEntry[NextIndex++] = ACPI_PTR_TO_PHYSADDR (&Oem1Code); + +        /* Install the OEMx table to test LoadTable */ + +        LocalXSDT->TableOffsetEntry[NextIndex++] = ACPI_PTR_TO_PHYSADDR (&OemxCode); + +         /* Install the ECDT table to test _REG */ + +        LocalXSDT->TableOffsetEntry[NextIndex++] = ACPI_PTR_TO_PHYSADDR (&EcdtCode); + +        /* Install two UEFIs to test multiple table support */ + +        LocalXSDT->TableOffsetEntry[NextIndex++] = ACPI_PTR_TO_PHYSADDR (&Uefi1Code); +        LocalXSDT->TableOffsetEntry[NextIndex++] = ACPI_PTR_TO_PHYSADDR (&Uefi2Code); +    } + +    /* Build an RSDP. Contains a valid XSDT only, no RSDT */      ACPI_MEMSET (&LocalRSDP, 0, sizeof (ACPI_TABLE_RSDP));      ACPI_MAKE_RSDP_SIG (LocalRSDP.Signature); -    ACPI_MEMCPY (LocalRSDP.OemId, "I_TEST", 6); +    ACPI_MEMCPY (LocalRSDP.OemId, "Intel", 6); +      LocalRSDP.Revision = 2;      LocalRSDP.XsdtPhysicalAddress = ACPI_PTR_TO_PHYSADDR (LocalXSDT); -    LocalRSDP.Length = sizeof (ACPI_TABLE_XSDT); +    LocalRSDP.Length = sizeof (ACPI_TABLE_RSDP);      /* Set checksums for both XSDT and RSDP */ +    LocalXSDT->Header.Checksum = 0;      LocalXSDT->Header.Checksum = (UINT8) -AcpiTbChecksum (          (void *) LocalXSDT, LocalXSDT->Header.Length); + +    LocalRSDP.Checksum = 0;      LocalRSDP.Checksum = (UINT8) -AcpiTbChecksum (          (void *) &LocalRSDP, ACPI_RSDP_CHECKSUM_LENGTH); @@ -268,6 +327,12 @@ AeBuildLocalTables (          DsdtToInstallOverride = ACPI_CAST_PTR (ACPI_TABLE_HEADER, LocalDsdtCode);      } +    /* +     * Build an FADT. There are three options for the FADT: +     * 1) Incoming external FADT specified on the command line +     * 2) A "hardware reduced" local FADT +     * 3) A fully featured local FADT +     */      if (ExternalFadt)      {          /* @@ -280,6 +345,8 @@ 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))          {              ExternalFadt->XDsdt = DsdtAddress; @@ -312,7 +379,8 @@ AeBuildLocalTables (           * Build a local FADT so we can test the hardware/event init           */          ACPI_MEMSET (&LocalFADT, 0, sizeof (ACPI_TABLE_FADT)); -        ACPI_MOVE_NAME (LocalFADT.Header.Signature, ACPI_SIG_FADT); +        LocalFADT.Header.Revision = 5; +        AeInitializeTableHeader ((void *) &LocalFADT, ACPI_SIG_FADT, sizeof (ACPI_TABLE_FADT));          /* Setup FADT header and DSDT/FACS addresses */ @@ -322,9 +390,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; @@ -347,7 +412,7 @@ AeBuildLocalTables (          LocalFADT.Pm2ControlBlock = 0xC0;          LocalFADT.Pm2ControlLength = 1; -        /* Setup one example X-64 field */ +        /* Setup one example X-64 GAS field */          LocalFADT.XPm1bEventBlock.SpaceId = ACPI_ADR_SPACE_SYSTEM_IO;          LocalFADT.XPm1bEventBlock.Address = LocalFADT.Pm1bEventBlock; @@ -368,29 +433,34 @@ AeBuildLocalTables (      LocalFACS.Length = sizeof (ACPI_TABLE_FACS);      LocalFACS.GlobalLock = 0x11AA0011; -    /* -     * Build a fake table [TEST] so that we make sure that the -     * ACPICA core ignores it -     */ -    ACPI_MEMSET (&LocalTEST, 0, sizeof (ACPI_TABLE_HEADER)); -    ACPI_MOVE_NAME (LocalTEST.Signature, "TEST"); +    /* Build the optional local tables */ -    LocalTEST.Revision = 1; -    LocalTEST.Length = sizeof (ACPI_TABLE_HEADER); -    LocalTEST.Checksum = (UINT8) -AcpiTbChecksum ( -        (void *) &LocalTEST, LocalTEST.Length); +    if (AcpiGbl_LoadTestTables) +    { +        /* +         * Build a fake table [TEST] so that we make sure that the +         * ACPICA core ignores it +         */ +        ACPI_MEMSET (&LocalTEST, 0, sizeof (ACPI_TABLE_HEADER)); +        ACPI_MOVE_NAME (LocalTEST.Signature, "TEST"); -    /* -     * Build a fake table with a bad signature [BAD!] so that we make -     * sure that the ACPICA core ignores it -     */ -    ACPI_MEMSET (&LocalBADTABLE, 0, sizeof (ACPI_TABLE_HEADER)); -    ACPI_MOVE_NAME (LocalBADTABLE.Signature, "BAD!"); +        LocalTEST.Revision = 1; +        LocalTEST.Length = sizeof (ACPI_TABLE_HEADER); +        LocalTEST.Checksum = (UINT8) -AcpiTbChecksum ( +            (void *) &LocalTEST, LocalTEST.Length); -    LocalBADTABLE.Revision = 1; -    LocalBADTABLE.Length = sizeof (ACPI_TABLE_HEADER); -    LocalBADTABLE.Checksum = (UINT8) -AcpiTbChecksum ( -        (void *) &LocalBADTABLE, LocalBADTABLE.Length); +        /* +         * Build a fake table with a bad signature [BAD!] so that we make +         * sure that the ACPICA core ignores it +         */ +        ACPI_MEMSET (&LocalBADTABLE, 0, sizeof (ACPI_TABLE_HEADER)); +        ACPI_MOVE_NAME (LocalBADTABLE.Signature, "BAD!"); + +        LocalBADTABLE.Revision = 1; +        LocalBADTABLE.Length = sizeof (ACPI_TABLE_HEADER); +        LocalBADTABLE.Checksum = (UINT8) -AcpiTbChecksum ( +            (void *) &LocalBADTABLE, LocalBADTABLE.Length); +    }      return (AE_OK);  } @@ -444,27 +514,30 @@ AeInstallTables (              AcpiFormatException (Status));      } -    /* Test multiple table/UEFI support. First, get the headers */ +    if (AcpiGbl_LoadTestTables) +    { +        /* Test multiple table/UEFI support. First, get the headers */ -    Status = AcpiGetTableHeader (ACPI_SIG_UEFI, 1, &Header); -    AE_CHECK_OK (AcpiGetTableHeader, Status); +        Status = AcpiGetTableHeader (ACPI_SIG_UEFI, 1, &Header); +        AE_CHECK_OK (AcpiGetTableHeader, Status); -    Status = AcpiGetTableHeader (ACPI_SIG_UEFI, 2, &Header); -    AE_CHECK_OK (AcpiGetTableHeader, Status); +        Status = AcpiGetTableHeader (ACPI_SIG_UEFI, 2, &Header); +        AE_CHECK_OK (AcpiGetTableHeader, Status); -    Status = AcpiGetTableHeader (ACPI_SIG_UEFI, 3, &Header); -    AE_CHECK_STATUS (AcpiGetTableHeader, Status, AE_NOT_FOUND); +        Status = AcpiGetTableHeader (ACPI_SIG_UEFI, 3, &Header); +        AE_CHECK_STATUS (AcpiGetTableHeader, Status, AE_NOT_FOUND); -    /* Now get the actual tables */ +        /* Now get the actual tables */ -    Status = AcpiGetTable (ACPI_SIG_UEFI, 1, &Table); -    AE_CHECK_OK (AcpiGetTable, Status); +        Status = AcpiGetTable (ACPI_SIG_UEFI, 1, &Table); +        AE_CHECK_OK (AcpiGetTable, Status); -    Status = AcpiGetTable (ACPI_SIG_UEFI, 2, &Table); -    AE_CHECK_OK (AcpiGetTable, Status); +        Status = AcpiGetTable (ACPI_SIG_UEFI, 2, &Table); +        AE_CHECK_OK (AcpiGetTable, Status); -    Status = AcpiGetTable (ACPI_SIG_UEFI, 3, &Table); -    AE_CHECK_STATUS (AcpiGetTable, Status, AE_NOT_FOUND); +        Status = AcpiGetTable (ACPI_SIG_UEFI, 3, &Table); +        AE_CHECK_STATUS (AcpiGetTable, Status, AE_NOT_FOUND); +    }      return (AE_OK);  } diff --git a/source/tools/acpiexec/aetables.h b/source/tools/acpiexec/aetables.h index dd4e62169a4e..ef1132b11d06 100644 --- a/source/tools/acpiexec/aetables.h +++ b/source/tools/acpiexec/aetables.h @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -49,16 +49,7 @@   * Miscellaneous pre-compiled AML ACPI tables to be installed   */ -/* Default DSDT. This will be replaced with the input DSDT */ - -static unsigned char DsdtCode[] = -{ -    0x44,0x53,0x44,0x54,0x24,0x00,0x00,0x00,  /* 00000000    "DSDT$..." */ -    0x02,0x6F,0x49,0x6E,0x74,0x65,0x6C,0x00,  /* 00000008    ".oIntel." */ -    0x4E,0x75,0x6C,0x6C,0x44,0x53,0x44,0x54,  /* 00000010    "NullDSDT" */ -    0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */ -    0x04,0x12,0x08,0x20, -}; +/* Local DSDT used only if not present in the input */  static unsigned char LocalDsdtCode[] =  { diff --git a/source/tools/acpihelp/acpihelp.h b/source/tools/acpihelp/acpihelp.h index 598366825b22..fba275466ee4 100644 --- a/source/tools/acpihelp/acpihelp.h +++ b/source/tools/acpihelp/acpihelp.h @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpihelp/ahamlops.c b/source/tools/acpihelp/ahamlops.c index 3a6aa492289d..faa4c196fd8c 100644 --- a/source/tools/acpihelp/ahamlops.c +++ b/source/tools/acpihelp/ahamlops.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpihelp/ahaslkey.c b/source/tools/acpihelp/ahaslkey.c index 2b50960db4d8..574bb4b1d51e 100644 --- a/source/tools/acpihelp/ahaslkey.c +++ b/source/tools/acpihelp/ahaslkey.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpihelp/ahaslops.c b/source/tools/acpihelp/ahaslops.c index 2d7f4d3fe3c6..e111b7e30dc2 100644 --- a/source/tools/acpihelp/ahaslops.c +++ b/source/tools/acpihelp/ahaslops.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpihelp/ahdecode.c b/source/tools/acpihelp/ahdecode.c index 38e2b7e2378e..556dc6c98bf7 100644 --- a/source/tools/acpihelp/ahdecode.c +++ b/source/tools/acpihelp/ahdecode.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpihelp/ahmain.c b/source/tools/acpihelp/ahmain.c index 036ab7577aec..1a8de1e4bade 100644 --- a/source/tools/acpihelp/ahmain.c +++ b/source/tools/acpihelp/ahmain.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpinames/acpinames.h b/source/tools/acpinames/acpinames.h index ca2aa1345ffd..2c18c49bb160 100644 --- a/source/tools/acpinames/acpinames.h +++ b/source/tools/acpinames/acpinames.h @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpinames/anmain.c b/source/tools/acpinames/anmain.c index 4a079c40e27a..e65e6e9e4850 100644 --- a/source/tools/acpinames/anmain.c +++ b/source/tools/acpinames/anmain.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpinames/anstubs.c b/source/tools/acpinames/anstubs.c index 5375c558f9c3..dedc40fd2f03 100644 --- a/source/tools/acpinames/anstubs.c +++ b/source/tools/acpinames/anstubs.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpinames/antables.c b/source/tools/acpinames/antables.c index 6473e6b4daa0..8ad3c5c3dc15 100644 --- a/source/tools/acpinames/antables.c +++ b/source/tools/acpinames/antables.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpisrc/acpisrc.h b/source/tools/acpisrc/acpisrc.h index 101083deed5b..cdf7f0d99b33 100644 --- a/source/tools/acpisrc/acpisrc.h +++ b/source/tools/acpisrc/acpisrc.h @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -70,6 +70,7 @@  #define FILE_TYPE_SOURCE                    1  #define FILE_TYPE_HEADER                    2  #define FILE_TYPE_DIRECTORY                 3 +#define FILE_TYPE_PATCH                     4  #define CVT_COUNT_TABS                      0x00000001  #define CVT_COUNT_NON_ANSI_COMMENTS         0x00000002 @@ -189,6 +190,14 @@ typedef struct acpi_conversion_table      ACPI_IDENTIFIER_TABLE       *HeaderSpecialMacroTable;      UINT32                      HeaderFunctions; +    ACPI_STRING_TABLE           *PatchStringTable; +    ACPI_IDENTIFIER_TABLE       *PatchLineTable; +    ACPI_IDENTIFIER_TABLE       *PatchConditionalTable; +    ACPI_IDENTIFIER_TABLE       *PatchMacroTable; +    ACPI_TYPED_IDENTIFIER_TABLE *PatchStructTable; +    ACPI_IDENTIFIER_TABLE       *PatchSpecialMacroTable; +    UINT32                      PatchFunctions; +  } ACPI_CONVERSION_TABLE; diff --git a/source/tools/acpisrc/ascase.c b/source/tools/acpisrc/ascase.c index 919029a2cffb..2007acc84584 100644 --- a/source/tools/acpisrc/ascase.c +++ b/source/tools/acpisrc/ascase.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpisrc/asconvrt.c b/source/tools/acpisrc/asconvrt.c index 76db87133017..53c0c5454059 100644 --- a/source/tools/acpisrc/asconvrt.c +++ b/source/tools/acpisrc/asconvrt.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpisrc/asfile.c b/source/tools/acpisrc/asfile.c index e28a4cf0a777..42cefa46e88e 100644 --- a/source/tools/acpisrc/asfile.c +++ b/source/tools/acpisrc/asfile.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -334,6 +334,17 @@ AsConvertFile (          SpecialMacroTable   = ConversionTable->HeaderSpecialMacroTable;          break; +    case FILE_TYPE_PATCH: + +        Functions           = ConversionTable->PatchFunctions; +        StringTable         = ConversionTable->PatchStringTable; +        LineTable           = ConversionTable->PatchLineTable; +        ConditionalTable    = ConversionTable->PatchConditionalTable; +        MacroTable          = ConversionTable->PatchMacroTable; +        StructTable         = ConversionTable->PatchStructTable; +        SpecialMacroTable   = ConversionTable->PatchSpecialMacroTable; +        break; +      default:          printf ("Unknown file type, cannot process\n"); diff --git a/source/tools/acpisrc/asmain.c b/source/tools/acpisrc/asmain.c index 9ce25a5df9c6..8c75769c5196 100644 --- a/source/tools/acpisrc/asmain.c +++ b/source/tools/acpisrc/asmain.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -495,10 +495,18 @@ main (          {              AsProcessOneFile (ConversionTable, NULL, TargetPath, 0, SourcePath, FILE_TYPE_HEADER);          } -        else +        else if (strstr (SourcePath, ".c"))          {              AsProcessOneFile (ConversionTable, NULL, TargetPath, 0, SourcePath, FILE_TYPE_SOURCE);          } +        else if (strstr (SourcePath, ".patch")) +        { +            AsProcessOneFile (ConversionTable, NULL, TargetPath, 0, SourcePath, FILE_TYPE_PATCH); +        } +        else +        { +            printf ("Unknown file type - %s\n", SourcePath); +        }      }      /* Always display final summary and stats */ diff --git a/source/tools/acpisrc/asremove.c b/source/tools/acpisrc/asremove.c index 78cbd6ef5d6c..1d4fe5f92b90 100644 --- a/source/tools/acpisrc/asremove.c +++ b/source/tools/acpisrc/asremove.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c index 081767b19ea2..7c3d663695c9 100644 --- a/source/tools/acpisrc/astable.c +++ b/source/tools/acpisrc/astable.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -90,7 +90,7 @@ ACPI_STRING_TABLE           StandardDataTypes[] = {  char                        DualLicenseHeader[] =  "/*\n" -" * Copyright (C) 2000 - 2013, Intel Corp.\n" +" * Copyright (C) 2000 - 2014, Intel Corp.\n"  " * All rights reserved.\n"  " *\n"  " * Redistribution and use in source and binary forms, with or without\n" @@ -761,6 +761,17 @@ ACPI_CONVERSION_TABLE       LinuxConversionTable = {       CVT_TRIM_LINES | CVT_MIXED_CASE_TO_UNDERSCORES |       CVT_LOWER_CASE_IDENTIFIERS | CVT_TRIM_WHITESPACE |       CVT_REMOVE_EMPTY_BLOCKS| CVT_REDUCE_TYPEDEFS | CVT_SPACES_TO_TABS8), + +    /* Patch files */ + +    LinuxDataTypes, +    NULL, +    NULL, +    NULL, +    AcpiIdentifiers, +    NULL, +    (CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES | +     CVT_MIXED_CASE_TO_UNDERSCORES),  }; @@ -796,6 +807,16 @@ ACPI_CONVERSION_TABLE       CleanupConversionTable = {      NULL,      (CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES |       CVT_TRIM_LINES | CVT_TRIM_WHITESPACE), + +    /* Patch files */ + +    NULL, +    NULL, +    NULL, +    NULL, +    NULL, +    NULL, +    (CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES),  }; @@ -826,6 +847,17 @@ ACPI_CONVERSION_TABLE       StatsConversionTable = {      NULL,      (CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES |       CVT_COUNT_SHORTMULTILINE_COMMENTS), + +    /* Patch files */ + +    NULL, +    NULL, +    NULL, +    NULL, +    NULL, +    NULL, +    (CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES | +     CVT_COUNT_SHORTMULTILINE_COMMENTS),  }; @@ -862,6 +894,17 @@ ACPI_CONVERSION_TABLE       LicenseConversionTable = {      NULL,      (CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES |       CVT_COUNT_SHORTMULTILINE_COMMENTS), + +    /* Patch files */ + +    NULL, +    NULL, +    NULL, +    NULL, +    NULL, +    NULL, +    (CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES | +     CVT_COUNT_SHORTMULTILINE_COMMENTS),  }; @@ -874,8 +917,8 @@ ACPI_CONVERSION_TABLE       LicenseConversionTable = {  ACPI_STRING_TABLE           CustomReplacements[] = { -    {"(c) 1999 - 2012",     "(c) 1999 - 2013",         REPLACE_WHOLE_WORD}, /* Main ACPICA source */ -    {"(c) 2006 - 2012",     "(c) 2006 - 2013",         REPLACE_WHOLE_WORD}, /* Test suites */ +    {"(c) 1999 - 2013",     "(c) 1999 - 2014",         REPLACE_WHOLE_WORD}, /* Main ACPICA source */ +    {"(c) 2006 - 2013",     "(c) 2006 - 2014",         REPLACE_WHOLE_WORD}, /* Test suites */  #if 0      {"SUPPORT, ASSISTANCE", "SUPPORT, ASSISTANCE",     REPLACE_WHOLE_WORD}, /* Fix intel header */ @@ -953,6 +996,16 @@ ACPI_CONVERSION_TABLE       CustomConversionTable = {      NULL,      (CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES |       CVT_TRIM_LINES | CVT_TRIM_WHITESPACE), + +    /* C header files */ + +    NULL, +    NULL, +    NULL, +    NULL, +    NULL, +    NULL, +    (CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES),  }; @@ -990,4 +1043,14 @@ ACPI_CONVERSION_TABLE       IndentConversionTable = {      LinuxSpecialMacros,      (CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES |       CVT_TRIM_LINES | CVT_TRIM_WHITESPACE), + +    /* C header files */ + +    NULL, +    NULL, +    NULL, +    NULL, +    NULL, +    NULL, +    (CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES),  }; diff --git a/source/tools/acpisrc/asutils.c b/source/tools/acpisrc/asutils.c index a35859696546..050d343388ba 100644 --- a/source/tools/acpisrc/asutils.c +++ b/source/tools/acpisrc/asutils.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpixtract/acpixtract.c b/source/tools/acpixtract/acpixtract.c index c06e3757dea3..747b912ea92c 100644 --- a/source/tools/acpixtract/acpixtract.c +++ b/source/tools/acpixtract/acpixtract.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/acpixtract/axmain.c b/source/tools/acpixtract/axmain.c index bfc27bb5a622..b1bdb8b6c428 100644 --- a/source/tools/acpixtract/axmain.c +++ b/source/tools/acpixtract/axmain.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/examples/examples.c b/source/tools/examples/examples.c index ad31945bc273..8de3a0565e64 100644 --- a/source/tools/examples/examples.c +++ b/source/tools/examples/examples.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/examples/examples.h b/source/tools/examples/examples.h index 13b8c2d91dd5..79195cab4195 100644 --- a/source/tools/examples/examples.h +++ b/source/tools/examples/examples.h @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/examples/exstubs.c b/source/tools/examples/exstubs.c index 7028a883565b..df2ca2598496 100644 --- a/source/tools/examples/exstubs.c +++ b/source/tools/examples/exstubs.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without diff --git a/source/tools/examples/extables.c b/source/tools/examples/extables.c index 307fe2f2977e..c33be9574cf9 100644 --- a/source/tools/examples/extables.c +++ b/source/tools/examples/extables.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without | 
