[PATCH 1/2][RESEND] ACPICA: update to version 20140926. (LP: #1374816)

Keng-Yu Lin keng-yu.lin at canonical.com
Mon Sep 29 08:46:28 UTC 2014


On Sun, Sep 28, 2014 at 2:18 AM, Colin King <colin.king at canonical.com> wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Update to ACPICA version 20140926. Refer to
> https://lists.acpica.org/pipermail/devel/2014-September/000667.html
>
> for a full list of new features and fixes.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/acpica/Makefile.am                             |   3 +-
>  src/acpica/fwts_acpica.c                           |  28 +
>  src/acpica/source/common/adisasm.c                 |  11 +-
>  src/acpica/source/common/ahids.c                   |  22 +
>  src/acpica/source/compiler/Makefile.am             |   2 +
>  src/acpica/source/compiler/aslcompile.c            |   4 +
>  src/acpica/source/compiler/aslcompiler.h           | 113 +--
>  src/acpica/source/compiler/asldefine.h             |   1 +
>  src/acpica/source/compiler/aslglobal.h             |   9 +-
>  src/acpica/source/compiler/aslload.c               |  30 +-
>  src/acpica/source/compiler/aslmain.c               |   2 +-
>  src/acpica/source/compiler/aslmapoutput.c          | 733 ++++++++++++++++
>  src/acpica/source/compiler/aslmaputils.c           | 474 ++++++++++
>  src/acpica/source/compiler/aslopcodes.c            |   5 +-
>  src/acpica/source/compiler/aslresource.c           | 145 ++--
>  src/acpica/source/compiler/aslrestype1.c           | 102 +--
>  src/acpica/source/compiler/aslrestype1i.c          |  80 +-
>  src/acpica/source/compiler/aslrestype2.c           |  41 +-
>  src/acpica/source/compiler/aslrestype2d.c          |  51 +-
>  src/acpica/source/compiler/aslrestype2e.c          |  54 +-
>  src/acpica/source/compiler/aslrestype2q.c          |  51 +-
>  src/acpica/source/compiler/aslrestype2s.c          |  79 +-
>  src/acpica/source/compiler/aslrestype2w.c          |  51 +-
>  src/acpica/source/compiler/asltree.c               |   1 -
>  src/acpica/source/compiler/asltypes.h              |  36 +-
>  src/acpica/source/compiler/aslxref.c               |  27 +-
>  src/acpica/source/compiler/dtcompile.c             |   5 +-
>  src/acpica/source/compiler/dtsubtable.c            |   4 +-
>  .../source/components/disassembler/dmbuffer.c      |   4 +
>  .../source/components/disassembler/dmopcode.c      |   2 +
>  .../source/components/disassembler/dmresrc.c       |   9 +-
>  .../source/components/disassembler/dmresrcl.c      |  40 +-
>  .../source/components/disassembler/dmresrcl2.c     |  80 +-
>  .../source/components/disassembler/dmresrcs.c      |  32 +-
>  src/acpica/source/components/dispatcher/dsfield.c  |   2 +
>  src/acpica/source/components/events/evgpeinit.c    |   4 +
>  src/acpica/source/components/events/evregion.c     |  46 +-
>  src/acpica/source/components/events/evxface.c      |   3 +-
>  src/acpica/source/components/events/evxfevnt.c     |  41 +-
>  src/acpica/source/components/executer/exfield.c    |  68 ++
>  src/acpica/source/components/executer/exprep.c     |   2 +
>  src/acpica/source/components/hardware/hwgpe.c      |   8 +
>  src/acpica/source/components/tables/tbxfroot.c     |  37 +
>  src/acpica/source/include/acdisasm.h               |  22 +
>  src/acpica/source/include/aclocal.h                |   1 +
>  src/acpica/source/include/acnames.h                |   1 +
>  src/acpica/source/include/acobject.h               |   1 +
>  src/acpica/source/include/acpixf.h                 |   2 +-
>  src/acpica/source/include/actables.h               |   4 +
>  src/acpica/source/include/actypes.h                |  18 +-
>  src/acpica/source/include/amlresrc.h               |  54 ++
>  .../source/os_specific/service_layers/osunixxf.c   |   9 +
>  src/acpica/source/tools/acpiexec/aecommon.h        |  17 +
>  src/acpica/source/tools/acpiexec/aehandlers.c      | 803 +----------------
>  src/acpica/source/tools/acpiexec/aeregion.c        | 966 +++++++++++++++++++++
>  55 files changed, 3132 insertions(+), 1308 deletions(-)
>  create mode 100644 src/acpica/source/compiler/aslmapoutput.c
>  create mode 100644 src/acpica/source/compiler/aslmaputils.c
>  create mode 100644 src/acpica/source/tools/acpiexec/aeregion.c
>
> diff --git a/src/acpica/Makefile.am b/src/acpica/Makefile.am
> index 8c3f307..1889a3f 100644
> --- a/src/acpica/Makefile.am
> +++ b/src/acpica/Makefile.am
> @@ -246,7 +246,8 @@ libfwtsacpica_la_SOURCES =                          \
>         source/common/ahids.c                           \
>         source/common/cmfsize.c                         \
>         source/common/ahuuids.c                         \
> -       source/tools/acpiexec/aehandlers.c
> +       source/tools/acpiexec/aehandlers.c              \
> +       source/tools/acpiexec/aeregion.c
>
>  libfwtsacpica_la_LIBADD = \
>         -L$(top_builddir)/src/lib/src -lfwts -lrt
> diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c
> index ce6600f..253e351 100644
> --- a/src/acpica/fwts_acpica.c
> +++ b/src/acpica/fwts_acpica.c
> @@ -45,6 +45,7 @@
>  #include "actables.h"
>  #include "acinterp.h"
>  #include "acapps.h"
> +#include "amlresrc.h"
>
>  #define ACPI_MAX_INIT_TABLES           (64)    /* Number of ACPI tables */
>
> @@ -384,6 +385,33 @@ static ACPI_STATUS fwts_region_handler(
>         return AE_OK;
>  }
>
> +void
> +MpSaveGpioInfo (
> +       ACPI_PARSE_OBJECT       *Op,
> +       AML_RESOURCE            *Resource,
> +       UINT32                  PinCount,
> +       UINT16                  *PinList,
> +       char                    *DeviceName)
> +{
> +       FWTS_UNUSED(Op);
> +       FWTS_UNUSED(Resource);
> +       FWTS_UNUSED(PinCount);
> +       FWTS_UNUSED(PinList);
> +       FWTS_UNUSED(DeviceName);
> +}
> +
> +void
> +MpSaveSerialInfo (
> +       ACPI_PARSE_OBJECT       *Op,
> +       AML_RESOURCE            *Resource,
> +       char                    *DeviceName)
> +{
> +       FWTS_UNUSED(Op);
> +       FWTS_UNUSED(Resource);
> +       FWTS_UNUSED(DeviceName);
> +}
> +
> +
>  /*
>   *  AcpiOsGetRootPointer()
>   *     override ACPICA AeLocalGetRootPointer to return a local copy of the RSDP
> diff --git a/src/acpica/source/common/adisasm.c b/src/acpica/source/common/adisasm.c
> index a34dff5..fe4e94e 100644
> --- a/src/acpica/source/common/adisasm.c
> +++ b/src/acpica/source/common/adisasm.c
> @@ -200,7 +200,7 @@ AcpiDsMethodDataInitArgs (
>
>
>  static ACPI_TABLE_DESC      LocalTables[1];
> -static ACPI_PARSE_OBJECT    *AcpiGbl_ParseOpRoot;
> +ACPI_PARSE_OBJECT    *AcpiGbl_ParseOpRoot;
>
>
>  /*******************************************************************************
> @@ -561,6 +561,14 @@ AdAmlDisassemble (
>              fprintf (stderr, "Disassembly completed\n");
>              fprintf (stderr, "ASL Output:    %s - %u bytes\n",
>                  DisasmFilename, CmGetFileSize (File));
> +
> +            if (Gbl_MapfileFlag)
> +            {
> +                fprintf (stderr, "%14s %s - %u bytes\n",
> +                    Gbl_Files[ASL_FILE_MAP_OUTPUT].ShortDescription,
> +                    Gbl_Files[ASL_FILE_MAP_OUTPUT].Filename,
> +                    FlGetFileSize (ASL_FILE_MAP_OUTPUT));
> +            }
>          }
>      }
>
> @@ -760,6 +768,7 @@ AdDisplayTables (
>      }
>
>      AcpiDmDisassemble (NULL, AcpiGbl_ParseOpRoot, ACPI_UINT32_MAX);
> +    MpEmitMappingInfo ();
>
>      if (AcpiGbl_DbOpt_verbose)
>      {
> diff --git a/src/acpica/source/common/ahids.c b/src/acpica/source/common/ahids.c
> index af6771b..8d008cf 100644
> --- a/src/acpica/source/common/ahids.c
> +++ b/src/acpica/source/common/ahids.c
> @@ -126,7 +126,9 @@
>  const AH_DEVICE_ID  AslDeviceIds[] =
>  {
>      {"10EC5640",    "Realtek I2S Audio Codec"},
> +    {"80860F09",    "Intel PWM Controller"},
>      {"80860F0A",    "Intel Atom UART Controller"},
> +    {"80860F0E",    "Intel SPI Controller"},
>      {"80860F14",    "Intel Baytrail SDIO/MMC Host Controller"},
>      {"80860F28",    "Intel SST Audio DSP"},
>      {"80860F41",    "Intel Baytrail I2C Host Controller"},
> @@ -145,12 +147,20 @@ const AH_DEVICE_ID  AslDeviceIds[] =
>      {"ACPI000D",    "Power Meter Device"},
>      {"ACPI000E",    "Time and Alarm Device"},
>      {"ACPI000F",    "User Presence Detection Device"},
> +    {"ADMA0F28",    "Intel Audio DMA"},
> +    {"AMCR0F28",    "Intel Audio Machine Driver"},
>      {"ATK4001",     "Asus Radio Control Button"},
>      {"ATML1000",    "Atmel Touchscreen Controller"},
> +    {"AUTH2750",    "AuthenTec AES2750"},
>      {"BCM2E39",     "Broadcom BT Serial Bus Driver over UART Bus Enumerator"},
> +    {"BCM4752E",    "Broadcom GPS Controller"},
> +    {"BMG0160",     "Bosch Gyro Sensor"},
>      {"CPLM3218",    "Capella Micro CM3218x Ambient Light Sensor"},
>      {"DELLABCE",    "Dell Airplane Mode Switch Driver"},
>      {"DLAC3002",    "Qualcomm Atheros Bluetooth UART Transport"},
> +    {"FTTH5506",    "FocalTech 5506 Touch Controller"},
> +    {"HAD0F28",     "Intel HDMI Audio Driver"},
> +    {"INBC0000",    "GPIO Expander"},
>      {"INT0002",     "Virtual GPIO Controller"},
>      {"INT0800",     "Intel 82802 Firmware Hub Device"},
>      {"INT3394",     "ACPI System Fan"},
> @@ -159,6 +169,7 @@ const AH_DEVICE_ID  AslDeviceIds[] =
>      {"INT33A1",     "Intel Power Engine"},
>      {"INT33BB",     "Intel Baytrail SD Host Controller"},
>      {"INT33BD",     "Intel Baytrail Mailbox Device"},
> +    {"INT33BE",     "Camera Sensor OV5693"},
>      {"INT33C0",     "Intel Serial I/O SPI Host Controller"},
>      {"INT33C1",     "Intel Serial I/O SPI Host Controller"},
>      {"INT33C2",     "Intel Serial I/O I2C Host Controller"},
> @@ -177,9 +188,12 @@ const AH_DEVICE_ID  AslDeviceIds[] =
>      {"INT33D4",     "Intel GPIO Buttons"},
>      {"INT33D6",     "Intel Virtual Buttons Device"},
>      {"INT33F0",     "Camera Sensor MT9M114"},
> +    {"INT33F4",     "XPOWER PMIC Controller"},
> +    {"INT33F5",     "TI PMIC Controller"},
>      {"INT33FB",     "MIPI-CSI Camera Sensor OV2722"},
>      {"INT33FC",     "Intel Baytrail GPIO Controller"},
>      {"INT33FD",     "Intel Baytrail Power Management IC"},
> +    {"INT33FE",     "XPOWER Battery Device"},
>      {"INT3400",     "Intel Dynamic Power Performance Management"},
>      {"INT3401",     "Intel Extended Thermal Model CPU"},
>      {"INT3403",     "DPTF Temperature Sensor"},
> @@ -199,8 +213,10 @@ const AH_DEVICE_ID  AslDeviceIds[] =
>      {"LNXSYSTM",    "ACPI Root Node"},
>      {"LNXTHERM",    "ACPI Thermal Zone"},
>      {"LNXVIDEO",    "ACPI Video Controller"},
> +    {"MAX17047",    "Fuel Gauge Controller"},
>      {"MSFT0101",    "TPM 2.0 Security Device"},
>      {"NXP5442",     "NXP 5442 Near Field Communications Controller"},
> +    {"NXP5472",     "NXP NFC"},
>      {"PNP0000",     "8259-compatible Programmable Interrupt Controller"},
>      {"PNP0001",     "EISA Interrupt Controller"},
>      {"PNP0002",     "MCA Interrupt Controller"},
> @@ -253,7 +269,13 @@ const AH_DEVICE_ID  AslDeviceIds[] =
>      {"PNP0D40",     "SDA Standard Compliant SD Host Controller"},
>      {"PNP0D80",     "Windows-compatible System Power Management Controller"},
>      {"PNP0F03",     "Microsoft PS/2-style Mouse"},
> +    {"PNP0F13",     "PS/2 Mouse"},
> +    {"RTL8723",     "Realtek Wireless Controller"},
> +    {"SMB0349",     "Charger"},
>      {"SMO91D0",     "Sensor Hub"},
> +    {"SMSC3750",    "SMSC 3750 USB MUX"},
> +    {"SSPX0000",    "Intel SSP Device"},
> +    {"TBQ24296",    "Charger"},
>
>      {NULL, NULL}
>  };
> diff --git a/src/acpica/source/compiler/Makefile.am b/src/acpica/source/compiler/Makefile.am
> index 34caaee..dfec647 100644
> --- a/src/acpica/source/compiler/Makefile.am
> +++ b/src/acpica/source/compiler/Makefile.am
> @@ -73,6 +73,8 @@ libfwtsiasl_la_SOURCES =                      \
>         aslload.c                               \
>         asllookup.c                             \
>         aslmap.c                                \
> +       aslmapoutput.c                          \
> +       aslmaputils.c                           \
>         aslmessages.c                           \
>         aslopcodes.c                            \
>         asloperands.c                           \
> diff --git a/src/acpica/source/compiler/aslcompile.c b/src/acpica/source/compiler/aslcompile.c
> index a051e0f..d6707fc 100644
> --- a/src/acpica/source/compiler/aslcompile.c
> +++ b/src/acpica/source/compiler/aslcompile.c
> @@ -612,6 +612,10 @@ CmDoOutputFiles (
>      /* Dump the namespace to the .nsp file if requested */
>
>      (void) NsDisplayNamespace ();
> +
> +    /* Dump the device mapping file */
> +
> +    MpEmitMappingInfo ();
>  }
>
>
> diff --git a/src/acpica/source/compiler/aslcompiler.h b/src/acpica/source/compiler/aslcompiler.h
> index 74b6a45..0ad44d3 100644
> --- a/src/acpica/source/compiler/aslcompiler.h
> +++ b/src/acpica/source/compiler/aslcompiler.h
> @@ -880,6 +880,13 @@ ACPI_STATUS
>  FlOpenMiscOutputFiles (
>      char                    *InputFilename);
>
> +/*
> + * aslhwmap - hardware map summary
> + */
> +void
> +MpEmitMappingInfo (
> +    void);
> +
>
>  /*
>   * asload - load namespace in prep for cross reference
> @@ -1117,8 +1124,7 @@ RsCheckListForDuplicates (
>
>  ASL_RESOURCE_NODE *
>  RsDoOneResourceDescriptor (
> -    ACPI_PARSE_OBJECT       *DescriptorTypeOp,
> -    UINT32                  CurrentByteOffset,
> +    ASL_RESOURCE_INFO       *Info,
>      UINT8                   *State);
>
>  /* Values for State above */
> @@ -1142,43 +1148,35 @@ RsDoResourceTemplate (
>   */
>  ASL_RESOURCE_NODE *
>  RsDoEndTagDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoEndDependentDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoMemory24Descriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoMemory32Descriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoMemory32FixedDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoStartDependentDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoStartDependentNoPriDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoVendorSmallDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>
>  /*
> @@ -1186,33 +1184,27 @@ RsDoVendorSmallDescriptor (
>   */
>  ASL_RESOURCE_NODE *
>  RsDoDmaDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoFixedDmaDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoFixedIoDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoIoDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoIrqDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoIrqNoFlagsDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>
>  /*
> @@ -1220,61 +1212,50 @@ RsDoIrqNoFlagsDescriptor (
>   */
>  ASL_RESOURCE_NODE *
>  RsDoInterruptDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoVendorLargeDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoGeneralRegisterDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoGpioIntDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoGpioIoDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoI2cSerialBusDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoSpiSerialBusDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoUartSerialBusDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  /*
>   * aslrestype2d - DWord address descriptors
>   */
>  ASL_RESOURCE_NODE *
>  RsDoDwordIoDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoDwordMemoryDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoDwordSpaceDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>
>  /*
> @@ -1282,18 +1263,15 @@ RsDoDwordSpaceDescriptor (
>   */
>  ASL_RESOURCE_NODE *
>  RsDoExtendedIoDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoExtendedMemoryDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoExtendedSpaceDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>
>  /*
> @@ -1301,18 +1279,15 @@ RsDoExtendedSpaceDescriptor (
>   */
>  ASL_RESOURCE_NODE *
>  RsDoQwordIoDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoQwordMemoryDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoQwordSpaceDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>
>  /*
> @@ -1320,18 +1295,16 @@ RsDoQwordSpaceDescriptor (
>   */
>  ASL_RESOURCE_NODE *
>  RsDoWordIoDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoWordSpaceDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
>
>  ASL_RESOURCE_NODE *
>  RsDoWordBusNumberDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset);
> +    ASL_RESOURCE_INFO       *Info);
> +
>
>  /*
>   * Entry to data table compiler subsystem
> diff --git a/src/acpica/source/compiler/asldefine.h b/src/acpica/source/compiler/asldefine.h
> index 0332a83..8dfcd36 100644
> --- a/src/acpica/source/compiler/asldefine.h
> +++ b/src/acpica/source/compiler/asldefine.h
> @@ -180,6 +180,7 @@
>
>  #define FILE_SUFFIX_PREPROCESSOR    "i"
>  #define FILE_SUFFIX_AML_CODE        "aml"
> +#define FILE_SUFFIX_MAP             "map"
>  #define FILE_SUFFIX_LISTING         "lst"
>  #define FILE_SUFFIX_HEX_DUMP        "hex"
>  #define FILE_SUFFIX_DEBUG           "txt"
> diff --git a/src/acpica/source/compiler/aslglobal.h b/src/acpica/source/compiler/aslglobal.h
> index 7ca898f..41c2ece 100644
> --- a/src/acpica/source/compiler/aslglobal.h
> +++ b/src/acpica/source/compiler/aslglobal.h
> @@ -153,7 +153,8 @@ ASL_FILE_INFO                       Gbl_Files [ASL_NUM_FILES] =
>      {NULL, NULL, "C Source:     ", "C Code Output"},
>      {NULL, NULL, "ASM Include:  ", "Assembly Header Output"},
>      {NULL, NULL, "C Include:    ", "C Header Output"},
> -    {NULL, NULL, "Offset Table: ", "C Offset Table Output"}
> +    {NULL, NULL, "Offset Table: ", "C Offset Table Output"},
> +    {NULL, NULL, "Device Map:   ", "Device Map Output"}
>  };
>
>  #else
> @@ -213,6 +214,7 @@ ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_PreprocessFlag, TRUE);
>  ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DisassembleAll, FALSE);
>
>  ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, TRUE);
> +ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_MapfileFlag, FALSE);
>  ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE);
>  ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_PreprocessorOutputFlag, FALSE);
>  ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DebugFlag, FALSE);
> @@ -293,6 +295,11 @@ ASL_EXTERN ASL_CACHE_INFO           ASL_INIT_GLOBAL (*Gbl_StringCacheList, NULL)
>  ASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_StringCacheNext, NULL);
>  ASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_StringCacheLast, NULL);
>
> +/* Map file */
> +
> +ASL_EXTERN ACPI_GPIO_INFO           ASL_INIT_GLOBAL (*Gbl_GpioList, NULL);
> +ASL_EXTERN ACPI_SERIAL_INFO         ASL_INIT_GLOBAL (*Gbl_SerialList, NULL);
> +
>
>  /* Misc */
>
> diff --git a/src/acpica/source/compiler/aslload.c b/src/acpica/source/compiler/aslload.c
> index 7b042ec..d88e94e 100644
> --- a/src/acpica/source/compiler/aslload.c
> +++ b/src/acpica/source/compiler/aslload.c
> @@ -432,7 +432,6 @@ LdNamespace1Begin (
>      ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op %p [%s]\n",
>          Op, Op->Asl.ParseOpName));
>
> -
>      /*
>       * We are only interested in opcodes that have an associated name
>       * (or multiple names)
> @@ -446,6 +445,34 @@ LdNamespace1Begin (
>          Status = LdLoadFieldElements (Op, WalkState);
>          return (Status);
>
> +    case AML_INT_CONNECTION_OP:
> +
> +
> +        if (Op->Asl.Child->Asl.AmlOpcode != AML_INT_NAMEPATH_OP)
> +        {
> +            break;
> +        }
> +        Arg = Op->Asl.Child;
> +
> +        Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Asl.ExternalName,
> +            ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
> +            WalkState, &Node);
> +        if (ACPI_FAILURE (Status))
> +        {
> +            break;
> +        }
> +
> +        if (Node->Type == ACPI_TYPE_BUFFER)
> +        {
> +            Arg->Asl.Node = Node;
> +
> +            Arg = Node->Op->Asl.Child;  /* Get namepath */
> +            Arg = Arg->Asl.Next;        /* Get actual buffer */
> +            Arg = Arg->Asl.Child;       /* Buffer length */
> +            Arg = Arg->Asl.Next;        /* RAW_DATA buffer */
> +        }
> +        break;
> +
>      default:
>
>          /* All other opcodes go below */
> @@ -539,7 +566,6 @@ LdNamespace1Begin (
>          ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
>          break;
>
> -
>      case PARSEOP_SCOPE:
>          /*
>           * The name referenced by Scope(Name) must already exist at this point.
> diff --git a/src/acpica/source/compiler/aslmain.c b/src/acpica/source/compiler/aslmain.c
> index 15e2f36..120a21a 100644
> --- a/src/acpica/source/compiler/aslmain.c
> +++ b/src/acpica/source/compiler/aslmain.c
> @@ -244,6 +244,7 @@ Usage (
>
>      printf ("\nOptional Listing Files:\n");
>      ACPI_OPTION ("-l",              "Create mixed listing file (ASL source and AML) (*.lst)");
> +    ACPI_OPTION ("-lm",             "Create hardware summary map file (*.map)");
>      ACPI_OPTION ("-ln",             "Create namespace file (*.nsp)");
>      ACPI_OPTION ("-ls",             "Create combined source file (expanded includes) (*.src)");
>
> @@ -476,7 +477,6 @@ main (
>  CleanupAndExit:
>
>      UtFreeLineBuffers ();
> -
>      AslParserCleanup ();
>
>      if (AcpiGbl_ExternalFileList)
> diff --git a/src/acpica/source/compiler/aslmapoutput.c b/src/acpica/source/compiler/aslmapoutput.c
> new file mode 100644
> index 0000000..046ebb7
> --- /dev/null
> +++ b/src/acpica/source/compiler/aslmapoutput.c
> @@ -0,0 +1,733 @@
> +/******************************************************************************
> + *
> + * Module Name: aslmapoutput - Output/emit the resource descriptor/device maps
> + *
> + *****************************************************************************/
> +
> +/******************************************************************************
> + *
> + * 1. Copyright Notice
> + *
> + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
> + * All rights reserved.
> + *
> + * 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 "acpi.h"
> +#include "accommon.h"
> +#include "acapps.h"
> +#include "aslcompiler.h"
> +#include "aslcompiler.y.h"
> +#include "acinterp.h"
> +#include "acparser.h"
> +#include "acnamesp.h"
> +#include "amlcode.h"
> +
> +/* This module used for application-level code only */
> +
> +#define _COMPONENT          ACPI_COMPILER
> +        ACPI_MODULE_NAME    ("aslmapoutput")
> +
> +/* Local prototypes */
> +
> +static void
> +MpEmitGpioInfo (
> +    void);
> +
> +static void
> +MpEmitSerialInfo (
> +    void);
> +
> +static void
> +MpEmitDeviceTree (
> +    void);
> +
> +static ACPI_STATUS
> +MpEmitOneDevice (
> +    ACPI_HANDLE             ObjHandle,
> +    UINT32                  NestingLevel,
> +    void                    *Context,
> +    void                    **ReturnValue);
> +
> +static void
> +MpXrefDevices (
> +    ACPI_GPIO_INFO          *Info);
> +
> +static ACPI_STATUS
> +MpNamespaceXrefBegin (
> +    ACPI_PARSE_OBJECT       *Op,
> +    UINT32                  Level,
> +    void                    *Context);
> +
> +
> +/* Strings used to decode flag bits */
> +
> +const char                  *DirectionDecode[] =
> +{
> +    "Both I/O   ",
> +    "InputOnly  ",
> +    "OutputOnly ",
> +    "Preserve   "
> +};
> +
> +const char                  *PolarityDecode[] =
> +{
> +    "ActiveHigh",
> +    "ActiveLow ",
> +    "ActiveBoth",
> +    "Reserved  "
> +};
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    MpEmitMappingInfo
> + *
> + * PARAMETERS:  None
> + *
> + * RETURN:      None
> + *
> + * DESCRIPTION: External interface.
> + *              Create and open the mapfile and emit all of the collected
> + *              hardware mapping information. Includes: GPIO information,
> + *              Serial information, and a dump of the entire ACPI device tree.
> + *
> + ******************************************************************************/
> +
> +void
> +MpEmitMappingInfo (
> +    void)
> +{
> +    char                    *NewFilename;
> +
> +
> +    /* Mapfile option enabled? */
> +
> +    if (!Gbl_MapfileFlag)
> +    {
> +        return;
> +    }
> +
> +    /* Create/Open a map file */
> +
> +    NewFilename = FlGenerateFilename (Gbl_OutputFilenamePrefix,
> +        FILE_SUFFIX_MAP);
> +    if (!NewFilename)
> +    {
> +        AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
> +            0, 0, 0, 0, NULL, NULL);
> +    }
> +
> +    /* Open the hex file, text mode (closed at compiler exit) */
> +
> +    FlOpenFile (ASL_FILE_MAP_OUTPUT, NewFilename, "w+t");
> +    AslCompilerSignon (ASL_FILE_MAP_OUTPUT);
> +    AslCompilerFileHeader (ASL_FILE_MAP_OUTPUT);
> +
> +    if (!Gbl_GpioList)
> +    {
> +        FlPrintFile (ASL_FILE_MAP_OUTPUT,
> +            "\nNo GPIO devices found\n");
> +    }
> +
> +    if (!Gbl_SerialList)
> +    {
> +        FlPrintFile (ASL_FILE_MAP_OUTPUT,
> +            "\nNo Serial devices found (I2C/SPI/UART)\n");
> +    }
> +
> +    if (!Gbl_GpioList && !Gbl_SerialList)
> +    {
> +        return;
> +    }
> +
> +    /* Headers */
> +
> +    FlPrintFile (ASL_FILE_MAP_OUTPUT, "\nResource Descriptor Connectivity Map\n");
> +    FlPrintFile (ASL_FILE_MAP_OUTPUT,   "------------------------------------\n");
> +
> +    /* Emit GPIO and Serial descriptors, then entire ACPI device tree */
> +
> +    MpEmitGpioInfo ();
> +    MpEmitSerialInfo ();
> +    MpEmitDeviceTree ();
> +
> +    /* Clear the lists - no need to free memory here */
> +
> +    Gbl_SerialList = NULL;
> +    Gbl_GpioList = NULL;
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    MpEmitGpioInfo
> + *
> + * PARAMETERS:  None
> + *
> + * RETURN:      None
> + *
> + * DESCRIPTION: Emit the info about all GPIO devices found during the
> + *              compile or disassembly.
> + *
> + ******************************************************************************/
> +
> +static void
> +MpEmitGpioInfo (
> +    void)
> +{
> +    ACPI_GPIO_INFO          *Info;
> +    char                    *Type;
> +    char                    *PrevDeviceName = NULL;
> +    const char              *Direction;
> +    const char              *Polarity;
> +    char                    *ParentPathname;
> +    const char              *Description;
> +    char                    *HidString;
> +    const AH_DEVICE_ID      *HidInfo;
> +
> +
> +    /* Walk the GPIO descriptor list */
> +
> +    Info = Gbl_GpioList;
> +    while (Info)
> +    {
> +        HidString = MpGetHidViaNamestring (Info->DeviceName);
> +
> +        /* Print header info for the controller itself */
> +
> +        if (!PrevDeviceName ||
> +            ACPI_STRCMP (PrevDeviceName, Info->DeviceName))
> +        {
> +            FlPrintFile (ASL_FILE_MAP_OUTPUT,
> +                "\n\nGPIO Controller:  %-8s  %-28s",
> +                HidString, Info->DeviceName);
> +
> +            HidInfo = AcpiAhMatchHardwareId (HidString);
> +            if (HidInfo)
> +            {
> +                FlPrintFile (ASL_FILE_MAP_OUTPUT, "  // %s",
> +                    HidInfo->Description);
> +            }
> +
> +            FlPrintFile (ASL_FILE_MAP_OUTPUT,
> +                "\n\nPin   Type     Direction    Polarity"
> +                "    Dest _HID  Destination\n");
> +        }
> +
> +        PrevDeviceName = Info->DeviceName;
> +
> +        /* Setup various strings based upon the type (GpioInt or GpioIo) */
> +
> +        switch (Info->Type)
> +        {
> +        case AML_RESOURCE_GPIO_TYPE_INT:
> +
> +            Type = "GpioInt";
> +            Direction = "-Interrupt-";
> +            Polarity = PolarityDecode[Info->Polarity];
> +            break;
> +
> +        case AML_RESOURCE_GPIO_TYPE_IO:
> +
> +            Type = "GpioIo ";
> +            Direction = DirectionDecode[Info->Direction];
> +            Polarity = "          ";
> +            break;
> +
> +        default:
> +            continue;
> +        }
> +
> +        /* Emit the GPIO info */
> +
> +        FlPrintFile (ASL_FILE_MAP_OUTPUT, "%4.4X  %s  %s  %s  ",
> +            Info->PinNumber, Type, Direction, Polarity);
> +
> +        ParentPathname = NULL;
> +        HidString = MpGetConnectionInfo (Info->Op, Info->PinIndex,
> +            &Info->TargetNode, &ParentPathname);
> +        if (HidString)
> +        {
> +            /*
> +             * This is a Connection() field
> +             * Attempt to find all references to the field.
> +             */
> +            FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s   %-28s",
> +                HidString, ParentPathname);
> +
> +            MpXrefDevices (Info);
> +        }
> +        else
> +        {
> +            /*
> +             * For Devices, attempt to get the _HID description string.
> +             * Failing that (many _HIDs are not recognized), attempt to
> +             * get the _DDN description string.
> +             */
> +            HidString = MpGetParentDeviceHid (Info->Op, &Info->TargetNode,
> +                &ParentPathname);
> +
> +            FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s   %-28s",
> +                HidString, ParentPathname);
> +
> +            /* Get the _HID description or _DDN string */
> +
> +            HidInfo = AcpiAhMatchHardwareId (HidString);
> +            if (HidInfo)
> +            {
> +                FlPrintFile (ASL_FILE_MAP_OUTPUT, "  // %s",
> +                    HidInfo->Description);
> +            }
> +            else if ((Description = MpGetDdnValue (ParentPathname)))
> +            {
> +                FlPrintFile (ASL_FILE_MAP_OUTPUT, "  // %s (_DDN)",
> +                    Description);
> +            }
> +        }
> +
> +        FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n");
> +        ACPI_FREE (ParentPathname);
> +        Info = Info->Next;
> +    }
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    MpEmitSerialInfo
> + *
> + * PARAMETERS:  None
> + *
> + * RETURN:      None
> + *
> + * DESCRIPTION: Emit the info about all Serial devices found during the
> + *              compile or disassembly.
> + *
> + ******************************************************************************/
> +
> +static void
> +MpEmitSerialInfo (
> +    void)
> +{
> +    ACPI_SERIAL_INFO        *Info;
> +    char                    *Type;
> +    char                    *ParentPathname;
> +    char                    *PrevDeviceName = NULL;
> +    char                    *HidString;
> +    const AH_DEVICE_ID      *HidInfo;
> +    const char              *Description;
> +    AML_RESOURCE            *Resource;
> +
> +
> +    /* Walk the constructed serial descriptor list */
> +
> +    Info = Gbl_SerialList;
> +    while (Info)
> +    {
> +        Resource = Info->Resource;
> +        switch (Resource->CommonSerialBus.Type)
> +        {
> +        case AML_RESOURCE_I2C_SERIALBUSTYPE:
> +            Type = "I2C ";
> +            break;
> +
> +        case AML_RESOURCE_SPI_SERIALBUSTYPE:
> +            Type = "SPI ";
> +            break;
> +
> +        case AML_RESOURCE_UART_SERIALBUSTYPE:
> +            Type = "UART";
> +            break;
> +
> +        default:
> +            Type = "UNKN";
> +            break;
> +        }
> +
> +        HidString = MpGetHidViaNamestring (Info->DeviceName);
> +
> +        /* Print header info for the controller itself */
> +
> +        if (!PrevDeviceName ||
> +            ACPI_STRCMP (PrevDeviceName, Info->DeviceName))
> +        {
> +            FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\n%s Controller:  ",
> +                Type);
> +            FlPrintFile (ASL_FILE_MAP_OUTPUT, "%-8s  %-28s",
> +                HidString, Info->DeviceName);
> +
> +            HidInfo = AcpiAhMatchHardwareId (HidString);
> +            if (HidInfo)
> +            {
> +                FlPrintFile (ASL_FILE_MAP_OUTPUT, "  // %s",
> +                    HidInfo->Description);
> +            }
> +
> +            FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\n");
> +            FlPrintFile (ASL_FILE_MAP_OUTPUT,
> +                "Type  Address   Speed      Dest _HID  Destination\n");
> +        }
> +
> +        PrevDeviceName = Info->DeviceName;
> +
> +        FlPrintFile (ASL_FILE_MAP_OUTPUT, "%s   %4.4X    %8.8X    ",
> +            Type, Info->Address, Info->Speed);
> +
> +        ParentPathname = NULL;
> +        HidString = MpGetConnectionInfo (Info->Op, 0, &Info->TargetNode,
> +            &ParentPathname);
> +        if (HidString)
> +        {
> +            /*
> +             * This is a Connection() field
> +             * Attempt to find all references to the field.
> +             */
> +            FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s   %-28s",
> +                HidString, ParentPathname);
> +        }
> +        else
> +        {
> +            /* Normal resource template */
> +
> +            HidString = MpGetParentDeviceHid (Info->Op, &Info->TargetNode,
> +                &ParentPathname);
> +            FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s   %-28s",
> +                HidString, ParentPathname);
> +
> +            /* Get the _HID description or _DDN string */
> +
> +            HidInfo = AcpiAhMatchHardwareId (HidString);
> +            if (HidInfo)
> +            {
> +                FlPrintFile (ASL_FILE_MAP_OUTPUT, "  // %s",
> +                    HidInfo->Description);
> +            }
> +            else if ((Description = MpGetDdnValue (ParentPathname)))
> +            {
> +                FlPrintFile (ASL_FILE_MAP_OUTPUT, "  // %s (_DDN)",
> +                    Description);
> +            }
> +        }
> +
> +        FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n");
> +        ACPI_FREE (ParentPathname);
> +        Info = Info->Next;
> +    }
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    MpEmitDeviceTree
> + *
> + * PARAMETERS:  None
> + *
> + * RETURN:      None
> + *
> + * DESCRIPTION: Emit information about all devices within the ACPI namespace.
> + *
> + ******************************************************************************/
> +
> +static void
> +MpEmitDeviceTree (
> +    void)
> +{
> +
> +    FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\nACPI Device Tree\n");
> +    FlPrintFile (ASL_FILE_MAP_OUTPUT,     "----------------\n\n");
> +
> +    FlPrintFile (ASL_FILE_MAP_OUTPUT, "Device Pathname                   "
> +        "_HID      Description\n\n");
> +
> +    /* Walk the namespace from the root */
> +
> +    (void) AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
> +            ACPI_UINT32_MAX, FALSE, MpEmitOneDevice, NULL, NULL, NULL);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    MpEmitOneDevice
> + *
> + * PARAMETERS:  ACPI_NAMESPACE_WALK callback
> + *
> + * RETURN:      Status
> + *
> + * DESCRIPTION: Emit information about one ACPI device in the namespace. Used
> + *              during dump of all device objects within the namespace.
> + *
> + ******************************************************************************/
> +
> +static ACPI_STATUS
> +MpEmitOneDevice (
> +    ACPI_HANDLE             ObjHandle,
> +    UINT32                  NestingLevel,
> +    void                    *Context,
> +    void                    **ReturnValue)
> +{
> +    char                    *DevicePathname;
> +    char                    *DdnString;
> +    char                    *HidString;
> +    const AH_DEVICE_ID      *HidInfo;
> +
> +
> +    /* Device pathname */
> +
> +    DevicePathname = AcpiNsGetExternalPathname (
> +        ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle));
> +
> +    FlPrintFile (ASL_FILE_MAP_OUTPUT, "%-32s", DevicePathname);
> +
> +    /* _HID or _DDN */
> +
> +    HidString = MpGetHidValue (
> +        ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle));
> +    FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s", HidString);
> +
> +    HidInfo = AcpiAhMatchHardwareId (HidString);
> +    if (HidInfo)
> +    {
> +        FlPrintFile (ASL_FILE_MAP_OUTPUT, "    // %s",
> +            HidInfo->Description);
> +    }
> +    else if ((DdnString = MpGetDdnValue (DevicePathname)))
> +    {
> +        FlPrintFile (ASL_FILE_MAP_OUTPUT, "    // %s (_DDN)", DdnString);
> +    }
> +
> +    FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n");
> +    ACPI_FREE (DevicePathname);
> +    return (AE_OK);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    MpXrefDevices
> + *
> + * PARAMETERS:  Info                    - A GPIO Info block
> + *
> + * RETURN:      None
> + *
> + * DESCRIPTION: Cross-reference the parse tree and find all references to the
> + *              specified GPIO device.
> + *
> + ******************************************************************************/
> +
> +static void
> +MpXrefDevices (
> +    ACPI_GPIO_INFO          *Info)
> +{
> +
> +    /* Walk the entire parse tree */
> +
> +    TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
> +        MpNamespaceXrefBegin, NULL, Info);
> +
> +    if (!Info->References)
> +    {
> +        FlPrintFile (ASL_FILE_MAP_OUTPUT, "  // **** No references in table");
> +    }
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    MpNamespaceXrefBegin
> + *
> + * PARAMETERS:  WALK_PARSE_TREE callback
> + *
> + * RETURN:      Status
> + *
> + * DESCRIPTION: Walk parse tree callback used to cross-reference GPIO pins.
> + *
> + ******************************************************************************/
> +
> +static ACPI_STATUS
> +MpNamespaceXrefBegin (
> +    ACPI_PARSE_OBJECT       *Op,
> +    UINT32                  Level,
> +    void                    *Context)
> +{
> +    ACPI_GPIO_INFO          *Info = ACPI_CAST_PTR (ACPI_GPIO_INFO, Context);
> +    const ACPI_OPCODE_INFO  *OpInfo;
> +    char                    *DevicePathname;
> +    ACPI_PARSE_OBJECT       *ParentOp;
> +    char                    *HidString;
> +
> +
> +    ACPI_FUNCTION_TRACE_PTR (MpNamespaceXrefBegin, Op);
> +
> +    /*
> +     * If this node is the actual declaration of a name
> +     * [such as the XXXX name in "Method (XXXX)"],
> +     * we are not interested in it here. We only care about names that
> +     * are references to other objects within the namespace and the
> +     * parent objects of name declarations
> +     */
> +    if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)
> +    {
> +        return (AE_OK);
> +    }
> +
> +    /* We are only interested in opcodes that have an associated name */
> +
> +    OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
> +
> +    if ((OpInfo->Flags & AML_NAMED) ||
> +        (OpInfo->Flags & AML_CREATE))
> +    {
> +        return (AE_OK);
> +    }
> +
> +    if ((Op->Asl.ParseOpcode != PARSEOP_NAMESTRING) &&
> +        (Op->Asl.ParseOpcode != PARSEOP_NAMESEG)    &&
> +        (Op->Asl.ParseOpcode != PARSEOP_METHODCALL))
> +    {
> +        return (AE_OK);
> +    }
> +
> +    if (!Op->Asl.Node)
> +    {
> +        return (AE_OK);
> +    }
> +
> +    ParentOp = Op->Asl.Parent;
> +    if (ParentOp->Asl.ParseOpcode == PARSEOP_FIELD)
> +    {
> +        return (AE_OK);
> +    }
> +
> +    if (Op->Asl.Node == Info->TargetNode)
> +    {
> +        DevicePathname = AcpiNsGetExternalPathname (
> +            Info->TargetNode);
> +
> +        while (ParentOp && (!ParentOp->Asl.Node))
> +        {
> +            ParentOp = ParentOp->Asl.Parent;
> +        }
> +
> +        if (ParentOp)
> +        {
> +            DevicePathname = AcpiNsGetExternalPathname (
> +                ParentOp->Asl.Node);
> +
> +            if (!Info->References)
> +            {
> +                FlPrintFile (ASL_FILE_MAP_OUTPUT, "  // References:");
> +            }
> +
> +            HidString = MpGetHidViaNamestring (DevicePathname);
> +
> +            FlPrintFile (ASL_FILE_MAP_OUTPUT, " %s [%s]",
> +                DevicePathname, HidString);
> +
> +            Info->References++;
> +        }
> +    }
> +
> +    return (AE_OK);
> +}
> diff --git a/src/acpica/source/compiler/aslmaputils.c b/src/acpica/source/compiler/aslmaputils.c
> new file mode 100644
> index 0000000..271a9a8
> --- /dev/null
> +++ b/src/acpica/source/compiler/aslmaputils.c
> @@ -0,0 +1,474 @@
> +/******************************************************************************
> + *
> + * Module Name: aslmaputils - Utilities for the resource descriptor/device maps
> + *
> + *****************************************************************************/
> +
> +/******************************************************************************
> + *
> + * 1. Copyright Notice
> + *
> + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
> + * All rights reserved.
> + *
> + * 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 "acpi.h"
> +#include "accommon.h"
> +#include "acapps.h"
> +#include "aslcompiler.h"
> +#include "aslcompiler.y.h"
> +#include "acinterp.h"
> +#include "acnamesp.h"
> +#include "amlcode.h"
> +
> +/* This module used for application-level code only */
> +
> +#define _COMPONENT          ACPI_COMPILER
> +        ACPI_MODULE_NAME    ("aslmaputils")
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    MpGetHidFromParseTree
> + *
> + * PARAMETERS:  HidNode             - Node for a _HID object
> + *
> + * RETURN:      An _HID string value. Automatically converts _HID integers
> + *              to strings. Never NULL.
> + *
> + * DESCRIPTION: Extract a _HID value from the parse tree, not the namespace.
> + *              Used when a fully initialized namespace is not available.
> + *
> + ******************************************************************************/
> +
> +char *
> +MpGetHidFromParseTree (
> +    ACPI_NAMESPACE_NODE     *HidNode)
> +{
> +    ACPI_PARSE_OBJECT       *Op;
> +    ACPI_PARSE_OBJECT       *Arg;
> +    char                    *HidString;
> +
> +
> +    Op = HidNode->Op;
> +
> +    switch (Op->Asl.ParseOpcode)
> +    {
> +    case PARSEOP_NAME:
> +
> +        Arg = Op->Asl.Child;  /* Get the NameSeg/NameString node */
> +        Arg = Arg->Asl.Next;  /* First peer is the object to be associated with the name */
> +
> +        switch (Arg->Asl.ParseOpcode)
> +        {
> +        case PARSEOP_STRING_LITERAL:
> +
> +            return (Arg->Asl.Value.String);
> +
> +        case PARSEOP_INTEGER:
> +
> +            /* Convert EISAID to a string */
> +
> +            HidString = UtStringCacheCalloc (ACPI_EISAID_STRING_SIZE);
> +            AcpiExEisaIdToString (HidString, Arg->Asl.Value.Integer);
> +            return (HidString);
> +
> +        default:
> +
> +            return ("UNKNOWN");
> +        }
> +
> +    default:
> +        return ("-No HID-");
> +    }
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    MpGetHidValue
> + *
> + * PARAMETERS:  DeviceNode          - Node for parent device
> + *
> + * RETURN:      An _HID string value. Automatically converts _HID integers
> + *              to strings. Never NULL.
> + *
> + * DESCRIPTION: Extract _HID value from within a device scope. Does not
> + *              actually execute a method, just gets the string or integer
> + *              value for the _HID.
> + *
> + ******************************************************************************/
> +
> +char *
> +MpGetHidValue (
> +    ACPI_NAMESPACE_NODE     *DeviceNode)
> +{
> +    ACPI_NAMESPACE_NODE     *HidNode;
> +    char                    *HidString;
> +    ACPI_STATUS             Status;
> +
> +
> +    Status = AcpiNsGetNode (DeviceNode, METHOD_NAME__HID,
> +        ACPI_NS_NO_UPSEARCH, &HidNode);
> +    if (ACPI_FAILURE (Status))
> +    {
> +        goto ErrorExit;
> +    }
> +
> +    /* If only partial namespace, get the _HID from the parse tree */
> +
> +    if (!HidNode->Object)
> +    {
> +        return (MpGetHidFromParseTree (HidNode));
> +    }
> +
> +    /* Handle the different _HID flavors */
> +
> +    switch (HidNode->Type)
> +    {
> +    case ACPI_TYPE_STRING:
> +
> +        return (HidNode->Object->String.Pointer);
> +
> +    case ACPI_TYPE_INTEGER:
> +
> +        /* Convert EISAID to a string */
> +
> +        HidString = UtStringCacheCalloc (ACPI_EISAID_STRING_SIZE);
> +        AcpiExEisaIdToString (HidString, HidNode->Object->Integer.Value);
> +        return (HidString);
> +
> +    case ACPI_TYPE_METHOD:
> +
> +        return ("-Method-");
> +
> +    default:
> +
> +        FlPrintFile (ASL_FILE_MAP_OUTPUT, "BAD HID TYPE: %u", HidNode->Type);
> +        break;
> +    }
> +
> +
> +ErrorExit:
> +    return ("-No HID-");
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    MpGetHidViaNamestring
> + *
> + * PARAMETERS:  DeviceName          - Namepath for parent device
> + *
> + * RETURN:      _HID string. Never NULL.
> + *
> + * DESCRIPTION: Get a _HID value via a device pathname (instead of just simply
> + *              a device node.)
> + *
> + ******************************************************************************/
> +
> +char *
> +MpGetHidViaNamestring (
> +    char                    *DeviceName)
> +{
> +    ACPI_NAMESPACE_NODE     *DeviceNode;
> +    ACPI_STATUS             Status;
> +
> +
> +    Status = AcpiNsGetNode (NULL, DeviceName, ACPI_NS_NO_UPSEARCH,
> +        &DeviceNode);
> +    if (ACPI_FAILURE (Status))
> +    {
> +        goto ErrorExit;
> +    }
> +
> +    return (MpGetHidValue (DeviceNode));
> +
> +
> +ErrorExit:
> +    return ("-No HID-");
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    MpGetParentDeviceHid
> + *
> + * PARAMETERS:  Op                      - Parse Op to be examined
> + *              TargetNode              - Where the field node is returned
> + *              ParentDeviceName        - Where the node path is returned
> + *
> + * RETURN:      _HID string. Never NULL.
> + *
> + * DESCRIPTION: Find the parent Device or Scope Op, get the full pathname to
> + *              the parent, and get the _HID associated with the parent.
> + *
> + ******************************************************************************/
> +
> +char *
> +MpGetParentDeviceHid (
> +    ACPI_PARSE_OBJECT       *Op,
> +    ACPI_NAMESPACE_NODE     **TargetNode,
> +    char                    **ParentDeviceName)
> +{
> +    ACPI_NAMESPACE_NODE     *DeviceNode;
> +
> +
> +    /* Find parent Device() or Scope() Op */
> +
> +    while (Op &&
> +        (Op->Asl.AmlOpcode != AML_DEVICE_OP) &&
> +        (Op->Asl.AmlOpcode != AML_SCOPE_OP))
> +    {
> +        Op = Op->Asl.Parent;
> +    }
> +
> +    if (!Op)
> +    {
> +        FlPrintFile (ASL_FILE_MAP_OUTPUT, " No_Parent_Device ");
> +        goto ErrorExit;
> +    }
> +
> +    /* Get the full pathname to the device and the _HID */
> +
> +    DeviceNode = Op->Asl.Node;
> +    if (!DeviceNode)
> +    {
> +        FlPrintFile (ASL_FILE_MAP_OUTPUT, " No_Device_Node ");
> +        goto ErrorExit;
> +    }
> +
> +    *ParentDeviceName = AcpiNsGetExternalPathname (DeviceNode);
> +    return (MpGetHidValue (DeviceNode));
> +
> +
> +ErrorExit:
> +    return ("-No HID-");
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    MpGetDdnValue
> + *
> + * PARAMETERS:  DeviceName          - Namepath for parent device
> + *
> + * RETURN:      _DDN description string. NULL on failure.
> + *
> + * DESCRIPTION: Execute the _DDN method for the device.
> + *
> + ******************************************************************************/
> +
> +char *
> +MpGetDdnValue (
> +    char                    *DeviceName)
> +{
> +    ACPI_NAMESPACE_NODE     *DeviceNode;
> +    ACPI_NAMESPACE_NODE     *DdnNode;
> +    ACPI_STATUS             Status;
> +
> +
> +    Status = AcpiNsGetNode (NULL, DeviceName, ACPI_NS_NO_UPSEARCH,
> +        &DeviceNode);
> +    if (ACPI_FAILURE (Status))
> +    {
> +        goto ErrorExit;
> +    }
> +
> +    Status = AcpiNsGetNode (DeviceNode, METHOD_NAME__DDN, ACPI_NS_NO_UPSEARCH,
> +        &DdnNode);
> +    if (ACPI_FAILURE (Status))
> +    {
> +        goto ErrorExit;
> +    }
> +
> +    if ((DdnNode->Type != ACPI_TYPE_STRING) ||
> +        !DdnNode->Object)
> +    {
> +        goto ErrorExit;
> +    }
> +
> +    return (DdnNode->Object->String.Pointer);
> +
> +
> +ErrorExit:
> +    return (NULL);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    MpGetConnectionInfo
> + *
> + * PARAMETERS:  Op                      - Parse Op to be examined
> + *              PinIndex                - Index into GPIO PinList
> + *              TargetNode              - Where the field node is returned
> + *              TargetName              - Where the node path is returned
> + *
> + * RETURN:      A substitute _HID string, indicating that the name is actually
> + *              a field. NULL if the Op does not refer to a Connection.
> + *
> + * DESCRIPTION: Get the Field Unit that corresponds to the PinIndex after
> + *              a Connection() invocation.
> + *
> + ******************************************************************************/
> +
> +char *
> +MpGetConnectionInfo (
> +    ACPI_PARSE_OBJECT       *Op,
> +    UINT32                  PinIndex,
> +    ACPI_NAMESPACE_NODE     **TargetNode,
> +    char                    **TargetName)
> +{
> +    ACPI_PARSE_OBJECT       *NextOp;
> +    UINT32                  i;
> +
> +
> +    /*
> +     * Handle Connection() here. Find the next named FieldUnit.
> +     * Note: we look at the ParseOpcode for the compiler, look
> +     * at the AmlOpcode for the disassembler.
> +     */
> +    if ((Op->Asl.AmlOpcode == AML_INT_CONNECTION_OP) ||
> +        (Op->Asl.ParseOpcode == PARSEOP_CONNECTION))
> +    {
> +        /* Find the correct field unit definition */
> +
> +        NextOp = Op;
> +        for (i = 0; i <= PinIndex;)
> +        {
> +            NextOp = NextOp->Asl.Next;
> +            while (NextOp &&
> +                (NextOp->Asl.ParseOpcode != PARSEOP_NAMESEG) &&
> +                (NextOp->Asl.AmlOpcode != AML_INT_NAMEDFIELD_OP))
> +            {
> +                NextOp = NextOp->Asl.Next;
> +            }
> +
> +            if (!NextOp)
> +            {
> +                return ("UNKNOWN");
> +            }
> +
> +            /* Add length of this field to the current pin index */
> +
> +            if (NextOp->Asl.ParseOpcode == PARSEOP_NAMESEG)
> +            {
> +                i += (UINT32) NextOp->Asl.Child->Asl.Value.Integer;
> +            }
> +            else /* AML_INT_NAMEDFIELD_OP */
> +            {
> +                i += (UINT32) NextOp->Asl.Value.Integer;
> +            }
> +        }
> +
> +        /* Return the node and pathname for the field unit */
> +
> +        *TargetNode = NextOp->Asl.Node;
> +        *TargetName = AcpiNsGetExternalPathname (*TargetNode);
> +        return ("-Field-");
> +    }
> +
> +    return (NULL);
> +}
> diff --git a/src/acpica/source/compiler/aslopcodes.c b/src/acpica/source/compiler/aslopcodes.c
> index 0f8d41e..dbb7d33 100644
> --- a/src/acpica/source/compiler/aslopcodes.c
> +++ b/src/acpica/source/compiler/aslopcodes.c
> @@ -474,6 +474,7 @@ OpcDoConnection (
>      ACPI_PARSE_OBJECT       *BufferOp;
>      ACPI_PARSE_OBJECT       *BufferLengthOp;
>      ACPI_PARSE_OBJECT       *BufferDataOp;
> +    ASL_RESOURCE_INFO       Info;
>      UINT8                   State;
>
>
> @@ -488,8 +489,10 @@ OpcDoConnection (
>      BufferLengthOp = BufferOp->Asl.Child;
>      BufferDataOp = BufferLengthOp->Asl.Next;
>
> +    Info.DescriptorTypeOp = BufferDataOp->Asl.Next;
> +    Info.CurrentByteOffset = 0;
>      State = ACPI_RSTATE_NORMAL;
> -    Rnode = RsDoOneResourceDescriptor (BufferDataOp->Asl.Next, 0, &State);
> +    Rnode = RsDoOneResourceDescriptor (&Info, &State);
>      if (!Rnode)
>      {
>          return; /* error */
> diff --git a/src/acpica/source/compiler/aslresource.c b/src/acpica/source/compiler/aslresource.c
> index 37d76a1..09acd24 100644
> --- a/src/acpica/source/compiler/aslresource.c
> +++ b/src/acpica/source/compiler/aslresource.c
> @@ -717,8 +717,7 @@ RsCheckListForDuplicates (
>
>  ASL_RESOURCE_NODE *
>  RsDoOneResourceDescriptor (
> -    ACPI_PARSE_OBJECT       *DescriptorTypeOp,
> -    UINT32                  CurrentByteOffset,
> +    ASL_RESOURCE_INFO       *Info,
>      UINT8                   *State)
>  {
>      ASL_RESOURCE_NODE       *Rnode = NULL;
> @@ -726,36 +725,31 @@ RsDoOneResourceDescriptor (
>
>      /* Construct the resource */
>
> -    switch (DescriptorTypeOp->Asl.ParseOpcode)
> +    switch (Info->DescriptorTypeOp->Asl.ParseOpcode)
>      {
>      case PARSEOP_DMA:
>
> -        Rnode = RsDoDmaDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoDmaDescriptor (Info);
>          break;
>
>      case PARSEOP_FIXEDDMA:
>
> -        Rnode = RsDoFixedDmaDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoFixedDmaDescriptor (Info);
>          break;
>
>      case PARSEOP_DWORDIO:
>
> -        Rnode = RsDoDwordIoDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoDwordIoDescriptor (Info);
>          break;
>
>      case PARSEOP_DWORDMEMORY:
>
> -        Rnode = RsDoDwordMemoryDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoDwordMemoryDescriptor (Info);
>          break;
>
>      case PARSEOP_DWORDSPACE:
>
> -        Rnode = RsDoDwordSpaceDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoDwordSpaceDescriptor (Info);
>          break;
>
>      case PARSEOP_ENDDEPENDENTFN:
> @@ -765,13 +759,13 @@ RsDoOneResourceDescriptor (
>          case ACPI_RSTATE_NORMAL:
>
>              AslError (ASL_ERROR, ASL_MSG_MISSING_STARTDEPENDENT,
> -                DescriptorTypeOp, NULL);
> +                Info->DescriptorTypeOp, NULL);
>              break;
>
>          case ACPI_RSTATE_START_DEPENDENT:
>
>              AslError (ASL_ERROR, ASL_MSG_DEPENDENT_NESTING,
> -                DescriptorTypeOp, NULL);
> +                Info->DescriptorTypeOp, NULL);
>              break;
>
>          case ACPI_RSTATE_DEPENDENT_LIST:
> @@ -781,104 +775,87 @@ RsDoOneResourceDescriptor (
>          }
>
>          *State = ACPI_RSTATE_NORMAL;
> -        Rnode = RsDoEndDependentDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoEndDependentDescriptor (Info);
>          break;
>
>      case PARSEOP_ENDTAG:
>
> -        Rnode = RsDoEndTagDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoEndTagDescriptor (Info);
>          break;
>
>      case PARSEOP_EXTENDEDIO:
>
> -        Rnode = RsDoExtendedIoDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoExtendedIoDescriptor (Info);
>          break;
>
>      case PARSEOP_EXTENDEDMEMORY:
>
> -        Rnode = RsDoExtendedMemoryDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoExtendedMemoryDescriptor (Info);
>          break;
>
>      case PARSEOP_EXTENDEDSPACE:
>
> -        Rnode = RsDoExtendedSpaceDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoExtendedSpaceDescriptor (Info);
>          break;
>
>      case PARSEOP_FIXEDIO:
>
> -        Rnode = RsDoFixedIoDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoFixedIoDescriptor (Info);
>          break;
>
>      case PARSEOP_INTERRUPT:
>
> -        Rnode = RsDoInterruptDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoInterruptDescriptor (Info);
>          break;
>
>      case PARSEOP_IO:
>
> -        Rnode = RsDoIoDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoIoDescriptor (Info);
>          break;
>
>      case PARSEOP_IRQ:
>
> -        Rnode = RsDoIrqDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoIrqDescriptor (Info);
>          break;
>
>      case PARSEOP_IRQNOFLAGS:
>
> -        Rnode = RsDoIrqNoFlagsDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoIrqNoFlagsDescriptor (Info);
>          break;
>
>      case PARSEOP_MEMORY24:
>
> -        Rnode = RsDoMemory24Descriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoMemory24Descriptor (Info);
>          break;
>
>      case PARSEOP_MEMORY32:
>
> -        Rnode = RsDoMemory32Descriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoMemory32Descriptor (Info);
>          break;
>
>      case PARSEOP_MEMORY32FIXED:
>
> -        Rnode = RsDoMemory32FixedDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoMemory32FixedDescriptor (Info);
>          break;
>
>      case PARSEOP_QWORDIO:
>
> -        Rnode = RsDoQwordIoDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoQwordIoDescriptor (Info);
>          break;
>
>      case PARSEOP_QWORDMEMORY:
>
> -        Rnode = RsDoQwordMemoryDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoQwordMemoryDescriptor (Info);
>          break;
>
>      case PARSEOP_QWORDSPACE:
>
> -        Rnode = RsDoQwordSpaceDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoQwordSpaceDescriptor (Info);
>          break;
>
>      case PARSEOP_REGISTER:
>
> -        Rnode = RsDoGeneralRegisterDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoGeneralRegisterDescriptor (Info);
>          break;
>
>      case PARSEOP_STARTDEPENDENTFN:
> @@ -888,7 +865,7 @@ RsDoOneResourceDescriptor (
>          case ACPI_RSTATE_START_DEPENDENT:
>
>              AslError (ASL_ERROR, ASL_MSG_DEPENDENT_NESTING,
> -                DescriptorTypeOp, NULL);
> +                Info->DescriptorTypeOp, NULL);
>              break;
>
>          case ACPI_RSTATE_NORMAL:
> @@ -899,8 +876,7 @@ RsDoOneResourceDescriptor (
>          }
>
>          *State = ACPI_RSTATE_START_DEPENDENT;
> -        Rnode = RsDoStartDependentDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoStartDependentDescriptor (Info);
>          *State = ACPI_RSTATE_DEPENDENT_LIST;
>          break;
>
> @@ -911,7 +887,7 @@ RsDoOneResourceDescriptor (
>          case ACPI_RSTATE_START_DEPENDENT:
>
>              AslError (ASL_ERROR, ASL_MSG_DEPENDENT_NESTING,
> -                DescriptorTypeOp, NULL);
> +                Info->DescriptorTypeOp, NULL);
>              break;
>
>          case ACPI_RSTATE_NORMAL:
> @@ -922,69 +898,58 @@ RsDoOneResourceDescriptor (
>          }
>
>          *State = ACPI_RSTATE_START_DEPENDENT;
> -        Rnode = RsDoStartDependentNoPriDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoStartDependentNoPriDescriptor (Info);
>          *State = ACPI_RSTATE_DEPENDENT_LIST;
>          break;
>
>      case PARSEOP_VENDORLONG:
>
> -        Rnode = RsDoVendorLargeDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoVendorLargeDescriptor (Info);
>          break;
>
>      case PARSEOP_VENDORSHORT:
>
> -        Rnode = RsDoVendorSmallDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoVendorSmallDescriptor (Info);
>          break;
>
>      case PARSEOP_WORDBUSNUMBER:
>
> -        Rnode = RsDoWordBusNumberDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoWordBusNumberDescriptor (Info);
>          break;
>
>      case PARSEOP_WORDIO:
>
> -        Rnode = RsDoWordIoDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoWordIoDescriptor (Info);
>          break;
>
>      case PARSEOP_WORDSPACE:
>
> -        Rnode = RsDoWordSpaceDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoWordSpaceDescriptor (Info);
>          break;
>
>      case PARSEOP_GPIO_INT:
>
> -        Rnode = RsDoGpioIntDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoGpioIntDescriptor (Info);
>          break;
>
>      case PARSEOP_GPIO_IO:
>
> -        Rnode = RsDoGpioIoDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoGpioIoDescriptor (Info);
>          break;
>
>      case PARSEOP_I2C_SERIALBUS:
>
> -        Rnode = RsDoI2cSerialBusDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoI2cSerialBusDescriptor (Info);
>          break;
>
>      case PARSEOP_SPI_SERIALBUS:
>
> -        Rnode = RsDoSpiSerialBusDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoSpiSerialBusDescriptor (Info);
>          break;
>
>      case PARSEOP_UART_SERIALBUS:
>
> -        Rnode = RsDoUartSerialBusDescriptor (DescriptorTypeOp,
> -                    CurrentByteOffset);
> +        Rnode = RsDoUartSerialBusDescriptor (Info);
>          break;
>
>      case PARSEOP_DEFAULT_ARG:
> @@ -995,7 +960,7 @@ RsDoOneResourceDescriptor (
>      default:
>
>          printf ("Unknown resource descriptor type [%s]\n",
> -                    DescriptorTypeOp->Asl.ParseOpName);
> +                    Info->DescriptorTypeOp->Asl.ParseOpName);
>          break;
>      }
>
> @@ -1004,14 +969,14 @@ RsDoOneResourceDescriptor (
>       * This allows the resource to be installed in the namespace so that
>       * references to the descriptor can be resolved.
>       */
> -    DescriptorTypeOp->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
> -    DescriptorTypeOp->Asl.CompileFlags = NODE_IS_RESOURCE_DESC;
> -    DescriptorTypeOp->Asl.Value.Integer = CurrentByteOffset;
> +    Info->DescriptorTypeOp->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
> +    Info->DescriptorTypeOp->Asl.CompileFlags = NODE_IS_RESOURCE_DESC;
> +    Info->DescriptorTypeOp->Asl.Value.Integer = Info->CurrentByteOffset;
>
>      if (Rnode)
>      {
> -        DescriptorTypeOp->Asl.FinalAmlLength = Rnode->BufferLength;
> -        DescriptorTypeOp->Asl.Extra = ((AML_RESOURCE *) Rnode->Buffer)->DescriptorType;
> +        Info->DescriptorTypeOp->Asl.FinalAmlLength = Rnode->BufferLength;
> +        Info->DescriptorTypeOp->Asl.Extra = ((AML_RESOURCE *) Rnode->Buffer)->DescriptorType;
>      }
>
>      return (Rnode);
> @@ -1095,6 +1060,7 @@ RsDoResourceTemplate (
>      ASL_RESOURCE_NODE       HeadRnode;
>      ASL_RESOURCE_NODE       *PreviousRnode;
>      ASL_RESOURCE_NODE       *Rnode;
> +    ASL_RESOURCE_INFO       Info;
>      UINT8                   State;
>
>
> @@ -1127,9 +1093,22 @@ RsDoResourceTemplate (
>      PreviousRnode = &HeadRnode;
>      while (DescriptorTypeOp)
>      {
> +        /* Save information for optional mapfile */
> +
> +        if (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONNECTION)
> +        {
> +            Info.MappingOp = Op->Asl.Parent;
> +        }
> +        else
> +        {
> +            Info.MappingOp = DescriptorTypeOp;
> +        }
> +
> +        Info.DescriptorTypeOp = DescriptorTypeOp;
> +        Info.CurrentByteOffset = CurrentByteOffset;
> +
>          DescriptorTypeOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DESC;
> -        Rnode = RsDoOneResourceDescriptor (DescriptorTypeOp, CurrentByteOffset,
> -                    &State);
> +        Rnode = RsDoOneResourceDescriptor (&Info, &State);
>
>          /*
>           * Update current byte offset to indicate the number of bytes from the
> diff --git a/src/acpica/source/compiler/aslrestype1.c b/src/acpica/source/compiler/aslrestype1.c
> index 8b79447..9991de7 100644
> --- a/src/acpica/source/compiler/aslrestype1.c
> +++ b/src/acpica/source/compiler/aslrestype1.c
> @@ -136,9 +136,7 @@
>   *
>   * FUNCTION:    RsDoEndTagDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -148,8 +146,7 @@
>
>  ASL_RESOURCE_NODE *
>  RsDoEndTagDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ASL_RESOURCE_NODE       *Rnode;
> @@ -170,9 +167,7 @@ RsDoEndTagDescriptor (
>   *
>   * FUNCTION:    RsDoEndDependentDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -182,8 +177,7 @@ RsDoEndTagDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoEndDependentDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ASL_RESOURCE_NODE       *Rnode;
> @@ -202,9 +196,7 @@ RsDoEndDependentDescriptor (
>   *
>   * FUNCTION:    RsDoMemory24Descriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -214,8 +206,7 @@ RsDoEndDependentDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoMemory24Descriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -223,10 +214,12 @@ RsDoMemory24Descriptor (
>      ACPI_PARSE_OBJECT       *MaxOp = NULL;
>      ACPI_PARSE_OBJECT       *LengthOp = NULL;
>      ASL_RESOURCE_NODE       *Rnode;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>      Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_MEMORY24));
>
>      Descriptor = Rnode->Buffer;
> @@ -279,7 +272,7 @@ RsDoMemory24Descriptor (
>
>          case 5: /* Name */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          default:
> @@ -298,7 +291,7 @@ RsDoMemory24Descriptor (
>          Descriptor->Memory24.Maximum,
>          Descriptor->Memory24.AddressLength,
>          Descriptor->Memory24.Alignment,
> -        MinOp, MaxOp, LengthOp, NULL, Op);
> +        MinOp, MaxOp, LengthOp, NULL, Info->DescriptorTypeOp);
>
>      return (Rnode);
>  }
> @@ -308,9 +301,7 @@ RsDoMemory24Descriptor (
>   *
>   * FUNCTION:    RsDoMemory32Descriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -320,8 +311,7 @@ RsDoMemory24Descriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoMemory32Descriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -330,10 +320,12 @@ RsDoMemory32Descriptor (
>      ACPI_PARSE_OBJECT       *LengthOp = NULL;
>      ACPI_PARSE_OBJECT       *AlignOp = NULL;
>      ASL_RESOURCE_NODE       *Rnode;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>      Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_MEMORY32));
>
>      Descriptor = Rnode->Buffer;
> @@ -387,7 +379,7 @@ RsDoMemory32Descriptor (
>
>          case 5: /* Name */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          default:
> @@ -406,7 +398,7 @@ RsDoMemory32Descriptor (
>          Descriptor->Memory32.Maximum,
>          Descriptor->Memory32.AddressLength,
>          Descriptor->Memory32.Alignment,
> -        MinOp, MaxOp, LengthOp, AlignOp, Op);
> +        MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
>
>      return (Rnode);
>  }
> @@ -416,9 +408,7 @@ RsDoMemory32Descriptor (
>   *
>   * FUNCTION:    RsDoMemory32FixedDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -428,16 +418,17 @@ RsDoMemory32Descriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoMemory32FixedDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
>      ASL_RESOURCE_NODE       *Rnode;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>      Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_MEMORY32));
>
>      Descriptor = Rnode->Buffer;
> @@ -473,7 +464,7 @@ RsDoMemory32FixedDescriptor (
>
>          case 3: /* Name */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          default:
> @@ -493,9 +484,7 @@ RsDoMemory32FixedDescriptor (
>   *
>   * FUNCTION:    RsDoStartDependentDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -505,19 +494,21 @@ RsDoMemory32FixedDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoStartDependentDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
>      ASL_RESOURCE_NODE       *Rnode;
>      ASL_RESOURCE_NODE       *PreviousRnode;
>      ASL_RESOURCE_NODE       *NextRnode;
> +    ASL_RESOURCE_INFO       NextInfo;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>      UINT8                   State;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>      Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_START_DEPENDENT));
>
>      PreviousRnode = Rnode;
> @@ -563,8 +554,10 @@ RsDoStartDependentDescriptor (
>
>          default:
>
> -            NextRnode = RsDoOneResourceDescriptor  (InitializerOp,
> -                        CurrentByteOffset, &State);
> +            NextInfo.CurrentByteOffset = CurrentByteOffset;
> +            NextInfo.DescriptorTypeOp = InitializerOp;
> +
> +            NextRnode = RsDoOneResourceDescriptor (&NextInfo, &State);
>
>              /*
>               * Update current byte offset to indicate the number of bytes from the
> @@ -588,9 +581,7 @@ RsDoStartDependentDescriptor (
>   *
>   * FUNCTION:    RsDoStartDependentNoPriDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -600,18 +591,20 @@ RsDoStartDependentDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoStartDependentNoPriDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
>      ASL_RESOURCE_NODE       *Rnode;
>      ASL_RESOURCE_NODE       *PreviousRnode;
>      ASL_RESOURCE_NODE       *NextRnode;
> +    ASL_RESOURCE_INFO       NextInfo;
> +    UINT32                  CurrentByteOffset;
>      UINT8                   State;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>      Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO));
>
>      Descriptor = Rnode->Buffer;
> @@ -628,8 +621,10 @@ RsDoStartDependentNoPriDescriptor (
>      State = ACPI_RSTATE_START_DEPENDENT;
>      while (InitializerOp)
>      {
> -        NextRnode = RsDoOneResourceDescriptor  (InitializerOp,
> -                        CurrentByteOffset, &State);
> +        NextInfo.CurrentByteOffset = CurrentByteOffset;
> +        NextInfo.DescriptorTypeOp = InitializerOp;
> +
> +        NextRnode = RsDoOneResourceDescriptor (&NextInfo, &State);
>
>          /*
>           * Update current byte offset to indicate the number of bytes from the
> @@ -650,9 +645,7 @@ RsDoStartDependentNoPriDescriptor (
>   *
>   * FUNCTION:    RsDoVendorSmallDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -662,8 +655,7 @@ RsDoStartDependentNoPriDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoVendorSmallDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -672,7 +664,7 @@ RsDoVendorSmallDescriptor (
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
>
>      /* Allocate worst case - 7 vendor bytes */
>
> diff --git a/src/acpica/source/compiler/aslrestype1i.c b/src/acpica/source/compiler/aslrestype1i.c
> index f778f5d..319b547 100644
> --- a/src/acpica/source/compiler/aslrestype1i.c
> +++ b/src/acpica/source/compiler/aslrestype1i.c
> @@ -134,9 +134,7 @@
>   *
>   * FUNCTION:    RsDoDmaDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -146,18 +144,19 @@
>
>  ASL_RESOURCE_NODE *
>  RsDoDmaDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
>      ASL_RESOURCE_NODE       *Rnode;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>      UINT8                   DmaChannelMask = 0;
>      UINT8                   DmaChannels = 0;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>      Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_DMA));
>
>      Descriptor = Rnode->Buffer;
> @@ -193,7 +192,7 @@ RsDoDmaDescriptor (
>
>          case 3: /* Name */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          default:
> @@ -255,9 +254,7 @@ RsDoDmaDescriptor (
>   *
>   * FUNCTION:    RsDoFixedDmaDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -267,16 +264,17 @@ RsDoDmaDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoFixedDmaDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
>      ASL_RESOURCE_NODE       *Rnode;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>      Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_DMA));
>
>      Descriptor = Rnode->Buffer;
> @@ -312,7 +310,7 @@ RsDoFixedDmaDescriptor (
>
>          case 3: /* Descriptor Name (optional) */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          default:    /* Ignore any extra nodes */
> @@ -331,9 +329,7 @@ RsDoFixedDmaDescriptor (
>   *
>   * FUNCTION:    RsDoFixedIoDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -343,17 +339,18 @@ RsDoFixedDmaDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoFixedIoDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
>      ACPI_PARSE_OBJECT       *AddressOp = NULL;
>      ASL_RESOURCE_NODE       *Rnode;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>      Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_IO));
>
>      Descriptor = Rnode->Buffer;
> @@ -385,7 +382,7 @@ RsDoFixedIoDescriptor (
>
>          case 2: /* Name */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          default:
> @@ -412,9 +409,7 @@ RsDoFixedIoDescriptor (
>   *
>   * FUNCTION:    RsDoIoDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -424,8 +419,7 @@ RsDoFixedIoDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoIoDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -434,10 +428,12 @@ RsDoIoDescriptor (
>      ACPI_PARSE_OBJECT       *LengthOp = NULL;
>      ACPI_PARSE_OBJECT       *AlignOp = NULL;
>      ASL_RESOURCE_NODE       *Rnode;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>      Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_IO));
>
>      Descriptor = Rnode->Buffer;
> @@ -495,7 +491,7 @@ RsDoIoDescriptor (
>
>          case 5: /* Name */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          default:
> @@ -514,7 +510,7 @@ RsDoIoDescriptor (
>          Descriptor->Io.Maximum,
>          Descriptor->Io.AddressLength,
>          Descriptor->Io.Alignment,
> -        MinOp, MaxOp, LengthOp, AlignOp, Op);
> +        MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
>
>      return (Rnode);
>  }
> @@ -524,9 +520,7 @@ RsDoIoDescriptor (
>   *
>   * FUNCTION:    RsDoIrqDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -536,18 +530,19 @@ RsDoIoDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoIrqDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
>      ASL_RESOURCE_NODE       *Rnode;
>      UINT32                  Interrupts = 0;
>      UINT16                  IrqMask = 0;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>      Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_IRQ));
>
>      /* Length = 3 (with flag byte) */
> @@ -585,7 +580,7 @@ RsDoIrqDescriptor (
>
>          case 3: /* Name */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          default:
> @@ -647,9 +642,7 @@ RsDoIrqDescriptor (
>   *
>   * FUNCTION:    RsDoIrqNoFlagsDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -659,18 +652,19 @@ RsDoIrqDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoIrqNoFlagsDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
>      ASL_RESOURCE_NODE       *Rnode;
>      UINT16                  IrqMask = 0;
>      UINT32                  Interrupts = 0;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>      Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_IRQ_NOFLAGS));
>
>      Descriptor = Rnode->Buffer;
> @@ -685,7 +679,7 @@ RsDoIrqNoFlagsDescriptor (
>          {
>          case 0: /* Name */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          default:
> diff --git a/src/acpica/source/compiler/aslrestype2.c b/src/acpica/source/compiler/aslrestype2.c
> index f6dced2..b639d04 100644
> --- a/src/acpica/source/compiler/aslrestype2.c
> +++ b/src/acpica/source/compiler/aslrestype2.c
> @@ -132,9 +132,7 @@
>   *
>   * FUNCTION:    RsDoGeneralRegisterDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -144,16 +142,17 @@
>
>  ASL_RESOURCE_NODE *
>  RsDoGeneralRegisterDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
>      ASL_RESOURCE_NODE       *Rnode;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>      Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_GENERIC_REGISTER));
>
>      Descriptor = Rnode->Buffer;
> @@ -209,7 +208,7 @@ RsDoGeneralRegisterDescriptor (
>
>          case 5: /* ResourceTag (ACPI 3.0b) */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          default:
> @@ -228,9 +227,7 @@ RsDoGeneralRegisterDescriptor (
>   *
>   * FUNCTION:    RsDoInterruptDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -240,8 +237,7 @@ RsDoGeneralRegisterDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoInterruptDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      AML_RESOURCE            *Rover = NULL;
> @@ -249,13 +245,15 @@ RsDoInterruptDescriptor (
>      ASL_RESOURCE_NODE       *Rnode;
>      UINT16                  StringLength = 0;
>      UINT32                  OptionIndex = 0;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>      BOOLEAN                 HasResSourceIndex = FALSE;
>      UINT8                   ResSourceIndex = 0;
>      UINT8                   *ResSourceString = NULL;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>      StringLength = RsGetStringDataLength (InitializerOp);
>
>      /* Count the interrupt numbers */
> @@ -282,9 +280,9 @@ RsDoInterruptDescriptor (
>          OptionIndex += 4;
>      }
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
>      Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_EXTENDED_IRQ) +
> -                1 + OptionIndex + StringLength);
> +        1 + OptionIndex + StringLength);
>
>      Descriptor = Rnode->Buffer;
>      Descriptor->ExtendedIrq.DescriptorType  = ACPI_RESOURCE_NAME_EXTENDED_IRQ;
> @@ -374,7 +372,7 @@ RsDoInterruptDescriptor (
>
>          case 6: /* ResourceTag */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          default:
> @@ -467,9 +465,7 @@ RsDoInterruptDescriptor (
>   *
>   * FUNCTION:    RsDoVendorLargeDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -479,8 +475,7 @@ RsDoInterruptDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoVendorLargeDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -491,7 +486,7 @@ RsDoVendorLargeDescriptor (
>
>      /* Count the number of data bytes */
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
>      InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
>
>      for (i = 0; InitializerOp; i++)
> @@ -503,7 +498,7 @@ RsDoVendorLargeDescriptor (
>          InitializerOp = InitializerOp->Asl.Next;
>      }
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
>      InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
>      Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_VENDOR_LARGE) + i);
>
> diff --git a/src/acpica/source/compiler/aslrestype2d.c b/src/acpica/source/compiler/aslrestype2d.c
> index 32e9826..f55917c 100644
> --- a/src/acpica/source/compiler/aslrestype2d.c
> +++ b/src/acpica/source/compiler/aslrestype2d.c
> @@ -131,9 +131,7 @@
>   *
>   * FUNCTION:    RsDoDwordIoDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -143,8 +141,7 @@
>
>  ASL_RESOURCE_NODE *
>  RsDoDwordIoDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -156,12 +153,14 @@ RsDoDwordIoDescriptor (
>      UINT16                  StringLength = 0;
>      UINT32                  OptionIndex = 0;
>      UINT8                   *OptionalFields;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>      BOOLEAN                 ResSourceIndex = FALSE;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
>      StringLength = RsGetStringDataLength (InitializerOp);
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      Rnode = RsAllocateResourceNode (
>                  sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
> @@ -316,7 +315,7 @@ RsDoDwordIoDescriptor (
>
>          case 12: /* ResourceTag */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          case 13: /* Type */
> @@ -350,10 +349,10 @@ RsDoDwordIoDescriptor (
>          (UINT64) Descriptor->Address32.AddressLength,
>          (UINT64) Descriptor->Address32.Granularity,
>          Descriptor->Address32.Flags,
> -        MinOp, MaxOp, LengthOp, GranOp, Op);
> +        MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
>
>      Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
> -                            OptionIndex + StringLength;
> +        OptionIndex + StringLength;
>      return (Rnode);
>  }
>
> @@ -362,9 +361,7 @@ RsDoDwordIoDescriptor (
>   *
>   * FUNCTION:    RsDoDwordMemoryDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -374,8 +371,7 @@ RsDoDwordIoDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoDwordMemoryDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -387,12 +383,14 @@ RsDoDwordMemoryDescriptor (
>      UINT8                   *OptionalFields;
>      UINT16                  StringLength = 0;
>      UINT32                  OptionIndex = 0;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>      BOOLEAN                 ResSourceIndex = FALSE;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
>      StringLength = RsGetStringDataLength (InitializerOp);
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      Rnode = RsAllocateResourceNode (
>                  sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
> @@ -551,7 +549,7 @@ RsDoDwordMemoryDescriptor (
>
>          case 13: /* ResourceTag */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>
> @@ -586,10 +584,10 @@ RsDoDwordMemoryDescriptor (
>          (UINT64) Descriptor->Address32.AddressLength,
>          (UINT64) Descriptor->Address32.Granularity,
>          Descriptor->Address32.Flags,
> -        MinOp, MaxOp, LengthOp, GranOp, Op);
> +        MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
>
>      Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
> -                            OptionIndex + StringLength;
> +        OptionIndex + StringLength;
>      return (Rnode);
>  }
>
> @@ -598,9 +596,7 @@ RsDoDwordMemoryDescriptor (
>   *
>   * FUNCTION:    RsDoDwordSpaceDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -610,8 +606,7 @@ RsDoDwordMemoryDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoDwordSpaceDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -623,12 +618,14 @@ RsDoDwordSpaceDescriptor (
>      UINT8                   *OptionalFields;
>      UINT16                  StringLength = 0;
>      UINT32                  OptionIndex = 0;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>      BOOLEAN                 ResSourceIndex = FALSE;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
>      StringLength = RsGetStringDataLength (InitializerOp);
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      Rnode = RsAllocateResourceNode (
>                  sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
> @@ -783,7 +780,7 @@ RsDoDwordSpaceDescriptor (
>
>          case 13: /* ResourceTag */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          default:
> @@ -804,9 +801,9 @@ RsDoDwordSpaceDescriptor (
>          (UINT64) Descriptor->Address32.AddressLength,
>          (UINT64) Descriptor->Address32.Granularity,
>          Descriptor->Address32.Flags,
> -        MinOp, MaxOp, LengthOp, GranOp, Op);
> +        MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
>
>      Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
> -                            OptionIndex + StringLength;
> +        OptionIndex + StringLength;
>      return (Rnode);
>  }
> diff --git a/src/acpica/source/compiler/aslrestype2e.c b/src/acpica/source/compiler/aslrestype2e.c
> index a47085d..1eb682b 100644
> --- a/src/acpica/source/compiler/aslrestype2e.c
> +++ b/src/acpica/source/compiler/aslrestype2e.c
> @@ -130,9 +130,7 @@
>   *
>   * FUNCTION:    RsDoExtendedIoDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -142,8 +140,7 @@
>
>  ASL_RESOURCE_NODE *
>  RsDoExtendedIoDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -153,11 +150,13 @@ RsDoExtendedIoDescriptor (
>      ACPI_PARSE_OBJECT       *GranOp = NULL;
>      ASL_RESOURCE_NODE       *Rnode;
>      UINT16                  StringLength = 0;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
>      StringLength = RsGetStringDataLength (InitializerOp);
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      Rnode = RsAllocateResourceNode (
>                  sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
> @@ -258,7 +257,7 @@ RsDoExtendedIoDescriptor (
>
>          case 11: /* ResourceTag */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          case 12: /* Type */
> @@ -292,9 +291,10 @@ RsDoExtendedIoDescriptor (
>          Descriptor->ExtAddress64.AddressLength,
>          Descriptor->ExtAddress64.Granularity,
>          Descriptor->ExtAddress64.Flags,
> -        MinOp, MaxOp, LengthOp, GranOp, Op);
> +        MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
>
> -    Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
> +    Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
> +        StringLength;
>      return (Rnode);
>  }
>
> @@ -303,9 +303,7 @@ RsDoExtendedIoDescriptor (
>   *
>   * FUNCTION:    RsDoExtendedMemoryDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -315,8 +313,7 @@ RsDoExtendedIoDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoExtendedMemoryDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -326,11 +323,13 @@ RsDoExtendedMemoryDescriptor (
>      ACPI_PARSE_OBJECT       *GranOp = NULL;
>      ASL_RESOURCE_NODE       *Rnode;
>      UINT16                  StringLength = 0;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
>      StringLength = RsGetStringDataLength (InitializerOp);
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      Rnode = RsAllocateResourceNode (
>                  sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
> @@ -438,7 +437,7 @@ RsDoExtendedMemoryDescriptor (
>
>          case 12: /* ResourceTag */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>
> @@ -473,9 +472,10 @@ RsDoExtendedMemoryDescriptor (
>          Descriptor->ExtAddress64.AddressLength,
>          Descriptor->ExtAddress64.Granularity,
>          Descriptor->ExtAddress64.Flags,
> -        MinOp, MaxOp, LengthOp, GranOp, Op);
> +        MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
>
> -    Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
> +    Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
> +        StringLength;
>      return (Rnode);
>  }
>
> @@ -484,9 +484,7 @@ RsDoExtendedMemoryDescriptor (
>   *
>   * FUNCTION:    RsDoExtendedSpaceDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -496,8 +494,7 @@ RsDoExtendedMemoryDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoExtendedSpaceDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -507,11 +504,13 @@ RsDoExtendedSpaceDescriptor (
>      ACPI_PARSE_OBJECT       *GranOp = NULL;
>      ASL_RESOURCE_NODE       *Rnode;
>      UINT16                  StringLength = 0;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
>      StringLength = RsGetStringDataLength (InitializerOp);
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      Rnode = RsAllocateResourceNode (
>                  sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
> @@ -616,7 +615,7 @@ RsDoExtendedSpaceDescriptor (
>
>          case 12: /* ResourceTag */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          default:
> @@ -636,8 +635,9 @@ RsDoExtendedSpaceDescriptor (
>          Descriptor->ExtAddress64.AddressLength,
>          Descriptor->ExtAddress64.Granularity,
>          Descriptor->ExtAddress64.Flags,
> -        MinOp, MaxOp, LengthOp, GranOp, Op);
> +        MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
>
> -    Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
> +    Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
> +        StringLength;
>      return (Rnode);
>  }
> diff --git a/src/acpica/source/compiler/aslrestype2q.c b/src/acpica/source/compiler/aslrestype2q.c
> index 99af42d..8b5020f 100644
> --- a/src/acpica/source/compiler/aslrestype2q.c
> +++ b/src/acpica/source/compiler/aslrestype2q.c
> @@ -131,9 +131,7 @@
>   *
>   * FUNCTION:    RsDoQwordIoDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -143,8 +141,7 @@
>
>  ASL_RESOURCE_NODE *
>  RsDoQwordIoDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -156,12 +153,14 @@ RsDoQwordIoDescriptor (
>      UINT8                   *OptionalFields;
>      UINT16                  StringLength = 0;
>      UINT32                  OptionIndex = 0;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>      BOOLEAN                 ResSourceIndex = FALSE;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
>      StringLength = RsGetStringDataLength (InitializerOp);
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      Rnode = RsAllocateResourceNode (
>                  sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
> @@ -307,7 +306,7 @@ RsDoQwordIoDescriptor (
>
>          case 12: /* ResourceTag */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          case 13: /* Type */
> @@ -341,10 +340,10 @@ RsDoQwordIoDescriptor (
>          Descriptor->Address64.AddressLength,
>          Descriptor->Address64.Granularity,
>          Descriptor->Address64.Flags,
> -        MinOp, MaxOp, LengthOp, GranOp, Op);
> +        MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
>
>      Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
> -                            OptionIndex + StringLength;
> +        OptionIndex + StringLength;
>      return (Rnode);
>  }
>
> @@ -353,9 +352,7 @@ RsDoQwordIoDescriptor (
>   *
>   * FUNCTION:    RsDoQwordMemoryDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -365,8 +362,7 @@ RsDoQwordIoDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoQwordMemoryDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -378,12 +374,14 @@ RsDoQwordMemoryDescriptor (
>      UINT8                   *OptionalFields;
>      UINT16                  StringLength = 0;
>      UINT32                  OptionIndex = 0;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>      BOOLEAN                 ResSourceIndex = FALSE;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
>      StringLength = RsGetStringDataLength (InitializerOp);
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      Rnode = RsAllocateResourceNode (
>                  sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
> @@ -536,7 +534,7 @@ RsDoQwordMemoryDescriptor (
>
>          case 13: /* ResourceTag */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>
> @@ -571,10 +569,10 @@ RsDoQwordMemoryDescriptor (
>          Descriptor->Address64.AddressLength,
>          Descriptor->Address64.Granularity,
>          Descriptor->Address64.Flags,
> -        MinOp, MaxOp, LengthOp, GranOp, Op);
> +        MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
>
>      Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
> -                            OptionIndex + StringLength;
> +        OptionIndex + StringLength;
>      return (Rnode);
>  }
>
> @@ -583,9 +581,7 @@ RsDoQwordMemoryDescriptor (
>   *
>   * FUNCTION:    RsDoQwordSpaceDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -595,8 +591,7 @@ RsDoQwordMemoryDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoQwordSpaceDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -608,12 +603,14 @@ RsDoQwordSpaceDescriptor (
>      UINT8                   *OptionalFields;
>      UINT16                  StringLength = 0;
>      UINT32                  OptionIndex = 0;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>      BOOLEAN                 ResSourceIndex = FALSE;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
>      StringLength = RsGetStringDataLength (InitializerOp);
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      Rnode = RsAllocateResourceNode (
>                  sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
> @@ -763,7 +760,7 @@ RsDoQwordSpaceDescriptor (
>
>          case 13: /* ResourceTag */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          default:
> @@ -783,9 +780,9 @@ RsDoQwordSpaceDescriptor (
>          Descriptor->Address64.AddressLength,
>          Descriptor->Address64.Granularity,
>          Descriptor->Address64.Flags,
> -        MinOp, MaxOp, LengthOp, GranOp, Op);
> +        MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
>
>      Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
> -                            OptionIndex + StringLength;
> +        OptionIndex + StringLength;
>      return (Rnode);
>  }
> diff --git a/src/acpica/source/compiler/aslrestype2s.c b/src/acpica/source/compiler/aslrestype2s.c
> index cc08c47..839aa03 100644
> --- a/src/acpica/source/compiler/aslrestype2s.c
> +++ b/src/acpica/source/compiler/aslrestype2s.c
> @@ -339,9 +339,7 @@ RsGetVendorData (
>   *
>   * FUNCTION:    RsDoGpioIntDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -351,8 +349,7 @@ RsGetVendorData (
>
>  ASL_RESOURCE_NODE *
>  RsDoGpioIntDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -360,14 +357,18 @@ RsDoGpioIntDescriptor (
>      char                    *ResourceSource = NULL;
>      UINT8                   *VendorData = NULL;
>      UINT16                  *InterruptList = NULL;
> +    UINT16                  *PinList = NULL;
>      UINT16                  ResSourceLength;
>      UINT16                  VendorLength;
>      UINT16                  InterruptLength;
>      UINT16                  DescriptorSize;
> +    UINT32                  CurrentByteOffset;
> +    UINT32                  PinCount = 0;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      /*
>       * Calculate lengths for fields that have variable length:
> @@ -395,6 +396,7 @@ RsDoGpioIntDescriptor (
>      /* Build pointers to optional areas */
>
>      InterruptList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_GPIO));
> +    PinList = InterruptList;
>      ResourceSource = ACPI_ADD_PTR (char, InterruptList, InterruptLength);
>      VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength);
>
> @@ -478,7 +480,7 @@ RsDoGpioIntDescriptor (
>
>          case 8: /* Resource Tag (Descriptor Name) */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          case 9: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
> @@ -509,6 +511,7 @@ RsDoGpioIntDescriptor (
>               */
>              *InterruptList = (UINT16) InitializerOp->Asl.Value.Integer;
>              InterruptList++;
> +            PinCount++;
>
>              /* Case 10: First interrupt number in list */
>
> @@ -537,6 +540,7 @@ RsDoGpioIntDescriptor (
>          InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
>      }
>
> +    MpSaveGpioInfo (Info->MappingOp, Descriptor, PinCount, PinList, ResourceSource);
>      return (Rnode);
>  }
>
> @@ -545,9 +549,7 @@ RsDoGpioIntDescriptor (
>   *
>   * FUNCTION:    RsDoGpioIoDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -557,8 +559,7 @@ RsDoGpioIntDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoGpioIoDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -566,14 +567,18 @@ RsDoGpioIoDescriptor (
>      char                    *ResourceSource = NULL;
>      UINT8                   *VendorData = NULL;
>      UINT16                  *InterruptList = NULL;
> +    UINT16                  *PinList = NULL;
>      UINT16                  ResSourceLength;
>      UINT16                  VendorLength;
>      UINT16                  InterruptLength;
>      UINT16                  DescriptorSize;
> +    UINT32                  CurrentByteOffset;
> +    UINT32                  PinCount = 0;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      /*
>       * Calculate lengths for fields that have variable length:
> @@ -584,6 +589,7 @@ RsDoGpioIoDescriptor (
>      ResSourceLength = RsGetStringDataLength (InitializerOp);
>      VendorLength = RsGetBufferDataLength (InitializerOp);
>      InterruptLength = RsGetInterruptDataLength (InitializerOp);
> +    PinList = InterruptList;
>
>      DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO) +
>          ResSourceLength + VendorLength + InterruptLength;
> @@ -601,6 +607,7 @@ RsDoGpioIoDescriptor (
>      /* Build pointers to optional areas */
>
>      InterruptList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_GPIO));
> +    PinList = InterruptList;
>      ResourceSource = ACPI_ADD_PTR (char, InterruptList, InterruptLength);
>      VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength);
>
> @@ -684,7 +691,7 @@ RsDoGpioIoDescriptor (
>
>          case 8: /* Resource Tag (Descriptor Name) */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          case 9: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
> @@ -714,6 +721,7 @@ RsDoGpioIoDescriptor (
>               */
>              *InterruptList = (UINT16) InitializerOp->Asl.Value.Integer;
>              InterruptList++;
> +            PinCount++;
>
>              /* Case 10: First interrupt number in list */
>
> @@ -742,6 +750,7 @@ RsDoGpioIoDescriptor (
>          InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
>      }
>
> +    MpSaveGpioInfo (Info->MappingOp, Descriptor, PinCount, PinList, ResourceSource);
>      return (Rnode);
>  }
>
> @@ -750,9 +759,7 @@ RsDoGpioIoDescriptor (
>   *
>   * FUNCTION:    RsDoI2cSerialBusDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -762,8 +769,7 @@ RsDoGpioIoDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoI2cSerialBusDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -773,10 +779,12 @@ RsDoI2cSerialBusDescriptor (
>      UINT16                  ResSourceLength;
>      UINT16                  VendorLength;
>      UINT16                  DescriptorSize;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      /*
>       * Calculate lengths for fields that have variable length:
> @@ -872,7 +880,7 @@ RsDoI2cSerialBusDescriptor (
>
>          case 7: /* Resource Tag (Descriptor Name) */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          case 8: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
> @@ -889,6 +897,7 @@ RsDoI2cSerialBusDescriptor (
>          InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
>      }
>
> +    MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
>      return (Rnode);
>  }
>
> @@ -897,9 +906,7 @@ RsDoI2cSerialBusDescriptor (
>   *
>   * FUNCTION:    RsDoSpiSerialBusDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -909,8 +916,7 @@ RsDoI2cSerialBusDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoSpiSerialBusDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -920,10 +926,12 @@ RsDoSpiSerialBusDescriptor (
>      UINT16                  ResSourceLength;
>      UINT16                  VendorLength;
>      UINT16                  DescriptorSize;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      /*
>       * Calculate lengths for fields that have variable length:
> @@ -1047,7 +1055,7 @@ RsDoSpiSerialBusDescriptor (
>
>          case 11: /* Resource Tag (Descriptor Name) */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          case 12: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
> @@ -1064,6 +1072,7 @@ RsDoSpiSerialBusDescriptor (
>          InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
>      }
>
> +    MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
>      return (Rnode);
>  }
>
> @@ -1072,9 +1081,7 @@ RsDoSpiSerialBusDescriptor (
>   *
>   * FUNCTION:    RsDoUartSerialBusDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -1084,8 +1091,7 @@ RsDoSpiSerialBusDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoUartSerialBusDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -1095,10 +1101,12 @@ RsDoUartSerialBusDescriptor (
>      UINT16                  ResSourceLength;
>      UINT16                  VendorLength;
>      UINT16                  DescriptorSize;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      /*
>       * Calculate lengths for fields that have variable length:
> @@ -1239,7 +1247,7 @@ RsDoUartSerialBusDescriptor (
>
>          case 12: /* Resource Tag (Descriptor Name) */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          case 13: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
> @@ -1256,5 +1264,6 @@ RsDoUartSerialBusDescriptor (
>          InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
>      }
>
> +    MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
>      return (Rnode);
>  }
> diff --git a/src/acpica/source/compiler/aslrestype2w.c b/src/acpica/source/compiler/aslrestype2w.c
> index 08a0d0f..358b5f3 100644
> --- a/src/acpica/source/compiler/aslrestype2w.c
> +++ b/src/acpica/source/compiler/aslrestype2w.c
> @@ -131,9 +131,7 @@
>   *
>   * FUNCTION:    RsDoWordIoDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -143,8 +141,7 @@
>
>  ASL_RESOURCE_NODE *
>  RsDoWordIoDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -156,12 +153,14 @@ RsDoWordIoDescriptor (
>      UINT8                   *OptionalFields;
>      UINT16                  StringLength = 0;
>      UINT32                  OptionIndex = 0;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>      BOOLEAN                 ResSourceIndex = FALSE;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
>      StringLength = RsGetStringDataLength (InitializerOp);
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      Rnode = RsAllocateResourceNode (
>                  sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
> @@ -307,7 +306,7 @@ RsDoWordIoDescriptor (
>
>          case 12: /* ResourceTag */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          case 13: /* Type */
> @@ -341,10 +340,10 @@ RsDoWordIoDescriptor (
>          (UINT64) Descriptor->Address16.AddressLength,
>          (UINT64) Descriptor->Address16.Granularity,
>          Descriptor->Address16.Flags,
> -        MinOp, MaxOp, LengthOp, GranOp, Op);
> +        MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
>
>      Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
> -                            OptionIndex + StringLength;
> +        OptionIndex + StringLength;
>      return (Rnode);
>  }
>
> @@ -353,9 +352,7 @@ RsDoWordIoDescriptor (
>   *
>   * FUNCTION:    RsDoWordBusNumberDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -365,8 +362,7 @@ RsDoWordIoDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoWordBusNumberDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -378,12 +374,14 @@ RsDoWordBusNumberDescriptor (
>      UINT8                   *OptionalFields;
>      UINT16                  StringLength = 0;
>      UINT32                  OptionIndex = 0;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>      BOOLEAN                 ResSourceIndex = FALSE;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
>      StringLength = RsGetStringDataLength (InitializerOp);
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      Rnode = RsAllocateResourceNode (
>                  sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
> @@ -527,7 +525,7 @@ RsDoWordBusNumberDescriptor (
>
>          case 11: /* ResourceTag */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          default:
> @@ -547,10 +545,10 @@ RsDoWordBusNumberDescriptor (
>          (UINT64) Descriptor->Address16.AddressLength,
>          (UINT64) Descriptor->Address16.Granularity,
>          Descriptor->Address16.Flags,
> -        MinOp, MaxOp, LengthOp, GranOp, Op);
> +        MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
>
>      Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
> -                            OptionIndex + StringLength;
> +        OptionIndex + StringLength;
>      return (Rnode);
>  }
>
> @@ -559,9 +557,7 @@ RsDoWordBusNumberDescriptor (
>   *
>   * FUNCTION:    RsDoWordSpaceDescriptor
>   *
> - * PARAMETERS:  Op                  - Parent resource descriptor parse node
> - *              CurrentByteOffset   - Offset into the resource template AML
> - *                                    buffer (to track references to the desc)
> + * PARAMETERS:  Info                - Parse Op and resource template offset
>   *
>   * RETURN:      Completed resource node
>   *
> @@ -571,8 +567,7 @@ RsDoWordBusNumberDescriptor (
>
>  ASL_RESOURCE_NODE *
>  RsDoWordSpaceDescriptor (
> -    ACPI_PARSE_OBJECT       *Op,
> -    UINT32                  CurrentByteOffset)
> +    ASL_RESOURCE_INFO       *Info)
>  {
>      AML_RESOURCE            *Descriptor;
>      ACPI_PARSE_OBJECT       *InitializerOp;
> @@ -584,12 +579,14 @@ RsDoWordSpaceDescriptor (
>      UINT8                   *OptionalFields;
>      UINT16                  StringLength = 0;
>      UINT32                  OptionIndex = 0;
> +    UINT32                  CurrentByteOffset;
>      UINT32                  i;
>      BOOLEAN                 ResSourceIndex = FALSE;
>
>
> -    InitializerOp = Op->Asl.Child;
> +    InitializerOp = Info->DescriptorTypeOp->Asl.Child;
>      StringLength = RsGetStringDataLength (InitializerOp);
> +    CurrentByteOffset = Info->CurrentByteOffset;
>
>      Rnode = RsAllocateResourceNode (
>                  sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
> @@ -744,7 +741,7 @@ RsDoWordSpaceDescriptor (
>
>          case 13: /* ResourceTag */
>
> -            UtAttachNamepathToOwner (Op, InitializerOp);
> +            UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
>              break;
>
>          default:
> @@ -764,9 +761,9 @@ RsDoWordSpaceDescriptor (
>          (UINT64) Descriptor->Address16.AddressLength,
>          (UINT64) Descriptor->Address16.Granularity,
>          Descriptor->Address16.Flags,
> -        MinOp, MaxOp, LengthOp, GranOp, Op);
> +        MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
>
>      Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
> -                            OptionIndex + StringLength;
> +        OptionIndex + StringLength;
>      return (Rnode);
>  }
> diff --git a/src/acpica/source/compiler/asltree.c b/src/acpica/source/compiler/asltree.c
> index 6b3d444..58f495d 100644
> --- a/src/acpica/source/compiler/asltree.c
> +++ b/src/acpica/source/compiler/asltree.c
> @@ -602,7 +602,6 @@ TrCreateConstantLeafNode (
>          /* Get the simple filename from the full path */
>
>          FlSplitInputPathname (Op->Asl.Filename, &Path, &Filename);
> -        ACPI_FREE (Path);
>          Op->Asl.Value.String = Filename;
>          break;
>
> diff --git a/src/acpica/source/compiler/asltypes.h b/src/acpica/source/compiler/asltypes.h
> index 130c648..931a25e 100644
> --- a/src/acpica/source/compiler/asltypes.h
> +++ b/src/acpica/source/compiler/asltypes.h
> @@ -237,12 +237,13 @@ typedef enum
>      ASL_FILE_C_SOURCE_OUTPUT,
>      ASL_FILE_ASM_INCLUDE_OUTPUT,
>      ASL_FILE_C_INCLUDE_OUTPUT,
> -    ASL_FILE_C_OFFSET_OUTPUT
> +    ASL_FILE_C_OFFSET_OUTPUT,
> +    ASL_FILE_MAP_OUTPUT
>
>  } ASL_FILE_TYPES;
>
>
> -#define ASL_MAX_FILE_TYPE       14
> +#define ASL_MAX_FILE_TYPE       15
>  #define ASL_NUM_FILES           (ASL_MAX_FILE_TYPE + 1)
>
>
> @@ -319,4 +320,35 @@ typedef struct asl_event_info
>  } ASL_EVENT_INFO;
>
>
> +/* Hardware mapping file structures */
> +
> +typedef struct acpi_gpio_info
> +{
> +    struct acpi_gpio_info   *Next;
> +    ACPI_PARSE_OBJECT       *Op;
> +    char                    *DeviceName;
> +    ACPI_NAMESPACE_NODE     *TargetNode;
> +    UINT32                  References;
> +    UINT32                  PinCount;
> +    UINT32                  PinIndex;
> +    UINT16                  PinNumber;
> +    UINT8                   Type;
> +    UINT8                   Direction;
> +    UINT8                   Polarity;
> +
> +} ACPI_GPIO_INFO;
> +
> +typedef struct acpi_serial_info
> +{
> +    struct acpi_serial_info *Next;
> +    ACPI_PARSE_OBJECT       *Op;
> +    char                    *DeviceName;
> +    ACPI_NAMESPACE_NODE     *TargetNode;
> +    AML_RESOURCE            *Resource;
> +    UINT32                  Speed;
> +    UINT16                  Address;
> +
> +} ACPI_SERIAL_INFO;
> +
> +
>  #endif  /* __ASLTYPES_H */
> diff --git a/src/acpica/source/compiler/aslxref.c b/src/acpica/source/compiler/aslxref.c
> index bb0b394..9726b05 100644
> --- a/src/acpica/source/compiler/aslxref.c
> +++ b/src/acpica/source/compiler/aslxref.c
> @@ -157,11 +157,7 @@ XfCheckFieldRange (
>      UINT32                  FieldBitLength,
>      UINT32                  AccessBitWidth);
>
> -static BOOLEAN
> -XfIsObjectParental (
> -    ACPI_PARSE_OBJECT       *MethodOp1,
> -    ACPI_PARSE_OBJECT       *MethodOp2);
> -
> +#ifdef __UNDER_DEVELOPMENT
>  static ACPI_PARSE_OBJECT *
>  XfGetParentMethod (
>      ACPI_PARSE_OBJECT       *Op);
> @@ -171,6 +167,12 @@ XfCheckIllegalReference (
>      ACPI_PARSE_OBJECT       *Op,
>      ACPI_NAMESPACE_NODE     *Node);
>
> +static BOOLEAN
> +XfIsObjectParental (
> +    ACPI_PARSE_OBJECT       *MethodOp1,
> +    ACPI_PARSE_OBJECT       *MethodOp2);
> +#endif
> +
>
>  /*******************************************************************************
>   *
> @@ -350,6 +352,7 @@ XfCheckFieldRange (
>  }
>
>
> +#ifdef __UNDER_DEVELOPMENT
>  /*******************************************************************************
>   *
>   * FUNCTION:    XfIsObjectParental
> @@ -440,6 +443,7 @@ XfGetParentMethod (
>      return (NULL);
>  }
>
> +
>  /*******************************************************************************
>   *
>   * FUNCTION:    XfCheckIllegalReference
> @@ -518,7 +522,9 @@ XfCheckIllegalReference (
>          AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op,
>              Op->Asl.ExternalName);
>      }
> +
>  }
> +#endif
>
>
>  /*******************************************************************************
> @@ -731,9 +737,12 @@ XfNamespaceLocateBegin (
>
>          Node->Flags |= ANOBJ_IS_REFERENCED;
>
> +#ifdef __UNDER_DEVELOPMENT
> +
>          /* Check for an illegal reference */
>
>          XfCheckIllegalReference (Op, Node);
> +#endif
>      }
>
>      /* Attempt to optimize the NamePath */
> @@ -1085,6 +1094,14 @@ XfNamespaceLocateBegin (
>          }
>      }
>
> +    /* 5) Check for a connection object */
> +#if 0
> +    else if (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONNECTION)
> +    {
> +        return_ACPI_STATUS (Status);
> +    }
> +#endif
> +
>      Op->Asl.Node = Node;
>      return_ACPI_STATUS (Status);
>  }
> diff --git a/src/acpica/source/compiler/dtcompile.c b/src/acpica/source/compiler/dtcompile.c
> index c33564a..bd7dcf7 100644
> --- a/src/acpica/source/compiler/dtcompile.c
> +++ b/src/acpica/source/compiler/dtcompile.c
> @@ -509,6 +509,7 @@ DtCompileTable (
>      UINT8                   FieldType;
>      UINT8                   *Buffer;
>      UINT8                   *FlagBuffer = NULL;
> +    char                    *String;
>      UINT32                  CurrentFlagByteOffset = 0;
>      ACPI_STATUS             Status;
>
> @@ -537,8 +538,10 @@ DtCompileTable (
>
>      if (Length > 0)
>      {
> -        Subtable->Buffer = ACPI_CAST_PTR (UINT8, UtStringCacheCalloc (Length));
> +        String = UtStringCacheCalloc (Length);
> +        Subtable->Buffer = ACPI_CAST_PTR (UINT8, String);
>      }
> +
>      Subtable->Length = Length;
>      Subtable->TotalLength = Length;
>      Buffer = Subtable->Buffer;
> diff --git a/src/acpica/source/compiler/dtsubtable.c b/src/acpica/source/compiler/dtsubtable.c
> index e9f530b..47b0b5b 100644
> --- a/src/acpica/source/compiler/dtsubtable.c
> +++ b/src/acpica/source/compiler/dtsubtable.c
> @@ -145,13 +145,15 @@ DtCreateSubtable (
>      DT_SUBTABLE             **RetSubtable)
>  {
>      DT_SUBTABLE             *Subtable;
> +    char                    *String;
>
>
>      Subtable = UtSubtableCacheCalloc ();
>
>      /* Create a new buffer for the subtable data */
>
> -    Subtable->Buffer = ACPI_CAST_PTR (UINT8, UtStringCacheCalloc (Length));
> +    String = UtStringCacheCalloc (Length);
> +    Subtable->Buffer = ACPI_CAST_PTR (UINT8, String);
>      ACPI_MEMCPY (Subtable->Buffer, Buffer, Length);
>
>      Subtable->Length = Length;
> diff --git a/src/acpica/source/components/disassembler/dmbuffer.c b/src/acpica/source/components/disassembler/dmbuffer.c
> index a43497c..755c5d4 100644
> --- a/src/acpica/source/components/disassembler/dmbuffer.c
> +++ b/src/acpica/source/components/disassembler/dmbuffer.c
> @@ -912,6 +912,10 @@ AcpiDmCheckForHardwareId (
>      /* _CID with Package: get the package length, check all elements */
>
>      NextOp = AcpiPsGetDepthNext (NULL, NextOp);
> +    if (!NextOp)
> +    {
> +        return;
> +    }
>
>      /* Don't need to use the length, just walk the peer list */
>
> diff --git a/src/acpica/source/components/disassembler/dmopcode.c b/src/acpica/source/components/disassembler/dmopcode.c
> index d15e215..2a1b1e6 100644
> --- a/src/acpica/source/components/disassembler/dmopcode.c
> +++ b/src/acpica/source/components/disassembler/dmopcode.c
> @@ -1005,7 +1005,9 @@ AcpiDmDisassembleOneOp (
>              Length = (UINT32) Child->Common.Value.Integer;
>
>              Info->Level += 1;
> +            Info->MappingOp = Op;
>              Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE;
> +
>              AcpiDmResourceTemplate (Info, Op->Common.Parent, Aml, Length);
>
>              Info->Level -= 1;
> diff --git a/src/acpica/source/components/disassembler/dmresrc.c b/src/acpica/source/components/disassembler/dmresrc.c
> index 8c0198a..649fe4a 100644
> --- a/src/acpica/source/components/disassembler/dmresrc.c
> +++ b/src/acpica/source/components/disassembler/dmresrc.c
> @@ -331,6 +331,11 @@ AcpiDmResourceTemplate (
>      ACPI_NAMESPACE_NODE     *Node;
>
>
> +    if (Op->Asl.AmlOpcode != AML_FIELD_OP)
> +    {
> +        Info->MappingOp = Op;
> +    }
> +
>      Level = Info->Level;
>      ResourceName = ACPI_DEFAULT_RESNAME;
>      Node = Op->Common.Node;
> @@ -399,7 +404,7 @@ AcpiDmResourceTemplate (
>
>                  /* Go ahead and insert EndDependentFn() */
>
> -                AcpiDmEndDependentDescriptor (Aml, ResourceLength, Level);
> +                AcpiDmEndDependentDescriptor (Info, Aml, ResourceLength, Level);
>
>                  AcpiDmIndent (Level);
>                  AcpiOsPrintf (
> @@ -421,7 +426,7 @@ AcpiDmResourceTemplate (
>          }
>
>          AcpiGbl_DmResourceDispatch [ResourceIndex] (
> -            Aml, ResourceLength, Level);
> +            Info, Aml, ResourceLength, Level);
>
>          /* Descriptor post-processing */
>
> diff --git a/src/acpica/source/components/disassembler/dmresrcl.c b/src/acpica/source/components/disassembler/dmresrcl.c
> index 8db712e..ea2c732 100644
> --- a/src/acpica/source/components/disassembler/dmresrcl.c
> +++ b/src/acpica/source/components/disassembler/dmresrcl.c
> @@ -647,7 +647,8 @@ AcpiDmResourceSource (
>   *
>   * FUNCTION:    AcpiDmWordDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -659,6 +660,7 @@ AcpiDmResourceSource (
>
>  void
>  AcpiDmWordDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -692,7 +694,8 @@ AcpiDmWordDescriptor (
>   *
>   * FUNCTION:    AcpiDmDwordDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -704,6 +707,7 @@ AcpiDmWordDescriptor (
>
>  void
>  AcpiDmDwordDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -737,7 +741,8 @@ AcpiDmDwordDescriptor (
>   *
>   * FUNCTION:    AcpiDmQwordDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -749,6 +754,7 @@ AcpiDmDwordDescriptor (
>
>  void
>  AcpiDmQwordDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -782,7 +788,8 @@ AcpiDmQwordDescriptor (
>   *
>   * FUNCTION:    AcpiDmExtendedDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -794,6 +801,7 @@ AcpiDmQwordDescriptor (
>
>  void
>  AcpiDmExtendedDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -829,7 +837,8 @@ AcpiDmExtendedDescriptor (
>   *
>   * FUNCTION:    AcpiDmMemory24Descriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -841,6 +850,7 @@ AcpiDmExtendedDescriptor (
>
>  void
>  AcpiDmMemory24Descriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -868,7 +878,8 @@ AcpiDmMemory24Descriptor (
>   *
>   * FUNCTION:    AcpiDmMemory32Descriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -880,6 +891,7 @@ AcpiDmMemory24Descriptor (
>
>  void
>  AcpiDmMemory32Descriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -907,7 +919,8 @@ AcpiDmMemory32Descriptor (
>   *
>   * FUNCTION:    AcpiDmFixedMemory32Descriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -919,6 +932,7 @@ AcpiDmMemory32Descriptor (
>
>  void
>  AcpiDmFixedMemory32Descriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -948,7 +962,8 @@ AcpiDmFixedMemory32Descriptor (
>   *
>   * FUNCTION:    AcpiDmGenericRegisterDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -960,6 +975,7 @@ AcpiDmFixedMemory32Descriptor (
>
>  void
>  AcpiDmGenericRegisterDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -1004,7 +1020,8 @@ AcpiDmGenericRegisterDescriptor (
>   *
>   * FUNCTION:    AcpiDmInterruptDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -1016,6 +1033,7 @@ AcpiDmGenericRegisterDescriptor (
>
>  void
>  AcpiDmInterruptDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -1110,7 +1128,8 @@ AcpiDmVendorCommon (
>   *
>   * FUNCTION:    AcpiDmVendorLargeDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -1122,6 +1141,7 @@ AcpiDmVendorCommon (
>
>  void
>  AcpiDmVendorLargeDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> diff --git a/src/acpica/source/components/disassembler/dmresrcl2.c b/src/acpica/source/components/disassembler/dmresrcl2.c
> index d4f7fe7..5c60cd4 100644
> --- a/src/acpica/source/components/disassembler/dmresrcl2.c
> +++ b/src/acpica/source/components/disassembler/dmresrcl2.c
> @@ -127,24 +127,28 @@
>
>  static void
>  AcpiDmI2cSerialBusDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  static void
>  AcpiDmSpiSerialBusDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  static void
>  AcpiDmUartSerialBusDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  static void
>  AcpiDmGpioCommon (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Level);
>
> @@ -239,7 +243,8 @@ Finish:
>   *
>   * FUNCTION:    AcpiDmGpioCommon
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Level               - Current source code indentation level
>   *
>   * RETURN:      None
> @@ -250,12 +255,14 @@ Finish:
>
>  static void
>  AcpiDmGpioCommon (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Level)
>  {
> -    UINT32                  PinCount;
>      UINT16                  *PinList;
>      UINT8                   *VendorData;
> +    char                    *DeviceName = NULL;
> +    UINT32                  PinCount;
>      UINT32                  i;
>
>
> @@ -264,9 +271,8 @@ AcpiDmGpioCommon (
>      AcpiDmIndent (Level + 1);
>      if (Resource->Gpio.ResSourceOffset)
>      {
> -        AcpiUtPrintString (
> -            ACPI_ADD_PTR (char, Resource, Resource->Gpio.ResSourceOffset),
> -            ACPI_UINT16_MAX);
> +        DeviceName = ACPI_ADD_PTR (char, Resource, Resource->Gpio.ResSourceOffset),
> +        AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
>      }
>
>      AcpiOsPrintf (", ");
> @@ -314,6 +320,8 @@ AcpiDmGpioCommon (
>
>      AcpiDmIndent (Level + 1);
>      AcpiOsPrintf ("}\n");
> +
> +    MpSaveGpioInfo (Info->MappingOp, Resource, PinCount, PinList, DeviceName);
>  }
>
>
> @@ -321,7 +329,8 @@ AcpiDmGpioCommon (
>   *
>   * FUNCTION:    AcpiDmGpioIntDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -333,6 +342,7 @@ AcpiDmGpioCommon (
>
>  static void
>  AcpiDmGpioIntDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -363,7 +373,7 @@ AcpiDmGpioIntDescriptor (
>
>      /* Dump the GpioInt/GpioIo common portion of the descriptor */
>
> -    AcpiDmGpioCommon (Resource, Level);
> +    AcpiDmGpioCommon (Info, Resource, Level);
>  }
>
>
> @@ -371,7 +381,8 @@ AcpiDmGpioIntDescriptor (
>   *
>   * FUNCTION:    AcpiDmGpioIoDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -383,6 +394,7 @@ AcpiDmGpioIntDescriptor (
>
>  static void
>  AcpiDmGpioIoDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -415,7 +427,7 @@ AcpiDmGpioIoDescriptor (
>
>      /* Dump the GpioInt/GpioIo common portion of the descriptor */
>
> -    AcpiDmGpioCommon (Resource, Level);
> +    AcpiDmGpioCommon (Info, Resource, Level);
>  }
>
>
> @@ -423,7 +435,8 @@ AcpiDmGpioIoDescriptor (
>   *
>   * FUNCTION:    AcpiDmGpioDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -435,6 +448,7 @@ AcpiDmGpioIoDescriptor (
>
>  void
>  AcpiDmGpioDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -448,12 +462,12 @@ AcpiDmGpioDescriptor (
>      {
>      case AML_RESOURCE_GPIO_TYPE_INT:
>
> -        AcpiDmGpioIntDescriptor (Resource, Length, Level);
> +        AcpiDmGpioIntDescriptor (Info, Resource, Length, Level);
>          break;
>
>      case AML_RESOURCE_GPIO_TYPE_IO:
>
> -        AcpiDmGpioIoDescriptor (Resource, Length, Level);
> +        AcpiDmGpioIoDescriptor (Info, Resource, Length, Level);
>          break;
>
>      default:
> @@ -531,7 +545,8 @@ AcpiDmDumpSerialBusVendorData (
>   *
>   * FUNCTION:    AcpiDmI2cSerialBusDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -543,11 +558,13 @@ AcpiDmDumpSerialBusVendorData (
>
>  static void
>  AcpiDmI2cSerialBusDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
>  {
>      UINT32                  ResourceSourceOffset;
> +    char                    *DeviceName;
>
>
>      /* SlaveAddress, SlaveMode, ConnectionSpeed, AddressingMode */
> @@ -567,9 +584,8 @@ AcpiDmI2cSerialBusDescriptor (
>      ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
>          Resource->CommonSerialBus.TypeDataLength;
>
> -    AcpiUtPrintString (
> -        ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
> -        ACPI_UINT16_MAX);
> +    DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
> +    AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
>
>      /* ResourceSourceIndex, ResourceUsage */
>
> @@ -590,6 +606,8 @@ AcpiDmI2cSerialBusDescriptor (
>      AcpiDmIndent (Level + 1);
>      AcpiDmDumpSerialBusVendorData (Resource, Level);
>      AcpiOsPrintf (")\n");
> +
> +    MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
>  }
>
>
> @@ -597,7 +615,8 @@ AcpiDmI2cSerialBusDescriptor (
>   *
>   * FUNCTION:    AcpiDmSpiSerialBusDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -609,11 +628,13 @@ AcpiDmI2cSerialBusDescriptor (
>
>  static void
>  AcpiDmSpiSerialBusDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
>  {
>      UINT32                  ResourceSourceOffset;
> +    char                    *DeviceName;
>
>
>      /* DeviceSelection, DeviceSelectionPolarity, WireMode, DataBitLength */
> @@ -642,9 +663,8 @@ AcpiDmSpiSerialBusDescriptor (
>      ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
>          Resource->CommonSerialBus.TypeDataLength;
>
> -    AcpiUtPrintString (
> -        ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
> -        ACPI_UINT16_MAX);
> +    DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
> +    AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
>
>      /* ResourceSourceIndex, ResourceUsage */
>
> @@ -665,6 +685,8 @@ AcpiDmSpiSerialBusDescriptor (
>      AcpiDmIndent (Level + 1);
>      AcpiDmDumpSerialBusVendorData (Resource, Level);
>      AcpiOsPrintf (")\n");
> +
> +    MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
>  }
>
>
> @@ -672,7 +694,8 @@ AcpiDmSpiSerialBusDescriptor (
>   *
>   * FUNCTION:    AcpiDmUartSerialBusDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -684,11 +707,13 @@ AcpiDmSpiSerialBusDescriptor (
>
>  static void
>  AcpiDmUartSerialBusDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
>  {
>      UINT32                  ResourceSourceOffset;
> +    char                    *DeviceName;
>
>
>      /* ConnectionSpeed, BitsPerByte, StopBits */
> @@ -720,9 +745,8 @@ AcpiDmUartSerialBusDescriptor (
>      ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
>          Resource->CommonSerialBus.TypeDataLength;
>
> -    AcpiUtPrintString (
> -        ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
> -        ACPI_UINT16_MAX);
> +    DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
> +    AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
>
>      /* ResourceSourceIndex, ResourceUsage */
>
> @@ -743,6 +767,8 @@ AcpiDmUartSerialBusDescriptor (
>      AcpiDmIndent (Level + 1);
>      AcpiDmDumpSerialBusVendorData (Resource, Level);
>      AcpiOsPrintf (")\n");
> +
> +    MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
>  }
>
>
> @@ -750,7 +776,8 @@ AcpiDmUartSerialBusDescriptor (
>   *
>   * FUNCTION:    AcpiDmSerialBusDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -762,13 +789,14 @@ AcpiDmUartSerialBusDescriptor (
>
>  void
>  AcpiDmSerialBusDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
>  {
>
>      SerialBusResourceDispatch [Resource->CommonSerialBus.Type] (
> -        Resource, Length, Level);
> +        Info, Resource, Length, Level);
>  }
>
>  #endif
> diff --git a/src/acpica/source/components/disassembler/dmresrcs.c b/src/acpica/source/components/disassembler/dmresrcs.c
> index 6ec784f..bc28828 100644
> --- a/src/acpica/source/components/disassembler/dmresrcs.c
> +++ b/src/acpica/source/components/disassembler/dmresrcs.c
> @@ -128,7 +128,8 @@
>   *
>   * FUNCTION:    AcpiDmIrqDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -140,6 +141,7 @@
>
>  void
>  AcpiDmIrqDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -173,7 +175,8 @@ AcpiDmIrqDescriptor (
>   *
>   * FUNCTION:    AcpiDmDmaDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -185,6 +188,7 @@ AcpiDmIrqDescriptor (
>
>  void
>  AcpiDmDmaDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -210,7 +214,8 @@ AcpiDmDmaDescriptor (
>   *
>   * FUNCTION:    AcpiDmFixedDmaDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -222,6 +227,7 @@ AcpiDmDmaDescriptor (
>
>  void
>  AcpiDmFixedDmaDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -253,7 +259,8 @@ AcpiDmFixedDmaDescriptor (
>   *
>   * FUNCTION:    AcpiDmIoDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -265,6 +272,7 @@ AcpiDmFixedDmaDescriptor (
>
>  void
>  AcpiDmIoDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -298,7 +306,8 @@ AcpiDmIoDescriptor (
>   *
>   * FUNCTION:    AcpiDmFixedIoDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -310,6 +319,7 @@ AcpiDmIoDescriptor (
>
>  void
>  AcpiDmFixedIoDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -336,7 +346,8 @@ AcpiDmFixedIoDescriptor (
>   *
>   * FUNCTION:    AcpiDmStartDependentDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -348,6 +359,7 @@ AcpiDmFixedIoDescriptor (
>
>  void
>  AcpiDmStartDependentDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -375,7 +387,8 @@ AcpiDmStartDependentDescriptor (
>   *
>   * FUNCTION:    AcpiDmEndDependentDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -387,6 +400,7 @@ AcpiDmStartDependentDescriptor (
>
>  void
>  AcpiDmEndDependentDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> @@ -403,7 +417,8 @@ AcpiDmEndDependentDescriptor (
>   *
>   * FUNCTION:    AcpiDmVendorSmallDescriptor
>   *
> - * PARAMETERS:  Resource            - Pointer to the resource descriptor
> + * PARAMETERS:  Info                - Extra resource info
> + *              Resource            - Pointer to the resource descriptor
>   *              Length              - Length of the descriptor in bytes
>   *              Level               - Current source code indentation level
>   *
> @@ -415,6 +430,7 @@ AcpiDmEndDependentDescriptor (
>
>  void
>  AcpiDmVendorSmallDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level)
> diff --git a/src/acpica/source/components/dispatcher/dsfield.c b/src/acpica/source/components/dispatcher/dsfield.c
> index 2219952..ccf786f 100644
> --- a/src/acpica/source/components/dispatcher/dsfield.c
> +++ b/src/acpica/source/components/dispatcher/dsfield.c
> @@ -463,6 +463,7 @@ AcpiDsGetFieldNames (
>               */
>              Info->ResourceBuffer = NULL;
>              Info->ConnectionNode = NULL;
> +            Info->PinNumberIndex = 0;
>
>              /*
>               * A Connection() is either an actual resource descriptor (buffer)
> @@ -538,6 +539,7 @@ AcpiDsGetFieldNames (
>              }
>
>              Info->FieldBitPosition += Info->FieldBitLength;
> +            Info->PinNumberIndex++; /* Index relative to previous Connection() */
>              break;
>
>          default:
> diff --git a/src/acpica/source/components/events/evgpeinit.c b/src/acpica/source/components/events/evgpeinit.c
> index f512a38..237a96c 100644
> --- a/src/acpica/source/components/events/evgpeinit.c
> +++ b/src/acpica/source/components/events/evgpeinit.c
> @@ -515,6 +515,10 @@ AcpiEvMatchGpeMethod (
>          return_ACPI_STATUS (AE_OK);
>      }
>
> +    /* Disable the GPE in case it's been enabled already. */
> +
> +    (void) AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
> +
>      /*
>       * Add the GPE information from above to the GpeEventInfo block for
>       * use during dispatch of this GPE.
> diff --git a/src/acpica/source/components/events/evregion.c b/src/acpica/source/components/events/evregion.c
> index 886f7ae..029a455 100644
> --- a/src/acpica/source/components/events/evregion.c
> +++ b/src/acpica/source/components/events/evregion.c
> @@ -230,6 +230,7 @@ AcpiEvAddressSpaceDispatch (
>      ACPI_OPERAND_OBJECT     *RegionObj2;
>      void                    *RegionContext = NULL;
>      ACPI_CONNECTION_INFO    *Context;
> +    ACPI_PHYSICAL_ADDRESS   Address;
>
>
>      ACPI_FUNCTION_TRACE (EvAddressSpaceDispatch);
> @@ -319,23 +320,33 @@ AcpiEvAddressSpaceDispatch (
>      /* We have everything we need, we can invoke the address space handler */
>
>      Handler = HandlerDesc->AddressSpace.Handler;
> -
> -    ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
> -        "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
> -        &RegionObj->Region.Handler->AddressSpace, Handler,
> -        ACPI_FORMAT_NATIVE_UINT (RegionObj->Region.Address + RegionOffset),
> -        AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
> +    Address = (RegionObj->Region.Address + RegionOffset);
>
>      /*
>       * Special handling for GenericSerialBus and GeneralPurposeIo:
>       * There are three extra parameters that must be passed to the
>       * handler via the context:
> -     *   1) Connection buffer, a resource template from Connection() op.
> -     *   2) Length of the above buffer.
> -     *   3) Actual access length from the AccessAs() op.
> +     *   1) Connection buffer, a resource template from Connection() op
> +     *   2) Length of the above buffer
> +     *   3) Actual access length from the AccessAs() op
> +     *
> +     * In addition, for GeneralPurposeIo, the Address and BitWidth fields
> +     * are defined as follows:
> +     *   1) Address is the pin number index of the field (bit offset from
> +     *      the previous Connection)
> +     *   2) BitWidth is the actual bit length of the field (number of pins)
>       */
> -    if (((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) ||
> -            (RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO)) &&
> +    if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) &&
> +        Context &&
> +        FieldObj)
> +    {
> +        /* Get the Connection (ResourceTemplate) buffer */
> +
> +        Context->Connection = FieldObj->Field.ResourceBuffer;
> +        Context->Length = FieldObj->Field.ResourceLength;
> +        Context->AccessLength = FieldObj->Field.AccessLength;
> +    }
> +    if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO) &&
>          Context &&
>          FieldObj)
>      {
> @@ -344,8 +355,16 @@ AcpiEvAddressSpaceDispatch (
>          Context->Connection = FieldObj->Field.ResourceBuffer;
>          Context->Length = FieldObj->Field.ResourceLength;
>          Context->AccessLength = FieldObj->Field.AccessLength;
> +        Address = FieldObj->Field.PinNumberIndex;
> +        BitWidth = FieldObj->Field.BitLength;
>      }
>
> +    ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
> +        "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
> +        &RegionObj->Region.Handler->AddressSpace, Handler,
> +        ACPI_FORMAT_NATIVE_UINT (Address),
> +        AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
> +
>      if (!(HandlerDesc->AddressSpace.HandlerFlags &
>              ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))
>      {
> @@ -359,9 +378,8 @@ AcpiEvAddressSpaceDispatch (
>
>      /* Call the handler */
>
> -    Status = Handler (Function,
> -        (RegionObj->Region.Address + RegionOffset), BitWidth, Value,
> -        Context, RegionObj2->Extra.RegionContext);
> +    Status = Handler (Function, Address, BitWidth, Value, Context,
> +        RegionObj2->Extra.RegionContext);
>
>      if (ACPI_FAILURE (Status))
>      {
> diff --git a/src/acpica/source/components/events/evxface.c b/src/acpica/source/components/events/evxface.c
> index 6fdc72e..27fe6f2 100644
> --- a/src/acpica/source/components/events/evxface.c
> +++ b/src/acpica/source/components/events/evxface.c
> @@ -1108,7 +1108,8 @@ AcpiRemoveGpeHandler (
>       * enabled, it should be enabled at this point to restore the
>       * post-initialization configuration.
>       */
> -    if ((Handler->OriginalFlags & ACPI_GPE_DISPATCH_METHOD) &&
> +    if (((Handler->OriginalFlags & ACPI_GPE_DISPATCH_METHOD) ||
> +         (Handler->OriginalFlags & ACPI_GPE_DISPATCH_NOTIFY)) &&
>          Handler->OriginallyEnabled)
>      {
>          (void) AcpiEvAddGpeReference (GpeEventInfo);
> diff --git a/src/acpica/source/components/events/evxfevnt.c b/src/acpica/source/components/events/evxfevnt.c
> index bf6bed8..225ef58 100644
> --- a/src/acpica/source/components/events/evxfevnt.c
> +++ b/src/acpica/source/components/events/evxfevnt.c
> @@ -436,7 +436,9 @@ AcpiGetEventStatus (
>      UINT32                  Event,
>      ACPI_EVENT_STATUS       *EventStatus)
>  {
> -    ACPI_STATUS             Status = AE_OK;
> +    ACPI_STATUS             Status;
> +    ACPI_EVENT_STATUS       LocalEventStatus = 0;
> +    UINT32                  InByte;
>
>
>      ACPI_FUNCTION_TRACE (AcpiGetEventStatus);
> @@ -454,12 +456,43 @@ AcpiGetEventStatus (
>          return_ACPI_STATUS (AE_BAD_PARAMETER);
>      }
>
> -    /* Get the status of the requested fixed event */
> +    /* Fixed event currently can be dispatched? */
> +
> +    if (AcpiGbl_FixedEventHandlers[Event].Handler)
> +    {
> +        LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
> +    }
> +
> +    /* Fixed event currently enabled? */
>
>      Status = AcpiReadBitRegister (
> -                AcpiGbl_FixedEventInfo[Event].StatusRegisterId, EventStatus);
> +                AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &InByte);
> +    if (ACPI_FAILURE (Status))
> +    {
> +        return_ACPI_STATUS (Status);
> +    }
>
> -    return_ACPI_STATUS (Status);
> +    if (InByte)
> +    {
> +        LocalEventStatus |= ACPI_EVENT_FLAG_ENABLED;
> +    }
> +
> +    /* Fixed event currently active? */
> +
> +    Status = AcpiReadBitRegister (
> +                AcpiGbl_FixedEventInfo[Event].StatusRegisterId, &InByte);
> +    if (ACPI_FAILURE (Status))
> +    {
> +        return_ACPI_STATUS (Status);
> +    }
> +
> +    if (InByte)
> +    {
> +        LocalEventStatus |= ACPI_EVENT_FLAG_SET;
> +    }
> +
> +    (*EventStatus) = LocalEventStatus;
> +    return_ACPI_STATUS (AE_OK);
>  }
>
>  ACPI_EXPORT_SYMBOL (AcpiGetEventStatus)
> diff --git a/src/acpica/source/components/executer/exfield.c b/src/acpica/source/components/executer/exfield.c
> index 1263ed7..f0bfb11 100644
> --- a/src/acpica/source/components/executer/exfield.c
> +++ b/src/acpica/source/components/executer/exfield.c
> @@ -345,6 +345,39 @@ AcpiExReadDataFromField (
>          Buffer = &BufferDesc->Integer.Value;
>      }
>
> +    if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
> +        (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO))
> +    {
> +        /*
> +         * For GPIO (GeneralPurposeIo), the Address will be the bit offset
> +         * from the previous Connection() operator, making it effectively a
> +         * pin number index. The BitLength is the length of the field, which
> +         * is thus the number of pins.
> +         */
> +        ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
> +            "GPIO FieldRead [FROM]:  Pin %u Bits %u\n",
> +            ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
> +
> +        /* Lock entire transaction if requested */
> +
> +        AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
> +
> +        /* Perform the write */
> +
> +        Status = AcpiExAccessRegion (ObjDesc, 0,
> +                    (UINT64 *) Buffer, ACPI_READ);
> +        AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
> +        if (ACPI_FAILURE (Status))
> +        {
> +            AcpiUtRemoveReference (BufferDesc);
> +        }
> +        else
> +        {
> +            *RetBufferDesc = BufferDesc;
> +        }
> +        return_ACPI_STATUS (Status);
> +    }
> +
>      ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
>          "FieldRead [TO]:   Obj %p, Type %X, Buf %p, ByteLen %X\n",
>          ObjDesc, ObjDesc->Common.Type, Buffer, (UINT32) Length));
> @@ -518,6 +551,41 @@ AcpiExWriteDataToField (
>          *ResultDesc = BufferDesc;
>          return_ACPI_STATUS (Status);
>      }
> +    else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
> +             (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO))
> +    {
> +        /*
> +         * For GPIO (GeneralPurposeIo), we will bypass the entire field
> +         * mechanism and handoff the bit address and bit width directly to
> +         * the handler. The Address will be the bit offset
> +         * from the previous Connection() operator, making it effectively a
> +         * pin number index. The BitLength is the length of the field, which
> +         * is thus the number of pins.
> +         */
> +        if (SourceDesc->Common.Type != ACPI_TYPE_INTEGER)
> +        {
> +            return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
> +        }
> +
> +        ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
> +            "GPIO FieldWrite [FROM]: (%s:%X), Val %.8X  [TO]:  Pin %u Bits %u\n",
> +            AcpiUtGetTypeName (SourceDesc->Common.Type),
> +            SourceDesc->Common.Type, (UINT32) SourceDesc->Integer.Value,
> +            ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
> +
> +        Buffer = &SourceDesc->Integer.Value;
> +
> +        /* Lock entire transaction if requested */
> +
> +        AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
> +
> +        /* Perform the write */
> +
> +        Status = AcpiExAccessRegion (ObjDesc, 0,
> +                    (UINT64 *) Buffer, ACPI_WRITE);
> +        AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
> +        return_ACPI_STATUS (Status);
> +    }
>
>      /* Get a pointer to the data to be written */
>
> diff --git a/src/acpica/source/components/executer/exprep.c b/src/acpica/source/components/executer/exprep.c
> index f170736..276a77a 100644
> --- a/src/acpica/source/components/executer/exprep.c
> +++ b/src/acpica/source/components/executer/exprep.c
> @@ -587,6 +587,8 @@ AcpiExPrepFieldValue (
>              ObjDesc->Field.ResourceLength = Info->ResourceLength;
>          }
>
> +        ObjDesc->Field.PinNumberIndex = Info->PinNumberIndex;
> +
>          /* Allow full data read from EC address space */
>
>          if ((ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) &&
> diff --git a/src/acpica/source/components/hardware/hwgpe.c b/src/acpica/source/components/hardware/hwgpe.c
> index a777e58..0125685 100644
> --- a/src/acpica/source/components/hardware/hwgpe.c
> +++ b/src/acpica/source/components/hardware/hwgpe.c
> @@ -313,6 +313,14 @@ AcpiHwGetGpeStatus (
>          return (AE_BAD_PARAMETER);
>      }
>
> +    /* GPE currently handled? */
> +
> +    if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) !=
> +            ACPI_GPE_DISPATCH_NONE)
> +    {
> +        LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
> +    }
> +
>      /* Get the info block for the entire GPE register */
>
>      GpeRegisterInfo = GpeEventInfo->RegisterInfo;
> diff --git a/src/acpica/source/components/tables/tbxfroot.c b/src/acpica/source/components/tables/tbxfroot.c
> index 81d08a9..23ab821 100644
> --- a/src/acpica/source/components/tables/tbxfroot.c
> +++ b/src/acpica/source/components/tables/tbxfroot.c
> @@ -126,6 +126,43 @@
>
>  /*******************************************************************************
>   *
> + * FUNCTION:    AcpiTbGetRsdpLength
> + *
> + * PARAMETERS:  Rsdp                - Pointer to RSDP
> + *
> + * RETURN:      Table length
> + *
> + * DESCRIPTION: Get the length of the RSDP
> + *
> + ******************************************************************************/
> +
> +UINT32
> +AcpiTbGetRsdpLength (
> +    ACPI_TABLE_RSDP         *Rsdp)
> +{
> +
> +    if (!ACPI_VALIDATE_RSDP_SIG (Rsdp->Signature))
> +    {
> +        /* BAD Signature */
> +
> +        return (0);
> +    }
> +
> +    /* "Length" field is available if table version >= 2 */
> +
> +    if (Rsdp->Revision >= 2)
> +    {
> +        return (Rsdp->Length);
> +    }
> +    else
> +    {
> +        return (ACPI_RSDP_CHECKSUM_LENGTH);
> +    }
> +}
> +
> +
> +/*******************************************************************************
> + *
>   * FUNCTION:    AcpiTbValidateRsdp
>   *
>   * PARAMETERS:  Rsdp                - Pointer to unvalidated RSDP
> diff --git a/src/acpica/source/include/acdisasm.h b/src/acpica/source/include/acdisasm.h
> index f936128..5189986 100644
> --- a/src/acpica/source/include/acdisasm.h
> +++ b/src/acpica/source/include/acdisasm.h
> @@ -262,6 +262,7 @@ typedef struct acpi_op_walk_info
>      UINT32                  BitOffset;
>      UINT32                  Flags;
>      ACPI_WALK_STATE         *WalkState;
> +    ACPI_PARSE_OBJECT       *MappingOp;
>
>  } ACPI_OP_WALK_INFO;
>
> @@ -279,6 +280,7 @@ ACPI_STATUS (*ASL_WALK_CALLBACK) (
>
>  typedef
>  void (*ACPI_RESOURCE_HANDLER) (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
> @@ -865,72 +867,84 @@ AcpiDmDescriptorName (
>   */
>  void
>  AcpiDmWordDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmDwordDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmExtendedDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmQwordDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmMemory24Descriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmMemory32Descriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmFixedMemory32Descriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmGenericRegisterDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmInterruptDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmVendorLargeDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmGpioDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmSerialBusDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
> @@ -948,48 +962,56 @@ AcpiDmVendorCommon (
>   */
>  void
>  AcpiDmIrqDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmDmaDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmFixedDmaDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmIoDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmFixedIoDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmStartDependentDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmEndDependentDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
>
>  void
>  AcpiDmVendorSmallDescriptor (
> +    ACPI_OP_WALK_INFO       *Info,
>      AML_RESOURCE            *Resource,
>      UINT32                  Length,
>      UINT32                  Level);
> diff --git a/src/acpica/source/include/aclocal.h b/src/acpica/source/include/aclocal.h
> index 1ea772e..2680834 100644
> --- a/src/acpica/source/include/aclocal.h
> +++ b/src/acpica/source/include/aclocal.h
> @@ -363,6 +363,7 @@ typedef struct acpi_create_field_info
>      UINT32                          FieldBitPosition;
>      UINT32                          FieldBitLength;
>      UINT16                          ResourceLength;
> +    UINT16                          PinNumberIndex;
>      UINT8                           FieldFlags;
>      UINT8                           Attribute;
>      UINT8                           FieldType;
> diff --git a/src/acpica/source/include/acnames.h b/src/acpica/source/include/acnames.h
> index 55cbe44..b4fed5e 100644
> --- a/src/acpica/source/include/acnames.h
> +++ b/src/acpica/source/include/acnames.h
> @@ -124,6 +124,7 @@
>  #define METHOD_NAME__CBA        "_CBA"
>  #define METHOD_NAME__CID        "_CID"
>  #define METHOD_NAME__CRS        "_CRS"
> +#define METHOD_NAME__DDN        "_DDN"
>  #define METHOD_NAME__HID        "_HID"
>  #define METHOD_NAME__INI        "_INI"
>  #define METHOD_NAME__PLD        "_PLD"
> diff --git a/src/acpica/source/include/acobject.h b/src/acpica/source/include/acobject.h
> index e90af0b..6e3d0de 100644
> --- a/src/acpica/source/include/acobject.h
> +++ b/src/acpica/source/include/acobject.h
> @@ -410,6 +410,7 @@ typedef struct acpi_object_region_field
>      UINT16                          ResourceLength;
>      union acpi_operand_object       *RegionObj;         /* Containing OpRegion object */
>      UINT8                           *ResourceBuffer;    /* ResourceTemplate for serial regions/fields */
> +    UINT16                          PinNumberIndex;     /* Index relative to previous Connection/Template */
>
>  } ACPI_OBJECT_REGION_FIELD;
>
> diff --git a/src/acpica/source/include/acpixf.h b/src/acpica/source/include/acpixf.h
> index b3182c3..4bffe86 100644
> --- a/src/acpica/source/include/acpixf.h
> +++ b/src/acpica/source/include/acpixf.h
> @@ -118,7 +118,7 @@
>
>  /* Current ACPICA subsystem version in YYYYMMDD format */
>
> -#define ACPI_CA_VERSION                 0x20140828
> +#define ACPI_CA_VERSION                 0x20140926
>
>  #include "acconfig.h"
>  #include "actypes.h"
> diff --git a/src/acpica/source/include/actables.h b/src/acpica/source/include/actables.h
> index b95dd28..bb2a4f3 100644
> --- a/src/acpica/source/include/actables.h
> +++ b/src/acpica/source/include/actables.h
> @@ -124,6 +124,10 @@ AcpiAllocateRootTable (
>  /*
>   * tbxfroot - Root pointer utilities
>   */
> +UINT32
> +AcpiTbGetRsdpLength (
> +    ACPI_TABLE_RSDP         *Rsdp);
> +
>  ACPI_STATUS
>  AcpiTbValidateRsdp (
>      ACPI_TABLE_RSDP         *Rsdp);
> diff --git a/src/acpica/source/include/actypes.h b/src/acpica/source/include/actypes.h
> index b6371ae..227589e 100644
> --- a/src/acpica/source/include/actypes.h
> +++ b/src/acpica/source/include/actypes.h
> @@ -792,14 +792,15 @@ typedef UINT32                          ACPI_EVENT_TYPE;
>   * The encoding of ACPI_EVENT_STATUS is illustrated below.
>   * Note that a set bit (1) indicates the property is TRUE
>   * (e.g. if bit 0 is set then the event is enabled).
> - * +-------------+-+-+-+
> - * |   Bits 31:3 |2|1|0|
> - * +-------------+-+-+-+
> - *          |     | | |
> - *          |     | | +- Enabled?
> - *          |     | +--- Enabled for wake?
> - *          |     +----- Set?
> - *          +----------- <Reserved>
> + * +-------------+-+-+-+-+
> + * |   Bits 31:4 |3|2|1|0|
> + * +-------------+-+-+-+-+
> + *          |     | | | |
> + *          |     | | | +- Enabled?
> + *          |     | | +--- Enabled for wake?
> + *          |     | +----- Set?
> + *          |     +------- Has a handler?
> + *          +------------- <Reserved>
>   */
>  typedef UINT32                          ACPI_EVENT_STATUS;
>
> @@ -807,6 +808,7 @@ typedef UINT32                          ACPI_EVENT_STATUS;
>  #define ACPI_EVENT_FLAG_ENABLED         (ACPI_EVENT_STATUS) 0x01
>  #define ACPI_EVENT_FLAG_WAKE_ENABLED    (ACPI_EVENT_STATUS) 0x02
>  #define ACPI_EVENT_FLAG_SET             (ACPI_EVENT_STATUS) 0x04
> +#define ACPI_EVENT_FLAG_HAS_HANDLER     (ACPI_EVENT_STATUS) 0x08
>
>  /* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */
>
> diff --git a/src/acpica/source/include/amlresrc.h b/src/acpica/source/include/amlresrc.h
> index 3fcd9ed..e54f567 100644
> --- a/src/acpica/source/include/amlresrc.h
> +++ b/src/acpica/source/include/amlresrc.h
> @@ -194,6 +194,14 @@ typedef struct asl_resource_node
>
>  } ASL_RESOURCE_NODE;
>
> +typedef struct asl_resource_info
> +{
> +    ACPI_PARSE_OBJECT               *DescriptorTypeOp;  /* Resource descriptor parse node */
> +    ACPI_PARSE_OBJECT               *MappingOp;         /* Used for mapfile support */
> +    UINT32                          CurrentByteOffset;  /* Offset in resource template */
> +
> +} ASL_RESOURCE_INFO;
> +
>
>  /* Macros used to generate AML resource length fields */
>
> @@ -646,4 +654,50 @@ typedef union aml_resource
>
>  } AML_RESOURCE;
>
> +
> +/* Interfaces used by both the disassembler and compiler */
> +
> +void
> +MpSaveGpioInfo (
> +    ACPI_PARSE_OBJECT       *Op,
> +    AML_RESOURCE            *Resource,
> +    UINT32                  PinCount,
> +    UINT16                  *PinList,
> +    char                    *DeviceName);
> +
> +void
> +MpSaveSerialInfo (
> +    ACPI_PARSE_OBJECT       *Op,
> +    AML_RESOURCE            *Resource,
> +    char                    *DeviceName);
> +
> +char *
> +MpGetHidFromParseTree (
> +    ACPI_NAMESPACE_NODE     *HidNode);
> +
> +char *
> +MpGetHidViaNamestring (
> +    char                    *DeviceName);
> +
> +char *
> +MpGetConnectionInfo (
> +    ACPI_PARSE_OBJECT       *Op,
> +    UINT32                  PinIndex,
> +    ACPI_NAMESPACE_NODE     **TargetNode,
> +    char                    **TargetName);
> +
> +char *
> +MpGetParentDeviceHid (
> +    ACPI_PARSE_OBJECT       *Op,
> +    ACPI_NAMESPACE_NODE     **TargetNode,
> +    char                    **ParentDeviceName);
> +
> +char *
> +MpGetDdnValue (
> +    char                    *DeviceName);
> +
> +char *
> +MpGetHidValue (
> +    ACPI_NAMESPACE_NODE     *DeviceNode);
> +
>  #endif
> diff --git a/src/acpica/source/os_specific/service_layers/osunixxf.c b/src/acpica/source/os_specific/service_layers/osunixxf.c
> index 7f5193d..ccf0015 100644
> --- a/src/acpica/source/os_specific/service_layers/osunixxf.c
> +++ b/src/acpica/source/os_specific/service_layers/osunixxf.c
> @@ -209,6 +209,15 @@ OsEnterLineEditMode (
>      struct termios          LocalTermAttributes;
>
>
> +    TermAttributesWereSet = 0;
> +
> +    /* STDIN must be a terminal */
> +
> +    if (!isatty (STDIN_FILENO))
> +    {
> +        return;
> +    }
> +
>      /* Get and keep the original attributes */
>
>      if (tcgetattr (STDIN_FILENO, &OriginalTermAttributes))
> diff --git a/src/acpica/source/tools/acpiexec/aecommon.h b/src/acpica/source/tools/acpiexec/aecommon.h
> index 5aac8f8..75ca498 100644
> --- a/src/acpica/source/tools/acpiexec/aecommon.h
> +++ b/src/acpica/source/tools/acpiexec/aecommon.h
> @@ -128,6 +128,7 @@
>  #include "acdebug.h"
>  #include "actables.h"
>  #include "acinterp.h"
> +#include "amlresrc.h"
>  #include "acapps.h"
>
>  #include <stdio.h>
> @@ -141,6 +142,7 @@ extern UINT8                AcpiGbl_UseHwReducedFadt;
>  extern BOOLEAN              AcpiGbl_DisplayRegionAccess;
>  extern BOOLEAN              AcpiGbl_DoInterfaceTests;
>  extern BOOLEAN              AcpiGbl_LoadTestTables;
> +extern ACPI_CONNECTION_INFO AeMyContext;
>
>  /* Check for unexpected exceptions */
>
> @@ -268,4 +270,19 @@ AeGlobalEventHandler (
>      UINT32                  EventNumber,
>      void                    *Context);
>
> +/* aeregion */
> +
> +ACPI_STATUS
> +AeInstallDeviceHandlers (
> +    void);
> +
> +void
> +AeInstallRegionHandlers (
> +    void);
> +
> +void
> +AeOverrideRegionHandlers (
> +    void);
> +
> +
>  #endif /* _AECOMMON */
> diff --git a/src/acpica/source/tools/acpiexec/aehandlers.c b/src/acpica/source/tools/acpiexec/aehandlers.c
> index 14b5e90..3773bba 100644
> --- a/src/acpica/source/tools/acpiexec/aehandlers.c
> +++ b/src/acpica/source/tools/acpiexec/aehandlers.c
> @@ -118,6 +118,7 @@
>  #define _COMPONENT          ACPI_TOOLS
>          ACPI_MODULE_NAME    ("aehandlers")
>
> +
>  /* Local prototypes */
>
>  static void
> @@ -158,13 +159,6 @@ AeTableHandler (
>      void                    *Table,
>      void                    *Context);
>
> -static ACPI_STATUS
> -AeRegionInit (
> -    ACPI_HANDLE             RegionHandle,
> -    UINT32                  Function,
> -    void                    *HandlerContext,
> -    void                    **RegionContext);
> -
>  static void
>  AeAttachedDataHandler (
>      ACPI_HANDLE             Object,
> @@ -180,24 +174,6 @@ AeInterfaceHandler (
>      ACPI_STRING             InterfaceName,
>      UINT32                  Supported);
>
> -static ACPI_STATUS
> -AeInstallEcHandler (
> -    ACPI_HANDLE             ObjHandle,
> -    UINT32                  Level,
> -    void                    *Context,
> -    void                    **ReturnValue);
> -
> -static ACPI_STATUS
> -AeInstallPciHandler (
> -    ACPI_HANDLE             ObjHandle,
> -    UINT32                  Level,
> -    void                    *Context,
> -    void                    **ReturnValue);
> -
> -static ACPI_STATUS
> -AeInstallDeviceHandlers (
> -    void);
> -
>  #if (!ACPI_REDUCED_HARDWARE)
>  static UINT32
>  AeEventHandler (
> @@ -218,48 +194,6 @@ static char                *TableEvents[] =
>
>  static UINT32               SigintCount = 0;
>  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.
> - * 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_PCI_CONFIG,
> -    ACPI_ADR_SPACE_EC
> -};
> -
> -/*
> - * We will install handlers for some of the various address space IDs.
> - * Test one user-defined address space (used by aslts).
> - */
> -#define ACPI_ADR_SPACE_USER_DEFINED1        0x80
> -#define ACPI_ADR_SPACE_USER_DEFINED2        0xE4
> -
> -static ACPI_ADR_SPACE_TYPE  SpaceIdList[] =
> -{
> -    ACPI_ADR_SPACE_SMBUS,
> -    ACPI_ADR_SPACE_CMOS,
> -    ACPI_ADR_SPACE_PCI_BAR_TARGET,
> -    ACPI_ADR_SPACE_IPMI,
> -    ACPI_ADR_SPACE_GPIO,
> -    ACPI_ADR_SPACE_GSBUS,
> -    ACPI_ADR_SPACE_FIXED_HARDWARE,
> -    ACPI_ADR_SPACE_USER_DEFINED1,
> -    ACPI_ADR_SPACE_USER_DEFINED2
> -};
> -
> -static ACPI_CONNECTION_INFO   AeMyContext;
>
>
>  /******************************************************************************
> @@ -767,39 +701,6 @@ AeSciHandler (
>  #endif /* !ACPI_REDUCED_HARDWARE */
>
>
> -/******************************************************************************
> - *
> - * FUNCTION:    AeRegionInit
> - *
> - * PARAMETERS:  None
> - *
> - * RETURN:      Status
> - *
> - * DESCRIPTION: Opregion init function.
> - *
> - *****************************************************************************/
> -
> -static ACPI_STATUS
> -AeRegionInit (
> -    ACPI_HANDLE                 RegionHandle,
> -    UINT32                      Function,
> -    void                        *HandlerContext,
> -    void                        **RegionContext)
> -{
> -
> -    if (Function == ACPI_REGION_DEACTIVATE)
> -    {
> -        *RegionContext = NULL;
> -    }
> -    else
> -    {
> -        *RegionContext = RegionHandle;
> -    }
> -
> -    return (AE_OK);
> -}
> -
> -
>  /*******************************************************************************
>   *
>   * FUNCTION:    AeInstallSciHandler
> @@ -845,93 +746,6 @@ AeInstallSciHandler (
>  }
>
>
> -/*******************************************************************************
> - *
> - * FUNCTION:    AeInstallDeviceHandlers, AeInstallEcHandler,
> - *              AeInstallPciHandler
> - *
> - * PARAMETERS:  ACPI_WALK_NAMESPACE callback
> - *
> - * RETURN:      Status
> - *
> - * DESCRIPTION: Walk entire namespace, install a handler for every EC
> - *              and PCI device found.
> - *
> - ******************************************************************************/
> -
> -static ACPI_STATUS
> -AeInstallEcHandler (
> -    ACPI_HANDLE             ObjHandle,
> -    UINT32                  Level,
> -    void                    *Context,
> -    void                    **ReturnValue)
> -{
> -    ACPI_STATUS             Status;
> -
> -
> -    /* Install the handler for this EC device */
> -
> -    Status = AcpiInstallAddressSpaceHandler (ObjHandle, ACPI_ADR_SPACE_EC,
> -        AeRegionHandler, AeRegionInit, &AeMyContext);
> -    if (ACPI_FAILURE (Status))
> -    {
> -        ACPI_EXCEPTION ((AE_INFO, Status,
> -            "Could not install an OpRegion handler for EC device (%p)",
> -            ObjHandle));
> -    }
> -
> -    return (Status);
> -}
> -
> -static ACPI_STATUS
> -AeInstallPciHandler (
> -    ACPI_HANDLE             ObjHandle,
> -    UINT32                  Level,
> -    void                    *Context,
> -    void                    **ReturnValue)
> -{
> -    ACPI_STATUS             Status;
> -
> -
> -    /* Install memory and I/O handlers for the PCI device */
> -
> -    Status = AcpiInstallAddressSpaceHandler (ObjHandle, ACPI_ADR_SPACE_SYSTEM_IO,
> -        AeRegionHandler, AeRegionInit, &AeMyContext);
> -    if (ACPI_FAILURE (Status))
> -    {
> -        ACPI_EXCEPTION ((AE_INFO, Status,
> -            "Could not install an OpRegion handler for PCI device (%p)",
> -            ObjHandle));
> -    }
> -
> -    Status = AcpiInstallAddressSpaceHandler (ObjHandle, ACPI_ADR_SPACE_SYSTEM_MEMORY,
> -        AeRegionHandler, AeRegionInit, &AeMyContext);
> -    if (ACPI_FAILURE (Status))
> -    {
> -        ACPI_EXCEPTION ((AE_INFO, Status,
> -            "Could not install an OpRegion handler for PCI device (%p)",
> -            ObjHandle));
> -    }
> -
> -    return (AE_CTRL_TERMINATE);
> -}
> -
> -static ACPI_STATUS
> -AeInstallDeviceHandlers (
> -    void)
> -{
> -
> -    /* Find all Embedded Controller devices */
> -
> -    AcpiGetDevices ("PNP0C09", AeInstallEcHandler, NULL, NULL);
> -
> -    /* Install a PCI handler */
> -
> -    AcpiGetDevices ("PNP0A08", AeInstallPciHandler, NULL, NULL);
> -    return (AE_OK);
> -}
> -
> -
>  /******************************************************************************
>   *
>   * FUNCTION:    AeInstallLateHandlers
> @@ -949,7 +763,6 @@ AeInstallLateHandlers (
>      void)
>  {
>      ACPI_STATUS             Status;
> -    UINT32                  i;
>
>
>  #if (!ACPI_REDUCED_HARDWARE)
> @@ -985,22 +798,7 @@ AeInstallLateHandlers (
>       * Install handlers for some of the "device driver" address spaces
>       * such as SMBus, etc.
>       */
> -    for (i = 0; i < ACPI_ARRAY_LENGTH (SpaceIdList); i++)
> -    {
> -        /* Install handler at the root object */
> -
> -        Status = AcpiInstallAddressSpaceHandler (ACPI_ROOT_OBJECT,
> -                    SpaceIdList[i], AeRegionHandler,
> -                    AeRegionInit, &AeMyContext);
> -        if (ACPI_FAILURE (Status))
> -        {
> -            ACPI_EXCEPTION ((AE_INFO, Status,
> -                "Could not install an OpRegion handler for %s space(%u)",
> -                AcpiUtGetRegionName((UINT8) SpaceIdList[i]), SpaceIdList[i]));
> -            return (Status);
> -        }
> -    }
> -
> +    AeInstallRegionHandlers ();
>      return (AE_OK);
>  }
>
> @@ -1025,7 +823,6 @@ AeInstallEarlyHandlers (
>      void)
>  {
>      ACPI_STATUS             Status;
> -    UINT32                  i;
>      ACPI_HANDLE             Handle;
>
>
> @@ -1186,22 +983,7 @@ AeInstallEarlyHandlers (
>       * Install handlers that will override the default handlers for some of
>       * the space IDs.
>       */
> -    for (i = 0; i < ACPI_ARRAY_LENGTH (DefaultSpaceIdList); i++)
> -    {
> -        /* Install handler at the root object */
> -
> -        Status = AcpiInstallAddressSpaceHandler (ACPI_ROOT_OBJECT,
> -                    DefaultSpaceIdList[i], AeRegionHandler,
> -                    AeRegionInit, &AeMyContext);
> -        if (ACPI_FAILURE (Status))
> -        {
> -            ACPI_EXCEPTION ((AE_INFO, Status,
> -                "Could not install a default OpRegion handler for %s space(%u)",
> -                AcpiUtGetRegionName ((UINT8) DefaultSpaceIdList[i]),
> -                DefaultSpaceIdList[i]));
> -            return (Status);
> -        }
> -    }
> +    AeOverrideRegionHandlers ();
>
>      /*
>       * Initialize the global Region Handler space
> @@ -1209,584 +991,5 @@ AeInstallEarlyHandlers (
>       */
>      AeRegions.NumberOfRegions = 0;
>      AeRegions.RegionList = NULL;
> -    return (Status);
> -}
> -
> -
> -/******************************************************************************
> - *
> - * FUNCTION:    AeRegionHandler
> - *
> - * PARAMETERS:  Standard region handler parameters
> - *
> - * RETURN:      Status
> - *
> - * DESCRIPTION: Test handler - Handles some dummy regions via memory that can
> - *              be manipulated in Ring 3. Simulates actual reads and writes.
> - *
> - *****************************************************************************/
> -
> -ACPI_STATUS
> -AeRegionHandler (
> -    UINT32                  Function,
> -    ACPI_PHYSICAL_ADDRESS   Address,
> -    UINT32                  BitWidth,
> -    UINT64                  *Value,
> -    void                    *HandlerContext,
> -    void                    *RegionContext)
> -{
> -
> -    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;
> -    UINT32                  Value1;
> -    UINT32                  Value2;
> -    ACPI_RESOURCE           *Resource;
> -
> -
> -    ACPI_FUNCTION_NAME (AeRegionHandler);
> -
> -    /*
> -     * If the object is not a region, simply return
> -     */
> -    if (RegionObject->Region.Type != ACPI_TYPE_REGION)
> -    {
> -        return (AE_OK);
> -    }
> -
> -    /* Check that we actually got back our context parameter */
> -
> -    if (HandlerContext != &AeMyContext)
> -    {
> -        printf ("Region handler received incorrect context %p, should be %p\n",
> -            HandlerContext, &AeMyContext);
> -    }
> -
> -    MyContext = ACPI_CAST_PTR (ACPI_CONNECTION_INFO, HandlerContext);
> -
> -    /*
> -     * Find the region's address space and length before searching
> -     * the linked list.
> -     */
> -    BaseAddress = RegionObject->Region.Address;
> -    Length = (ACPI_SIZE) RegionObject->Region.Length;
> -    SpaceId = RegionObject->Region.SpaceId;
> -
> -    ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Operation Region request on %s at 0x%X\n",
> -            AcpiUtGetRegionName (RegionObject->Region.SpaceId),
> -            (UINT32) Address));
> -
> -    /*
> -     * Region support can be disabled with the -do option.
> -     * We use this to support dynamically loaded tables where we pass a valid
> -     * address to the AML.
> -     */
> -    if (AcpiGbl_DbOpt_NoRegionSupport)
> -    {
> -        BufferValue = ACPI_TO_POINTER (Address);
> -        ByteWidth = (BitWidth / 8);
> -
> -        if (BitWidth % 8)
> -        {
> -            ByteWidth += 1;
> -        }
> -        goto DoFunction;
> -    }
> -
> -    switch (SpaceId)
> -    {
> -    case ACPI_ADR_SPACE_SYSTEM_IO:
> -        /*
> -         * For I/O space, exercise the port validation
> -         * Note: ReadPort currently always returns all ones, length=BitLength
> -         */
> -        switch (Function & ACPI_IO_MASK)
> -        {
> -        case ACPI_READ:
> -
> -            if (BitWidth == 64)
> -            {
> -                /* Split the 64-bit request into two 32-bit requests */
> -
> -                Status = AcpiHwReadPort (Address, &Value1, 32);
> -                AE_CHECK_OK (AcpiHwReadPort, Status);
> -                Status = AcpiHwReadPort (Address+4, &Value2, 32);
> -                AE_CHECK_OK (AcpiHwReadPort, Status);
> -
> -                *Value = Value1 | ((UINT64) Value2 << 32);
> -            }
> -            else
> -            {
> -                Status = AcpiHwReadPort (Address, &Value1, BitWidth);
> -                AE_CHECK_OK (AcpiHwReadPort, Status);
> -                *Value = (UINT64) Value1;
> -            }
> -            break;
> -
> -        case ACPI_WRITE:
> -
> -            if (BitWidth == 64)
> -            {
> -                /* Split the 64-bit request into two 32-bit requests */
> -
> -                Status = AcpiHwWritePort (Address, ACPI_LODWORD (*Value), 32);
> -                AE_CHECK_OK (AcpiHwWritePort, Status);
> -                Status = AcpiHwWritePort (Address+4, ACPI_HIDWORD (*Value), 32);
> -                AE_CHECK_OK (AcpiHwWritePort, Status);
> -            }
> -            else
> -            {
> -                Status = AcpiHwWritePort (Address, (UINT32) *Value, BitWidth);
> -                AE_CHECK_OK (AcpiHwWritePort, Status);
> -            }
> -            break;
> -
> -        default:
> -
> -            Status = AE_BAD_PARAMETER;
> -            break;
> -        }
> -
> -        if (ACPI_FAILURE (Status))
> -        {
> -            return (Status);
> -        }
> -
> -        /* Now go ahead and simulate the hardware */
> -        break;
> -
> -    /*
> -     * SMBus and GenericSerialBus support the various bidirectional
> -     * protocols.
> -     */
> -    case ACPI_ADR_SPACE_SMBUS:
> -    case ACPI_ADR_SPACE_GSBUS:  /* ACPI 5.0 */
> -
> -        Length = 0;
> -
> -        switch (Function & ACPI_IO_MASK)
> -        {
> -        case ACPI_READ:
> -
> -            switch (Function >> 16)
> -            {
> -            case AML_FIELD_ATTRIB_QUICK:
> -
> -                Length = 0;
> -                break;
> -
> -            case AML_FIELD_ATTRIB_SEND_RCV:
> -            case AML_FIELD_ATTRIB_BYTE:
> -
> -                Length = 1;
> -                break;
> -
> -            case AML_FIELD_ATTRIB_WORD:
> -            case AML_FIELD_ATTRIB_WORD_CALL:
> -
> -                Length = 2;
> -                break;
> -
> -            case AML_FIELD_ATTRIB_BLOCK:
> -            case AML_FIELD_ATTRIB_BLOCK_CALL:
> -
> -                Length = 32;
> -                break;
> -
> -            case AML_FIELD_ATTRIB_MULTIBYTE:
> -            case AML_FIELD_ATTRIB_RAW_BYTES:
> -            case AML_FIELD_ATTRIB_RAW_PROCESS:
> -
> -                Length = MyContext->AccessLength;
> -                break;
> -
> -            default:
> -
> -                break;
> -            }
> -            break;
> -
> -        case ACPI_WRITE:
> -
> -            switch (Function >> 16)
> -            {
> -            case AML_FIELD_ATTRIB_QUICK:
> -            case AML_FIELD_ATTRIB_SEND_RCV:
> -            case AML_FIELD_ATTRIB_BYTE:
> -            case AML_FIELD_ATTRIB_WORD:
> -            case AML_FIELD_ATTRIB_BLOCK:
> -
> -                Length = 0;
> -                break;
> -
> -            case AML_FIELD_ATTRIB_WORD_CALL:
> -                Length = 2;
> -                break;
> -
> -            case AML_FIELD_ATTRIB_BLOCK_CALL:
> -                Length = 32;
> -                break;
> -
> -            case AML_FIELD_ATTRIB_MULTIBYTE:
> -            case AML_FIELD_ATTRIB_RAW_BYTES:
> -            case AML_FIELD_ATTRIB_RAW_PROCESS:
> -
> -                Length = MyContext->AccessLength;
> -                break;
> -
> -            default:
> -
> -                break;
> -            }
> -            break;
> -
> -        default:
> -
> -            break;
> -        }
> -
> -        if (AcpiGbl_DisplayRegionAccess)
> -        {
> -            AcpiOsPrintf ("AcpiExec: %s "
> -                "%s: Attr %X Addr %.4X BaseAddr %.4X Len %.2X Width %X BufLen %X",
> -                AcpiUtGetRegionName (SpaceId),
> -                (Function & ACPI_IO_MASK) ? "Write" : "Read ",
> -                (UINT32) (Function >> 16),
> -                (UINT32) Address, (UINT32) BaseAddress,
> -                Length, BitWidth, Buffer[1]);
> -
> -            /* GenericSerialBus has a Connection() parameter */
> -
> -            if (SpaceId == ACPI_ADR_SPACE_GSBUS)
> -            {
> -                Status = AcpiBufferToResource (MyContext->Connection,
> -                    MyContext->Length, &Resource);
> -
> -                AcpiOsPrintf (" [AccLen %.2X Conn %p]",
> -                    MyContext->AccessLength, MyContext->Connection);
> -            }
> -            AcpiOsPrintf ("\n");
> -        }
> -
> -        /* Setup the return buffer. Note: ASLTS depends on these fill values */
> -
> -        for (i = 0; i < Length; i++)
> -        {
> -            Buffer[i+2] = (UINT8) (0xA0 + i);
> -        }
> -
> -        Buffer[0] = 0x7A;
> -        Buffer[1] = (UINT8) Length;
> -        return (AE_OK);
> -
> -
> -    case ACPI_ADR_SPACE_IPMI: /* ACPI 4.0 */
> -
> -        if (AcpiGbl_DisplayRegionAccess)
> -        {
> -            AcpiOsPrintf ("AcpiExec: IPMI "
> -                "%s: Attr %X Addr %.4X BaseAddr %.4X Len %.2X Width %X BufLen %X\n",
> -                (Function & ACPI_IO_MASK) ? "Write" : "Read ",
> -                (UINT32) (Function >> 16), (UINT32) Address, (UINT32) BaseAddress,
> -                Length, BitWidth, Buffer[1]);
> -        }
> -
> -        /*
> -         * Regardless of a READ or WRITE, this handler is passed a 66-byte
> -         * buffer in which to return the IPMI status/length/data.
> -         *
> -         * Return some example data to show use of the bidirectional buffer
> -         */
> -        Buffer[0] = 0;       /* Status byte */
> -        Buffer[1] = 64;      /* Return buffer data length */
> -        Buffer[2] = 0;       /* Completion code */
> -        Buffer[3] = 0;       /* Reserved */
> -
> -        /*
> -         * Fill the 66-byte buffer with the return data.
> -         * Note: ASLTS depends on these fill values.
> -         */
> -        for (i = 4; i < 66; i++)
> -        {
> -            Buffer[i] = (UINT8) (i);
> -        }
> -        return (AE_OK);
> -
> -    default:
> -        break;
> -    }
> -
> -    /*
> -     * 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)
> -        {
> -            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)
> -            {
> -                /*
> -                 * Requested buffer is outside of the current RegionElement
> -                 * bounds
> -                 */
> -                RegionElement = RegionElement->NextRegion;
> -            }
> -            else
> -            {
> -                /*
> -                 * 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);
> -                }
> -            }
> -        }
> -    }
> -
> -    /*
> -     * If the Region buffer does not exist, create it now
> -     */
> -    if (!BufferExists)
> -    {
> -        /* Do the memory allocations first */
> -
> -        RegionElement = AcpiOsAllocate (sizeof (AE_REGION));
> -        if (!RegionElement)
> -        {
> -            return (AE_NO_MEMORY);
> -        }
> -
> -        RegionElement->Buffer = AcpiOsAllocate (Length);
> -        if (!RegionElement->Buffer)
> -        {
> -            AcpiOsFree (RegionElement);
> -            return (AE_NO_MEMORY);
> -        }
> -
> -        /* Initialize the region with the default fill value */
> -
> -        ACPI_MEMSET (RegionElement->Buffer, AcpiGbl_RegionFillValue, Length);
> -
> -        RegionElement->Address      = BaseAddress;
> -        RegionElement->Length       = Length;
> -        RegionElement->SpaceId      = SpaceId;
> -        RegionElement->NextRegion   = NULL;
> -
> -        /*
> -         * Increment the number of regions and put this one
> -         * at the head of the list as it will probably get accessed
> -         * more often anyway.
> -         */
> -        AeRegions.NumberOfRegions += 1;
> -
> -        if (AeRegions.RegionList)
> -        {
> -            RegionElement->NextRegion = AeRegions.RegionList;
> -        }
> -
> -        AeRegions.RegionList = RegionElement;
> -    }
> -
> -    /* Calculate the size of the memory copy */
> -
> -    ByteWidth = (BitWidth / 8);
> -
> -    if (BitWidth % 8)
> -    {
> -        ByteWidth += 1;
> -    }
> -
> -    /*
> -     * The buffer exists and is pointed to by RegionElement.
> -     * We now need to verify the request is valid and perform the operation.
> -     *
> -     * NOTE: RegionElement->Length is in bytes, therefore it we compare against
> -     * ByteWidth (see above)
> -     */
> -    if (((UINT64) Address + ByteWidth) >
> -        ((UINT64)(RegionElement->Address) + RegionElement->Length))
> -    {
> -        ACPI_WARNING ((AE_INFO,
> -            "Request on [%4.4s] is beyond region limit Req-0x%X+0x%X, Base=0x%X, Len-0x%X",
> -            (RegionObject->Region.Node)->Name.Ascii, (UINT32) Address,
> -            ByteWidth, (UINT32)(RegionElement->Address),
> -            RegionElement->Length));
> -
> -        return (AE_AML_REGION_LIMIT);
> -    }
> -
> -    /*
> -     * Get BufferValue to point to the "address" in the buffer
> -     */
> -    BufferValue = ((UINT8 *) RegionElement->Buffer +
> -                    ((UINT64) Address - (UINT64) RegionElement->Address));
> -
> -DoFunction:
> -    /*
> -     * Perform a read or write to the buffer space
> -     */
> -    switch (Function)
> -    {
> -    case ACPI_READ:
> -        /*
> -         * Set the pointer Value to whatever is in the buffer
> -         */
> -        ACPI_MEMCPY (Value, BufferValue, ByteWidth);
> -        break;
> -
> -    case ACPI_WRITE:
> -        /*
> -         * Write the contents of Value to the buffer
> -         */
> -        ACPI_MEMCPY (BufferValue, Value, ByteWidth);
> -        break;
> -
> -    default:
> -
> -        return (AE_BAD_PARAMETER);
> -    }
> -
> -    if (AcpiGbl_DisplayRegionAccess)
> -    {
> -        switch (SpaceId)
> -        {
> -        case ACPI_ADR_SPACE_SYSTEM_MEMORY:
> -
> -            AcpiOsPrintf ("AcpiExec: SystemMemory "
> -                "%s: Val %.8X Addr %.4X Width %X [REGION: BaseAddr %.4X Len %.2X]\n",
> -                (Function & ACPI_IO_MASK) ? "Write" : "Read ",
> -                (UINT32) *Value, (UINT32) Address, BitWidth, (UINT32) BaseAddress, Length);
> -            break;
> -
> -        case ACPI_ADR_SPACE_GPIO:   /* ACPI 5.0 */
> -
> -            /* This space is required to always be ByteAcc */
> -
> -            Status = AcpiBufferToResource (MyContext->Connection,
> -                MyContext->Length, &Resource);
> -
> -            AcpiOsPrintf ("AcpiExec: GeneralPurposeIo "
> -                "%s: Val %.8X Addr %.4X BaseAddr %.4X Len %.2X Width %X AccLen %.2X Conn %p\n",
> -                (Function & ACPI_IO_MASK) ? "Write" : "Read ", (UINT32) *Value,
> -                (UINT32) Address, (UINT32) BaseAddress, Length, BitWidth,
> -                MyContext->AccessLength, MyContext->Connection);
> -            break;
> -
> -        default:
> -
> -            break;
> -        }
> -    }
> -
>      return (AE_OK);
>  }
> diff --git a/src/acpica/source/tools/acpiexec/aeregion.c b/src/acpica/source/tools/acpiexec/aeregion.c
> new file mode 100644
> index 0000000..084925b
> --- /dev/null
> +++ b/src/acpica/source/tools/acpiexec/aeregion.c
> @@ -0,0 +1,966 @@
> +/******************************************************************************
> + *
> + * Module Name: aeregion - Operation region support for acpiexec
> + *
> + *****************************************************************************/
> +
> +/******************************************************************************
> + *
> + * 1. Copyright Notice
> + *
> + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
> + * All rights reserved.
> + *
> + * 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"
> +
> +#define _COMPONENT          ACPI_TOOLS
> +        ACPI_MODULE_NAME    ("aeregion")
> +
> +
> +/* Local prototypes */
> +
> +static ACPI_STATUS
> +AeRegionInit (
> +    ACPI_HANDLE             RegionHandle,
> +    UINT32                  Function,
> +    void                    *HandlerContext,
> +    void                    **RegionContext);
> +
> +static ACPI_STATUS
> +AeInstallEcHandler (
> +    ACPI_HANDLE             ObjHandle,
> +    UINT32                  Level,
> +    void                    *Context,
> +    void                    **ReturnValue);
> +
> +static ACPI_STATUS
> +AeInstallPciHandler (
> +    ACPI_HANDLE             ObjHandle,
> +    UINT32                  Level,
> +    void                    *Context,
> +    void                    **ReturnValue);
> +
> +
> +static AE_DEBUG_REGIONS     AeRegions;
> +BOOLEAN                     AcpiGbl_DisplayRegionAccess = FALSE;
> +ACPI_CONNECTION_INFO        AeMyContext;
> +
> +
> +/*
> + * 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_PCI_CONFIG,
> +    ACPI_ADR_SPACE_EC
> +};
> +
> +/*
> + * We will install handlers for some of the various address space IDs.
> + * Test one user-defined address space (used by aslts).
> + */
> +#define ACPI_ADR_SPACE_USER_DEFINED1        0x80
> +#define ACPI_ADR_SPACE_USER_DEFINED2        0xE4
> +
> +static ACPI_ADR_SPACE_TYPE  SpaceIdList[] =
> +{
> +    ACPI_ADR_SPACE_SMBUS,
> +    ACPI_ADR_SPACE_CMOS,
> +    ACPI_ADR_SPACE_PCI_BAR_TARGET,
> +    ACPI_ADR_SPACE_IPMI,
> +    ACPI_ADR_SPACE_GPIO,
> +    ACPI_ADR_SPACE_GSBUS,
> +    ACPI_ADR_SPACE_FIXED_HARDWARE,
> +    ACPI_ADR_SPACE_USER_DEFINED1,
> +    ACPI_ADR_SPACE_USER_DEFINED2
> +};
> +
> +
> +/******************************************************************************
> + *
> + * FUNCTION:    AeRegionInit
> + *
> + * PARAMETERS:  Region init handler
> + *
> + * RETURN:      Status
> + *
> + * DESCRIPTION: Opregion init function.
> + *
> + *****************************************************************************/
> +
> +static ACPI_STATUS
> +AeRegionInit (
> +    ACPI_HANDLE                 RegionHandle,
> +    UINT32                      Function,
> +    void                        *HandlerContext,
> +    void                        **RegionContext)
> +{
> +
> +    if (Function == ACPI_REGION_DEACTIVATE)
> +    {
> +        *RegionContext = NULL;
> +    }
> +    else
> +    {
> +        *RegionContext = RegionHandle;
> +    }
> +
> +    return (AE_OK);
> +}
> +
> +
> +void
> +AeInstallRegionHandlers (
> +    void)
> +{
> +    UINT32                  i;
> +    ACPI_STATUS             Status;
> +
> +    /*
> +     * Install handlers for some of the "device driver" address spaces
> +     * such as SMBus, etc.
> +     */
> +    for (i = 0; i < ACPI_ARRAY_LENGTH (SpaceIdList); i++)
> +    {
> +        /* Install handler at the root object */
> +
> +        Status = AcpiInstallAddressSpaceHandler (ACPI_ROOT_OBJECT,
> +                    SpaceIdList[i], AeRegionHandler,
> +                    AeRegionInit, &AeMyContext);
> +        if (ACPI_FAILURE (Status))
> +        {
> +            ACPI_EXCEPTION ((AE_INFO, Status,
> +                "Could not install an OpRegion handler for %s space(%u)",
> +                AcpiUtGetRegionName((UINT8) SpaceIdList[i]), SpaceIdList[i]));
> +            return;
> +        }
> +    }
> +}
> +
> +
> +void
> +AeOverrideRegionHandlers (
> +    void)
> +{
> +    UINT32                  i;
> +    ACPI_STATUS             Status;
> +
> +    /*
> +     * Install handlers that will override the default handlers for some of
> +     * the space IDs.
> +     */
> +    for (i = 0; i < ACPI_ARRAY_LENGTH (DefaultSpaceIdList); i++)
> +    {
> +        /* Install handler at the root object */
> +
> +        Status = AcpiInstallAddressSpaceHandler (ACPI_ROOT_OBJECT,
> +                    DefaultSpaceIdList[i], AeRegionHandler,
> +                    AeRegionInit, &AeMyContext);
> +        if (ACPI_FAILURE (Status))
> +        {
> +            ACPI_EXCEPTION ((AE_INFO, Status,
> +                "Could not install a default OpRegion handler for %s space(%u)",
> +                AcpiUtGetRegionName ((UINT8) DefaultSpaceIdList[i]),
> +                DefaultSpaceIdList[i]));
> +            return;
> +        }
> +    }
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    AeInstallDeviceHandlers,
> + *              AeInstallEcHandler,
> + *              AeInstallPciHandler
> + *
> + * PARAMETERS:  ACPI_WALK_NAMESPACE callback
> + *
> + * RETURN:      Status
> + *
> + * DESCRIPTION: Walk entire namespace, install a handler for every EC
> + *              and PCI device found.
> + *
> + ******************************************************************************/
> +
> +static ACPI_STATUS
> +AeInstallEcHandler (
> +    ACPI_HANDLE             ObjHandle,
> +    UINT32                  Level,
> +    void                    *Context,
> +    void                    **ReturnValue)
> +{
> +    ACPI_STATUS             Status;
> +
> +
> +    /* Install the handler for this EC device */
> +
> +    Status = AcpiInstallAddressSpaceHandler (ObjHandle, ACPI_ADR_SPACE_EC,
> +        AeRegionHandler, AeRegionInit, &AeMyContext);
> +    if (ACPI_FAILURE (Status))
> +    {
> +        ACPI_EXCEPTION ((AE_INFO, Status,
> +            "Could not install an OpRegion handler for EC device (%p)",
> +            ObjHandle));
> +    }
> +
> +    return (Status);
> +}
> +
> +
> +static ACPI_STATUS
> +AeInstallPciHandler (
> +    ACPI_HANDLE             ObjHandle,
> +    UINT32                  Level,
> +    void                    *Context,
> +    void                    **ReturnValue)
> +{
> +    ACPI_STATUS             Status;
> +
> +
> +    /* Install memory and I/O handlers for the PCI device */
> +
> +    Status = AcpiInstallAddressSpaceHandler (ObjHandle, ACPI_ADR_SPACE_SYSTEM_IO,
> +        AeRegionHandler, AeRegionInit, &AeMyContext);
> +    if (ACPI_FAILURE (Status))
> +    {
> +        ACPI_EXCEPTION ((AE_INFO, Status,
> +            "Could not install an OpRegion handler for PCI device (%p)",
> +            ObjHandle));
> +    }
> +
> +    Status = AcpiInstallAddressSpaceHandler (ObjHandle, ACPI_ADR_SPACE_SYSTEM_MEMORY,
> +        AeRegionHandler, AeRegionInit, &AeMyContext);
> +    if (ACPI_FAILURE (Status))
> +    {
> +        ACPI_EXCEPTION ((AE_INFO, Status,
> +            "Could not install an OpRegion handler for PCI device (%p)",
> +            ObjHandle));
> +    }
> +
> +    return (AE_CTRL_TERMINATE);
> +}
> +
> +
> +ACPI_STATUS
> +AeInstallDeviceHandlers (
> +    void)
> +{
> +
> +    /* Find all Embedded Controller devices */
> +
> +    AcpiGetDevices ("PNP0C09", AeInstallEcHandler, NULL, NULL);
> +
> +    /* Install a PCI handler */
> +
> +    AcpiGetDevices ("PNP0A08", AeInstallPciHandler, NULL, NULL);
> +    return (AE_OK);
> +}
> +
> +
> +/******************************************************************************
> + *
> + * FUNCTION:    AeRegionHandler
> + *
> + * PARAMETERS:  Standard region handler parameters
> + *
> + * RETURN:      Status
> + *
> + * DESCRIPTION: Test handler - Handles some dummy regions via memory that can
> + *              be manipulated in Ring 3. Simulates actual reads and writes.
> + *
> + *****************************************************************************/
> +
> +ACPI_STATUS
> +AeRegionHandler (
> +    UINT32                  Function,
> +    ACPI_PHYSICAL_ADDRESS   Address,
> +    UINT32                  BitWidth,
> +    UINT64                  *Value,
> +    void                    *HandlerContext,
> +    void                    *RegionContext)
> +{
> +
> +    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;
> +    UINT32                  Value1;
> +    UINT32                  Value2;
> +    ACPI_RESOURCE           *Resource;
> +
> +
> +    ACPI_FUNCTION_NAME (AeRegionHandler);
> +
> +    /*
> +     * If the object is not a region, simply return
> +     */
> +    if (RegionObject->Region.Type != ACPI_TYPE_REGION)
> +    {
> +        return (AE_OK);
> +    }
> +
> +    /* Check that we actually got back our context parameter */
> +
> +    if (HandlerContext != &AeMyContext)
> +    {
> +        printf ("Region handler received incorrect context %p, should be %p\n",
> +            HandlerContext, &AeMyContext);
> +    }
> +
> +    MyContext = ACPI_CAST_PTR (ACPI_CONNECTION_INFO, HandlerContext);
> +
> +    /*
> +     * Find the region's address space and length before searching
> +     * the linked list.
> +     */
> +    BaseAddress = RegionObject->Region.Address;
> +    Length = (ACPI_SIZE) RegionObject->Region.Length;
> +    SpaceId = RegionObject->Region.SpaceId;
> +
> +    ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Operation Region request on %s at 0x%X\n",
> +            AcpiUtGetRegionName (RegionObject->Region.SpaceId),
> +            (UINT32) Address));
> +
> +    /*
> +     * Region support can be disabled with the -do option.
> +     * We use this to support dynamically loaded tables where we pass a valid
> +     * address to the AML.
> +     */
> +    if (AcpiGbl_DbOpt_NoRegionSupport)
> +    {
> +        BufferValue = ACPI_TO_POINTER (Address);
> +        ByteWidth = (BitWidth / 8);
> +
> +        if (BitWidth % 8)
> +        {
> +            ByteWidth += 1;
> +        }
> +        goto DoFunction;
> +    }
> +
> +    switch (SpaceId)
> +    {
> +    case ACPI_ADR_SPACE_SYSTEM_IO:
> +        /*
> +         * For I/O space, exercise the port validation
> +         * Note: ReadPort currently always returns all ones, length=BitLength
> +         */
> +        switch (Function & ACPI_IO_MASK)
> +        {
> +        case ACPI_READ:
> +
> +            if (BitWidth == 64)
> +            {
> +                /* Split the 64-bit request into two 32-bit requests */
> +
> +                Status = AcpiHwReadPort (Address, &Value1, 32);
> +                AE_CHECK_OK (AcpiHwReadPort, Status);
> +                Status = AcpiHwReadPort (Address+4, &Value2, 32);
> +                AE_CHECK_OK (AcpiHwReadPort, Status);
> +
> +                *Value = Value1 | ((UINT64) Value2 << 32);
> +            }
> +            else
> +            {
> +                Status = AcpiHwReadPort (Address, &Value1, BitWidth);
> +                AE_CHECK_OK (AcpiHwReadPort, Status);
> +                *Value = (UINT64) Value1;
> +            }
> +            break;
> +
> +        case ACPI_WRITE:
> +
> +            if (BitWidth == 64)
> +            {
> +                /* Split the 64-bit request into two 32-bit requests */
> +
> +                Status = AcpiHwWritePort (Address, ACPI_LODWORD (*Value), 32);
> +                AE_CHECK_OK (AcpiHwWritePort, Status);
> +                Status = AcpiHwWritePort (Address+4, ACPI_HIDWORD (*Value), 32);
> +                AE_CHECK_OK (AcpiHwWritePort, Status);
> +            }
> +            else
> +            {
> +                Status = AcpiHwWritePort (Address, (UINT32) *Value, BitWidth);
> +                AE_CHECK_OK (AcpiHwWritePort, Status);
> +            }
> +            break;
> +
> +        default:
> +
> +            Status = AE_BAD_PARAMETER;
> +            break;
> +        }
> +
> +        if (ACPI_FAILURE (Status))
> +        {
> +            return (Status);
> +        }
> +
> +        /* Now go ahead and simulate the hardware */
> +        break;
> +
> +    /*
> +     * SMBus and GenericSerialBus support the various bidirectional
> +     * protocols.
> +     */
> +    case ACPI_ADR_SPACE_SMBUS:
> +    case ACPI_ADR_SPACE_GSBUS:  /* ACPI 5.0 */
> +
> +        Length = 0;
> +
> +        switch (Function & ACPI_IO_MASK)
> +        {
> +        case ACPI_READ:
> +
> +            switch (Function >> 16)
> +            {
> +            case AML_FIELD_ATTRIB_QUICK:
> +
> +                Length = 0;
> +                break;
> +
> +            case AML_FIELD_ATTRIB_SEND_RCV:
> +            case AML_FIELD_ATTRIB_BYTE:
> +
> +                Length = 1;
> +                break;
> +
> +            case AML_FIELD_ATTRIB_WORD:
> +            case AML_FIELD_ATTRIB_WORD_CALL:
> +
> +                Length = 2;
> +                break;
> +
> +            case AML_FIELD_ATTRIB_BLOCK:
> +            case AML_FIELD_ATTRIB_BLOCK_CALL:
> +
> +                Length = 32;
> +                break;
> +
> +            case AML_FIELD_ATTRIB_MULTIBYTE:
> +            case AML_FIELD_ATTRIB_RAW_BYTES:
> +            case AML_FIELD_ATTRIB_RAW_PROCESS:
> +
> +                Length = MyContext->AccessLength;
> +                break;
> +
> +            default:
> +
> +                break;
> +            }
> +            break;
> +
> +        case ACPI_WRITE:
> +
> +            switch (Function >> 16)
> +            {
> +            case AML_FIELD_ATTRIB_QUICK:
> +            case AML_FIELD_ATTRIB_SEND_RCV:
> +            case AML_FIELD_ATTRIB_BYTE:
> +            case AML_FIELD_ATTRIB_WORD:
> +            case AML_FIELD_ATTRIB_BLOCK:
> +
> +                Length = 0;
> +                break;
> +
> +            case AML_FIELD_ATTRIB_WORD_CALL:
> +                Length = 2;
> +                break;
> +
> +            case AML_FIELD_ATTRIB_BLOCK_CALL:
> +                Length = 32;
> +                break;
> +
> +            case AML_FIELD_ATTRIB_MULTIBYTE:
> +            case AML_FIELD_ATTRIB_RAW_BYTES:
> +            case AML_FIELD_ATTRIB_RAW_PROCESS:
> +
> +                Length = MyContext->AccessLength;
> +                break;
> +
> +            default:
> +
> +                break;
> +            }
> +            break;
> +
> +        default:
> +
> +            break;
> +        }
> +
> +        if (AcpiGbl_DisplayRegionAccess)
> +        {
> +            AcpiOsPrintf ("AcpiExec: %s "
> +                "%s: Attr %X Addr %.4X BaseAddr %.4X Len %.2X Width %X BufLen %X",
> +                AcpiUtGetRegionName (SpaceId),
> +                (Function & ACPI_IO_MASK) ? "Write" : "Read ",
> +                (UINT32) (Function >> 16),
> +                (UINT32) Address, (UINT32) BaseAddress,
> +                Length, BitWidth, Buffer[1]);
> +
> +            /* GenericSerialBus has a Connection() parameter */
> +
> +            if (SpaceId == ACPI_ADR_SPACE_GSBUS)
> +            {
> +                Status = AcpiBufferToResource (MyContext->Connection,
> +                    MyContext->Length, &Resource);
> +
> +                AcpiOsPrintf (" [AccLen %.2X Conn %p]",
> +                    MyContext->AccessLength, MyContext->Connection);
> +            }
> +            AcpiOsPrintf ("\n");
> +        }
> +
> +        /* Setup the return buffer. Note: ASLTS depends on these fill values */
> +
> +        for (i = 0; i < Length; i++)
> +        {
> +            Buffer[i+2] = (UINT8) (0xA0 + i);
> +        }
> +
> +        Buffer[0] = 0x7A;
> +        Buffer[1] = (UINT8) Length;
> +        return (AE_OK);
> +
> +
> +    case ACPI_ADR_SPACE_IPMI: /* ACPI 4.0 */
> +
> +        if (AcpiGbl_DisplayRegionAccess)
> +        {
> +            AcpiOsPrintf ("AcpiExec: IPMI "
> +                "%s: Attr %X Addr %.4X BaseAddr %.4X Len %.2X Width %X BufLen %X\n",
> +                (Function & ACPI_IO_MASK) ? "Write" : "Read ",
> +                (UINT32) (Function >> 16), (UINT32) Address, (UINT32) BaseAddress,
> +                Length, BitWidth, Buffer[1]);
> +        }
> +
> +        /*
> +         * Regardless of a READ or WRITE, this handler is passed a 66-byte
> +         * buffer in which to return the IPMI status/length/data.
> +         *
> +         * Return some example data to show use of the bidirectional buffer
> +         */
> +        Buffer[0] = 0;       /* Status byte */
> +        Buffer[1] = 64;      /* Return buffer data length */
> +        Buffer[2] = 0;       /* Completion code */
> +        Buffer[3] = 0;       /* Reserved */
> +
> +        /*
> +         * Fill the 66-byte buffer with the return data.
> +         * Note: ASLTS depends on these fill values.
> +         */
> +        for (i = 4; i < 66; i++)
> +        {
> +            Buffer[i] = (UINT8) (i);
> +        }
> +        return (AE_OK);
> +
> +    /*
> +     * GPIO has some special semantics:
> +     * 1) Address is the pin number index into the Connection() pin list
> +     * 2) BitWidth is the actual number of bits (pins) defined by the field
> +     */
> +    case ACPI_ADR_SPACE_GPIO: /* ACPI 5.0 */
> +
> +        if (AcpiGbl_DisplayRegionAccess)
> +        {
> +            AcpiOsPrintf ("AcpiExec: GPIO "
> +                "%s: Addr %.4X Width %X Conn %p\n",
> +                (Function & ACPI_IO_MASK) ? "Write" : "Read ",
> +                (UINT32) Address, BitWidth, MyContext->Connection);
> +        }
> +        return (AE_OK);
> +
> +    default:
> +        break;
> +    }
> +
> +    /*
> +     * 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)
> +        {
> +            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)
> +            {
> +                /*
> +                 * Requested buffer is outside of the current RegionElement
> +                 * bounds
> +                 */
> +                RegionElement = RegionElement->NextRegion;
> +            }
> +            else
> +            {
> +                /*
> +                 * 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);
> +                }
> +            }
> +        }
> +    }
> +
> +    /*
> +     * If the Region buffer does not exist, create it now
> +     */
> +    if (!BufferExists)
> +    {
> +        /* Do the memory allocations first */
> +
> +        RegionElement = AcpiOsAllocate (sizeof (AE_REGION));
> +        if (!RegionElement)
> +        {
> +            return (AE_NO_MEMORY);
> +        }
> +
> +        RegionElement->Buffer = AcpiOsAllocate (Length);
> +        if (!RegionElement->Buffer)
> +        {
> +            AcpiOsFree (RegionElement);
> +            return (AE_NO_MEMORY);
> +        }
> +
> +        /* Initialize the region with the default fill value */
> +
> +        ACPI_MEMSET (RegionElement->Buffer, AcpiGbl_RegionFillValue, Length);
> +
> +        RegionElement->Address      = BaseAddress;
> +        RegionElement->Length       = Length;
> +        RegionElement->SpaceId      = SpaceId;
> +        RegionElement->NextRegion   = NULL;
> +
> +        /*
> +         * Increment the number of regions and put this one
> +         * at the head of the list as it will probably get accessed
> +         * more often anyway.
> +         */
> +        AeRegions.NumberOfRegions += 1;
> +
> +        if (AeRegions.RegionList)
> +        {
> +            RegionElement->NextRegion = AeRegions.RegionList;
> +        }
> +
> +        AeRegions.RegionList = RegionElement;
> +    }
> +
> +    /* Calculate the size of the memory copy */
> +
> +    ByteWidth = (BitWidth / 8);
> +
> +    if (BitWidth % 8)
> +    {
> +        ByteWidth += 1;
> +    }
> +
> +    /*
> +     * The buffer exists and is pointed to by RegionElement.
> +     * We now need to verify the request is valid and perform the operation.
> +     *
> +     * NOTE: RegionElement->Length is in bytes, therefore it we compare against
> +     * ByteWidth (see above)
> +     */
> +    if ((RegionObject->Region.SpaceId != ACPI_ADR_SPACE_GPIO) &&
> +        ((UINT64) Address + ByteWidth) >
> +        ((UINT64)(RegionElement->Address) + RegionElement->Length))
> +    {
> +        ACPI_WARNING ((AE_INFO,
> +            "Request on [%4.4s] is beyond region limit Req-0x%X+0x%X, Base=0x%X, Len-0x%X",
> +            (RegionObject->Region.Node)->Name.Ascii, (UINT32) Address,
> +            ByteWidth, (UINT32)(RegionElement->Address),
> +            RegionElement->Length));
> +
> +        return (AE_AML_REGION_LIMIT);
> +    }
> +
> +    /*
> +     * Get BufferValue to point to the "address" in the buffer
> +     */
> +    BufferValue = ((UINT8 *) RegionElement->Buffer +
> +                    ((UINT64) Address - (UINT64) RegionElement->Address));
> +
> +DoFunction:
> +    /*
> +     * Perform a read or write to the buffer space
> +     */
> +    switch (Function)
> +    {
> +    case ACPI_READ:
> +        /*
> +         * Set the pointer Value to whatever is in the buffer
> +         */
> +        ACPI_MEMCPY (Value, BufferValue, ByteWidth);
> +        break;
> +
> +    case ACPI_WRITE:
> +        /*
> +         * Write the contents of Value to the buffer
> +         */
> +        ACPI_MEMCPY (BufferValue, Value, ByteWidth);
> +        break;
> +
> +    default:
> +
> +        return (AE_BAD_PARAMETER);
> +    }
> +
> +    if (AcpiGbl_DisplayRegionAccess)
> +    {
> +        switch (SpaceId)
> +        {
> +        case ACPI_ADR_SPACE_SYSTEM_MEMORY:
> +
> +            AcpiOsPrintf ("AcpiExec: SystemMemory "
> +                "%s: Val %.8X Addr %.4X Width %X [REGION: BaseAddr %.4X Len %.2X]\n",
> +                (Function & ACPI_IO_MASK) ? "Write" : "Read ",
> +                (UINT32) *Value, (UINT32) Address, BitWidth, (UINT32) BaseAddress, Length);
> +            break;
> +
> +        case ACPI_ADR_SPACE_GPIO:   /* ACPI 5.0 */
> +
> +            /* This space is required to always be ByteAcc */
> +
> +            Status = AcpiBufferToResource (MyContext->Connection,
> +                MyContext->Length, &Resource);
> +
> +            AcpiOsPrintf ("AcpiExec: GeneralPurposeIo "
> +                "%s: Val %.8X Addr %.4X BaseAddr %.4X Len %.2X Width %X AccLen %.2X Conn %p\n",
> +                (Function & ACPI_IO_MASK) ? "Write" : "Read ", (UINT32) *Value,
> +                (UINT32) Address, (UINT32) BaseAddress, Length, BitWidth,
> +                MyContext->AccessLength, MyContext->Connection);
> +            break;
> +
> +        default:
> +
> +            break;
> +        }
> +    }
> +
> +    return (AE_OK);
> +}
> --
> 2.1.0
>

Acked-by: Keng-Yu Lin <kengyu at canonical.com>



More information about the fwts-devel mailing list