Patchwork acpica: update to ACPICA version 20130418.

login
register
mail settings
Submitter Colin King
Date May 3, 2013, 4:18 p.m.
Message ID <1367597885-10496-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/241350/
State Accepted
Headers show

Comments

Colin King - May 3, 2013, 4:18 p.m.
From: Colin Ian King <colin.king@canonical.com>

Update to use ACPICA version 20130418, commits:

60396f8 Update version to 20130418.
fc2ca35 Logfile: Changes for version 20130418.
d26da51 Debugger: Use ACPI_STRLEN instead of just strlen().
0ecbfc5 AcpiExec: Ensure all handlers installed before _REG method execution.
875842a AcpiExec: Add support for multiple embedded controllers.
69d3f57 Debugger: Enhance "handlers" command to display non-root handlers.
9ae6175 Update for "orphan" embedded controller _REG method support.
ef3d11e _OSI support: Fix possible memory leak.
29c5740 Remove unused macros, no functional change.
4cdb22f Unix/Linux makefiles: Remove use of -O2 flag that causes problems.
80c3cc3 ASLTS: Miscellaneous tests updates/fixes.
2f1a0a5 Predefined name support: Remove unused local variable.
ad31487 Update makefiles and project files for new file.
9b46d42 Add argument typechecking for all predefined ACPI names.
f9c8728 AcpiExec: Add a default handler for SystemCMOS.
07efe71 iASL: Update for new argument list format for predefined names.
e3b4190 Fix possible buffer overflow during a field unit read operation.
cd8237d Windows OSL: Remove obsolete reference to memory list field.
075993d Add BIOS error interface for predefined name validation support.
11f2257 Change an exception code for the ASL UnLoad() operator.
63c017f Update version to 20130328.
1c1f875 Logfile: Changes for version 20130328.
d6c0371 ACPICA Reference: Add section for internal mutex/lock usage.
5520b06 Update .gitignore file.
257247e Linux divergence fixes, no functional changes.
223f4d3 Update Linux-specific script files.
617b96b Add a lock to the internal object reference count mechanism.
8971dde Fix a format string for 64-bit generation.
13723dc Remove FORCE_DELETE option for global reference count mechanism.
a95cf2f iASL: Fix two sprintf formatting fields for predefined names.
b1b8c2b Improve error message for Index() operator.
8e4a0fc FADT: Remove extraneous warning for very large GPE registers.
c79891a iASL: Add support for an "offset table" output file.
b8cdd52 Fix a typo in a function header, no functional change.
3f5096b Fix a typo in an error message.
be0564b Fix for some comments/headers. No functional change.
7db6eef _OSI Support: handle any errors from AcpiOsAcquireMutex.
994f5e3 Tests/ASLTS: Global update for exception handling.
8509166 Tests/ASLTS: Fix all cases of "return value not used".
ca5bb5c AcpiHelp: Add argument types to predefined names info display.
cd230d2 Makefiles and project files: update for new source file.
b8bfcf1 Predefine names: Add allowed argument types to master info table.
ddcd47b iASL: Allow more predefined names to return 0-length packages.
4e78ce6 iASL: Change result not used warning to an error.
4fddab2 Update version to 20130214.
2cc3141 Logfile: Changes for version 20130214.
677eb43 Object repair: Allow 0-length packages for variable-length packages.
bb1f4ea ACPICA reference: minor update to fix typos.
08d86ac Update .gitignore
d24fc37 Disassembler: Add warnings for unresolved control methods.
f5ff3dc iASL: Allow 0-length packages for variable-length packages.
05f01dd Tests: Update ASLTS for new iASL package validation.
73fd636 iASL: Add validation of predefined name package objects.
d97cb73 iASL: Update main help/usage message.
027053c Test suites: Miscellaneous ASLTS updates.
3b40cbc iASL: Auto-detect binary ACPI tables for disassembly.
531315e Return object repair: Add resource template repairs.
41a7857 Return object repair: Add string-to-unicode conversion.
c51e7d4 Split object conversion functions to a new file.
6cb3c06 Add mechanism for early object repairs on a per-name basis.
0197232 AcpiSrc: Add new table structures into conversion table
711adab Linux scripts: Make AcpiSrc utility compile optional.
a4494fc Remove trailing comma in enum declarations
dfa12e5 Makefiles: Change link sequence for better compatibility.
81a5a5c AcpiHelp: Add support for exception code descriptions.
1b80c07 Add exception descriptions to exception info table.
9018a78 Add macros to exception code definitions.
fd2161a Windows project files: Add Makefile/script subprojects.
2f97fb7 Merge branch 'master' of ssh://ssh.github.com/juikim/acpica
0fbdfb6 Regression fix: reinstate safe exit macros.
754a19f Update for ACPI 5.0 hardware-reduced feature.
1daeccc Add parens within macros around parameter names.
d2b973b Add macros to access pointer to next object in the descriptor list.
3e45e0f Update the generic Unix makefiles.
95a8781 Update error/debug messages for fixed events.
345e620 Fix a long-standing bug in local cache.  Since 20060317, the pointer to next object is the first element in its common header.  Remove bogus LinkOffset from ACPI_MEMORY_LIST and directly use NextObject.
b9fc33d iASL: A couple of lint changes, no functional change.
b1c32b8 iASL/Disassembler: Add support for MTMR table.
17b0a51 iASL/Disassembler: Add support for VRTC table.
95f1c87 Update RASF table definition.
b1a4333 Fix a couple warnings detected on FreeBSD build.
0271bb4 Debugger: Allow zero arguments to resources command.
c22ef19 Resource Mgr: Prevent infinite loops in resource walks.
dd96990 Disassembler: Add an stderr message for unknown ACPI tables.
731b828 Update version to 20130117.
9a55f21 Logfile: Changes for version 20130117.
7dd66d8 Documentation: Updates for 20130117 changes.
5de4fa4 Update predefined info table for _MLS method.
f61a76d Cygwin header: add prototype for vsnprintf().
4030c8f Unix directory support: Remove unused version of strlwr function.
ff5458a Add a comment to the cygwin include file concerning vsnprintf.
6872a1d Generic Unix OSL: Use a buffer to eliminate multiple vfprintf()s.
392e5cc AcpiSrc: Add a local version of strlwr() to prevent header issues.
a373010 Linuxize: Move acpisrc generation from make-patch.pl to linuxize.sh.
f8873db Linuxize: Add patch header fields for linuxized patches.
2d82041 Remove some extraneous newlines in ACPI_ERROR type calls..
bbe255f Utilities: Performance update for OSL AcpiOsPrintf function.
789175a iASL/Disassembler: Add option to ignore NOOP opcodes/operators.
0e1413d iASL: Fix possible infinite loop when max error count is reached.
87092cb iASL: Improve listing file output.
26b3407 iASL: Improve error message for predefined type mismatch.
81c20d2 Debugger: Enhance Sleep command to execute all sleep states.
5869690 AcpiGetSleepTypeData: Allow \_Sx to return either 1 or 2 integers.
31580d5 Fix two issues with the ACPI_DEBUG_PRINT macros.
e10f380 AcpiExec: Use ACPI_ROOT_OBJECT where appropriate.
c04f072 Debugger: Remove a redundant line of code.
c0a9146 Tests: Update all copyrights to 2013.
5b6ee00 Update ACPICA copyrights to 2013.
0c6e074 Debugger: Add support to test all possible sleep values.
f1ddee5 Update version to 20121220.
1ed9311 Logfile: Changes for version 20121220.
2541323 ACPICA reference: Add new resource manager interface.
b74e4bb Update build.txt readme for master ACPICA generation.
3f81290 Fix comment in acenv.h - no functional change.
9eb35c2 ASLTS: Remove an invalid error condition.
1a7373c Makefiles/projectfiles: Update for new files.
3bf598a iASL source restructuring: split large files into 5 new files.
b62a5a4 Windows project files: Update for new files.
37f8669 Unix makefiles: Update for new files.
fd9ffc4 Source restructuring: split large files into 8 new files.
39414c0 iASL: Add remark if Timer() used in a 32-bit table.
bfc6a10 ASLTS: Remove a couple of incorrect tests.
d7d9d66 Interpreter: Fix Store() when implicit conversion is not possible
aa3b682 Tests: Fix problem with Increment/Decrement ASL tests.
e529dbf Resources: Split interrupt share/wake bits into two fields.
709f8bd iASL: Cleanup table compiler debut output code.
f263d59 Resources: Support for ACPI 5.0 wake bit in ExtendedInterrupt descriptor.
aa6eaae Interpreter: Add warning if 64-bit constant appears in 32-bit table.
d0cdffd Update ACPICA initialization messages.
c042f90 Namespace: Eliminate dot...dot output during initialization.
16285ec Resource manager: Add support for ACPI 5.0 wake bit in IRQ descriptor.
8f5c1e3 Fix possible memory leak in dispatcher error path.
7a3d05b iASL: Additional debug output for table compiler.
df21417 Update for non-configured ACPI_IS_DEBUG_ENABLED macro.
1f67b26 iASL: Finish support for the TPM2 table.
0ab6c47 iASL: Finish support for CSRT table.
71323a4 AcpiHelp: Fix a few small typos.
7990613 Merge all debug output macros into a single file, acoutput.h
0796525 Deploy new ACPI_IS_DEBUG_ENABLED macro in debug output code.
b2d2a52 Update ACPI_IS_DEBUG_ENABLED macro.
070dd75 Eliminate superfluous return_UINT8 and return_UINT32 macros.
877d86c FUNCTION_TRACE macros:  Check if debug is enabled up-front.
b8cf8cd DEBUG_PRINT macros: Update to improve performance.
016e87a ASLTS: Fix several issues with mutex tests.
babc57a Resource Manager: Add a pointer cast for a namespace node.
b80f74f Add header file support for the ACPI 5.0 TPM2 ACPI table.
187747b ASLTS: update package name for the bug demo test (bdemo).
c8f37c9 Add time macros for various timer/time manipulation.
e121b46 Fix some typos in comments. No functional change.
53f8c13 ASLTS: Update for ObjectType syntax change.
59b9a85 Update ** pointers in some of the various walk functions.
4fbff1f ASLTS: Update generation/execution scripts.
f252e08 iASL: Disallow method call as argument to ObjectType ASL operator.
0d63ea6 Unix user-space OSL: Fix problem with WaitSemaphore.
8f69e2b ASLTS: Remove a test case for ObjectType operator.
c93543b ASLTS: Remove test that tests a nearly impossible condition.
c2d6c80 ASLTS: Update for changed exception codes for LoadTable operator.
9d5b05e Lint changes, no functional change.
93f9f86 Add root node optimization to internal get namespace node function.
29e066e Eliminate some small unnecessary pathname functions.
ba435d1 Change exception code for LoadTable operator.
d5160d9 Debugger: Fix missing error message regression.
648a837 Debugger: Code cleanup and rename some local variables.
5825c3a Debugger: Update for new resource interface.
76a480a Resources: New interface, AcpiWalkResourceBuffer.
03eda6d Update version to 20121114.
3f57816 Logfile: Changes for version 20121114.
9b3792d Makefiles: Cleanup some whitespace/tab issues.
cedd5d1 Update linux scripts.
067bda1 iASL: Update namespace output for resource fields.
947575f ASLTS: Remove an invalid/obsolete test case.
f63f02b ASLTS: Fix for several incorrect AE_AML_MUTEX_ORDER errors.
dbfa50a AcpiBin: Fix for the dump-to-hex function.
898b052 iASL/Tools: Standardize use of stream I/O functions.
29f4970 Tools: Replace low-level I/O with stream I/O functions.
56037d0 AcpiBin: Display compared headers side-by-side.
568c542 AcpiGetObjectInfo: optimize exit for mutex failure.
c181ce2 Resource Manager: update template walking with ACPI_NEXT_RESOURCE.
f16551e Enhance the ACPI_GETx and ACPI_SETx macros.
e13146b Disassembler: Prevent duplicate External() statements.
b6b0e3a Add macros to extract flag bits from resource descriptors.
f80327f Debugger: Remove a couple inadvertent "//" comments.
ef93444 Disassembler: Add new ACPI 5.0 interrupt sharing flags.
a3e95d8 iASL: Remove obsolete -2 option flag.
aea0bdb Disassembler: Add "Disasm" for a synonym for Disassemble command.
adb8709 Debugger: Major update for the Disassemble<method> command.
9435ca8 Disassembler: Fix for external declaration generation
f5738af Update ACPICA release build instructions.
f8d496a Performance: Remove function tracing from critical allocation functions.
3860f05 AcpiSrc: Add error check after call to write().
8918678 iASL: Move parser entry prototype to avoid duplicate declaration.
9458732 iASL: Update readme file for new versions of bison/flex.
33c99ff iASL: Add check for return value from fwrite().
49dec9f Performance enhancement for ACPI package objects.
05432f7 Fix possible memory leak.
27d3c34 Update version to 20121018.
6b45ef0 Logfile: Changes for version 20121018.
114eec1 Documentation: Update ACPICA ref for interface changes.
e611add Add two new readme files.
14f1590 Windows project files: Update for browsing information.
36706d9 iASL: Update help message screen.
8560531 iASL: Update template for MPST table.
5e59e2f Divergence: Backport Linux lockdep fix to ACPICA.
3938951 Divergence: Backport linux version of aclinux.h to ACPICA.
8e7a875 AcpiGetObjectInfo: Add support for ACPI 5.0 _SUB method.
a889648 Change ACPI_DEVICE_ID to ACPI_PNP_DEVICE_ID.
37dd560 Update for 64-bit generation of recent error message changes.
fe0d1f9 Fix externalize name to complete migration to ACPI_MOVE_NAME.
4322675 Add starting offset parameter to common dump buffer routine.
ef89813 Deploy ACPI_MOVE_NAME across ACPICA source base.
d4fa24b Update support for ACPI 5.0 MPST table.
7f49766 Enhance error reporting for invalid opcodes and bad ACPI_NAMEs.
80328e4 Add ACPI_MOVE_NAME macro to optimize 4-byte ACPI_NAME copies.
ff56b2d Disassembler: Add option (-vt) to also dump binary table data in hex.
9f0a65f iASL: For -f option (force), allow non-ASCII characters in input.
db012cb AcpiExec: Improve algorithm for tracking memory leaks.
1dbda3d Tests: Miscellaneous ASLTS fixes.
8d96522 Update readme files for ACPICA and iASL generation.
8806b15 Add debug print message for mutex objects that are force-released.
8ab2f17 Tests/aapits: Remove extraneous spaces in C source code.
2406636 Small fix for standard Intel legal header.
1855422 acpibin: Add error check after fwrite invocation.
d42be86 Resource Mgr: Small fix for buffer size calculation.
a28a14b Remove extra spaces after periods in the Intel license.
d91aaaf Remove extra spaces after periods within comments.
b6e1206 acpisrc: Add support to remove extra spaces after a period.
a025d2f Update local C library module comments for ASCII table.
8200302 Small lint changes, no functional change.
5ad5821 Fix for potential filename buffer overflow (osunixdir.c)
2b39825 Fix for predefined name loop during ACPICA initialization.
5cf3918 Fix some typos in comments. No functional changes.
d57cfb0 iASL/table_compiler: Some additional return statement fixes.
fd8f80e ACPICA core: Cleanup empty lines at file start and end.
c0b396e iASL/Tools: Cleanup empty lines at file start and end.
f4dbc02 AcpiSrc: Add cleanup function to remove empty lines at file start/end.
6c783a2 Update linux scripts.
8086d9e Tests/AAPITS: return statement audit.
087f252 iASL/Tools: return statement audit.
99b5831 Audit/update for ACPICA return macros and debug depth counter.
2afe4c5 Update version to 20120913.
84f7137 Logfile: Changes for version 20120913.
54983bb Test Suites: Update ASLTS object reference tests.
8027ed3 Table Manager: Merge duplicate code (root table)
19b67bf Disassembler: Fix possible fault for Resource Descriptors.
e487bdb Debugger: Add "evaluate" as a synonym for "execute" command.
dbf3ef2 Remove obsolete "Linux" makefiles.
0ee9c13 iASL: Cleanup intermediate file deletion.
e6d56d1 Makefiles: Ensure that binary files always copied properly.
3d75370 Test Suites: Add more debug info to ASLTS makefile.
1fb836c iASL: Fix problem with constant folding in method declarations.
7bcb9f0 Test suites: Several fixes for ASLTS recursion subtest.
fca5fa5 iASL: Fix namepath optimization problem.
ade20e6 AcpiExec: Cleanup and restructure main module.
05bcf4a iASL: Fix regression where AML file is not deleted on errors.
3a62edc Headers: Add new ACPI 5.0 HEST notify type values.
1266475 Debugger: Improve command help support.
54e0432 iASL: Automatically increase internal line buffer sizes.
c24949b iASL: Improve error messages for very long source lines.
af851da Documentation: Update ACPICA build helpfile.
4576388 Update version to 20120816.
49041c6 Logfile: Changes for version 20120816.
cf43db6 Documentation: Update ACPICA ref for interface changes.
923e24e Debugger: Fix broken "Threads" command.
770111d Disassembler: Add support for CSRT and DBG2 ACPI tables.
0255f97 AcpiSrc: Add support for CSRT and DBG2 ACPI tables.
7f9e830 Headers: Add support for CSRT and DBG2 ACPI tables.
0280d5f iASL: Fix generation issue on newer versions of Bison.
0d9370e Add multi-endian support to the _PLD decode routine.
33b1aae Remove all use of deprecated _GTS and _BFS methods.
3f205c1 Makefiles: Update linker invocation.
9fcaec2 iASL: Update help info for supported ACPI tables.
2e6d4d6 GPE support: Remove extraneous parameter from low-level function.
ffefc5e iASL: Fix constant folding for fixed-length constants.
c5667d3 Debug output: Update output for Processor object.
c569b83 GPE Support: Update debug info for GPE tracing.
91fe6dc Add Windows8/Server2012 string for _OSI method.
6e0b539 Divergence script: Auto-select 32/64 versions of AcpiSrc utility.
c434363 Update .gitignore file.
3754247 Build script: Remove Linux makefiles from packages.
5e3ebfc iASL: Fix non-ANSI // comments in main parser file.
1b021cb Comment update: Fix some typos, no functional change.
3c32c90 Windows project files: Update for new file, utxfinit.c
4abb1d5 Makefiles: Update for new file, utxfinit.c
30fffec Split ACPICA initialization functions to new file, utxfinit.c
2e51363 Remove Windows binaries from git repository.
83212f2 Add struct header support for _FDE, _GRT, _GTM, and _SRT names.
1381535 Disassembler: Add support to decode _PLD buffers.
f098eaf Why ACPICA cannot use C bitfields: Update comments.
d93c6dd Update Windows project files.
685d611 Add support for complex _PLD buffers.
5a77772 Update linux/ACPICA divergence script - add diffstat output.
daf734b Update error/warning messages for ACPI BIOS bugs.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpica/Makefile.am                             |   13 +
 src/acpica/source/common/adfile.c                  |   51 +-
 src/acpica/source/common/adisasm.c                 |  333 +----
 src/acpica/source/common/adwalk.c                  |   36 +-
 src/acpica/source/common/ahpredef.c                |   32 +-
 src/acpica/source/common/dmextern.c                |  284 ++++-
 src/acpica/source/common/dmrestag.c                |   39 +-
 src/acpica/source/common/dmtable.c                 |   54 +-
 src/acpica/source/common/dmtbdump.c                |  416 ++++++-
 src/acpica/source/common/dmtbinfo.c                |  214 +++-
 src/acpica/source/compiler/Makefile.am             |   17 +
 src/acpica/source/compiler/aslanalyze.c            |   26 +-
 src/acpica/source/compiler/aslbtypes.c             |   26 +-
 src/acpica/source/compiler/aslcodegen.c            |   33 +-
 src/acpica/source/compiler/aslcompile.c            |  197 ++-
 src/acpica/source/compiler/aslcompiler.h           |  173 ++-
 src/acpica/source/compiler/aslcompiler.l           |   28 +-
 src/acpica/source/compiler/aslcompiler.y           |  189 +--
 src/acpica/source/compiler/asldefine.h             |   39 +-
 src/acpica/source/compiler/aslerror.c              |   99 +-
 src/acpica/source/compiler/aslfileio.c             |  465 +++++++
 src/acpica/source/compiler/aslfiles.c              |  389 +-----
 src/acpica/source/compiler/aslfold.c               |  173 ++-
 src/acpica/source/compiler/aslglobal.h             |   99 +-
 src/acpica/source/compiler/aslhex.c                |  473 +++++++
 src/acpica/source/compiler/asllength.c             |   35 +-
 src/acpica/source/compiler/asllisting.c            | 1158 ++---------------
 src/acpica/source/compiler/asllistsup.c            |  778 ++++++++++++
 src/acpica/source/compiler/aslload.c               |   32 +-
 src/acpica/source/compiler/asllookup.c             | 1299 +-------------------
 src/acpica/source/compiler/aslmain.c               |  173 ++-
 src/acpica/source/compiler/aslmap.c                |   31 +-
 src/acpica/source/compiler/aslmessages.h           |   37 +-
 src/acpica/source/compiler/aslmethod.c             |  691 +++++++++++
 src/acpica/source/compiler/aslnamesp.c             |  494 ++++++++
 src/acpica/source/compiler/asloffset.c             |  398 ++++++
 src/acpica/source/compiler/aslopcodes.c            |   75 +-
 src/acpica/source/compiler/asloperands.c           |   51 +-
 src/acpica/source/compiler/aslopt.c                |   88 +-
 src/acpica/source/compiler/aslpredef.c             |  418 +++----
 src/acpica/source/compiler/aslprepkg.c             |  754 ++++++++++++
 src/acpica/source/compiler/aslresource.c           |   44 +-
 src/acpica/source/compiler/aslrestype1.c           |   32 +-
 src/acpica/source/compiler/aslrestype1i.c          |   27 +-
 src/acpica/source/compiler/aslrestype2.c           |   26 +-
 src/acpica/source/compiler/aslrestype2d.c          |   27 +-
 src/acpica/source/compiler/aslrestype2e.c          |   27 +-
 src/acpica/source/compiler/aslrestype2q.c          |   27 +-
 src/acpica/source/compiler/aslrestype2s.c          |   26 +-
 src/acpica/source/compiler/aslrestype2w.c          |   27 +-
 src/acpica/source/compiler/aslstartup.c            |  193 ++-
 src/acpica/source/compiler/aslstubs.c              |   29 +-
 src/acpica/source/compiler/aslsupport.l            |   55 +-
 src/acpica/source/compiler/asltransform.c          |   41 +-
 src/acpica/source/compiler/asltree.c               |  147 ++-
 src/acpica/source/compiler/asltypes.h              |   40 +-
 src/acpica/source/compiler/aslutils.c              |  192 +--
 src/acpica/source/compiler/asluuid.c               |   26 +-
 src/acpica/source/compiler/aslwalks.c              |  603 +--------
 src/acpica/source/compiler/aslxref.c               |  946 ++++++++++++++
 src/acpica/source/compiler/dtcompile.c             |   38 +-
 src/acpica/source/compiler/dtcompiler.h            |   51 +-
 src/acpica/source/compiler/dtexpress.c             |   26 +-
 src/acpica/source/compiler/dtfield.c               |   26 +-
 src/acpica/source/compiler/dtio.c                  |  220 +++-
 src/acpica/source/compiler/dtparser.l              |   26 +-
 src/acpica/source/compiler/dtparser.y              |   26 +-
 src/acpica/source/compiler/dtsubtable.c            |   27 +-
 src/acpica/source/compiler/dttable.c               |  170 ++-
 src/acpica/source/compiler/dttemplate.c            |   53 +-
 src/acpica/source/compiler/dttemplate.h            |  135 +-
 src/acpica/source/compiler/dtutils.c               |   26 +-
 src/acpica/source/compiler/preprocess.h            |   37 +-
 src/acpica/source/compiler/prexpress.c             |   26 +-
 src/acpica/source/compiler/prmacros.c              |   26 +-
 src/acpica/source/compiler/prparser.l              |   26 +-
 src/acpica/source/compiler/prparser.y              |   26 +-
 src/acpica/source/compiler/prscan.c                |   26 +-
 src/acpica/source/compiler/prutils.c               |   45 +-
 src/acpica/source/components/debugger/dbcmds.c     |  299 +++--
 src/acpica/source/components/debugger/dbconvert.c  |  597 +++++++++
 src/acpica/source/components/debugger/dbdisply.c   |  167 ++-
 src/acpica/source/components/debugger/dbexec.c     |  481 ++------
 src/acpica/source/components/debugger/dbfileio.c   |   59 +-
 src/acpica/source/components/debugger/dbhistry.c   |   27 +-
 src/acpica/source/components/debugger/dbinput.c    |  355 ++++--
 src/acpica/source/components/debugger/dbmethod.c   |  155 ++-
 src/acpica/source/components/debugger/dbnames.c    |   56 +-
 src/acpica/source/components/debugger/dbstats.c    |   36 +-
 src/acpica/source/components/debugger/dbutils.c    |   42 +-
 src/acpica/source/components/debugger/dbxface.c    |   30 +-
 .../source/components/disassembler/dmbuffer.c      |  195 ++-
 .../source/components/disassembler/dmdeferred.c    |  344 ++++++
 .../source/components/disassembler/dmnames.c       |   42 +-
 .../source/components/disassembler/dmobject.c      |   30 +-
 .../source/components/disassembler/dmopcode.c      |   36 +-
 .../source/components/disassembler/dmresrc.c       |   43 +-
 .../source/components/disassembler/dmresrcl.c      |   80 +-
 .../source/components/disassembler/dmresrcl2.c     |   71 +-
 .../source/components/disassembler/dmresrcs.c      |   47 +-
 .../source/components/disassembler/dmutils.c       |   36 +-
 src/acpica/source/components/disassembler/dmwalk.c |   55 +-
 src/acpica/source/components/dispatcher/dsargs.c   |   26 +-
 .../source/components/dispatcher/dscontrol.c       |   28 +-
 src/acpica/source/components/dispatcher/dsfield.c  |   30 +-
 src/acpica/source/components/dispatcher/dsinit.c   |   30 +-
 src/acpica/source/components/dispatcher/dsmethod.c |   38 +-
 src/acpica/source/components/dispatcher/dsmthdat.c |   42 +-
 src/acpica/source/components/dispatcher/dsobject.c |   49 +-
 src/acpica/source/components/dispatcher/dsopcode.c |   29 +-
 src/acpica/source/components/dispatcher/dsutils.c  |   58 +-
 src/acpica/source/components/dispatcher/dswexec.c  |   42 +-
 src/acpica/source/components/dispatcher/dswload.c  |   26 +-
 src/acpica/source/components/dispatcher/dswload2.c |   33 +-
 src/acpica/source/components/dispatcher/dswscope.c |   28 +-
 src/acpica/source/components/dispatcher/dswstate.c |   40 +-
 src/acpica/source/components/events/evevent.c      |   40 +-
 src/acpica/source/components/events/evglock.c      |   26 +-
 src/acpica/source/components/events/evgpe.c        |   45 +-
 src/acpica/source/components/events/evgpeblk.c     |   36 +-
 src/acpica/source/components/events/evgpeinit.c    |   29 +-
 src/acpica/source/components/events/evgpeutil.c    |   26 +-
 src/acpica/source/components/events/evhandler.c    |  650 ++++++++++
 src/acpica/source/components/events/evmisc.c       |   26 +-
 src/acpica/source/components/events/evregion.c     |  717 ++---------
 src/acpica/source/components/events/evrgnini.c     |   31 +-
 src/acpica/source/components/events/evsci.c        |   26 +-
 src/acpica/source/components/events/evxface.c      |   44 +-
 src/acpica/source/components/events/evxfevnt.c     |   40 +-
 src/acpica/source/components/events/evxfgpe.c      |   32 +-
 src/acpica/source/components/events/evxfregn.c     |   27 +-
 src/acpica/source/components/executer/exconfig.c   |   47 +-
 src/acpica/source/components/executer/exconvrt.c   |   30 +-
 src/acpica/source/components/executer/excreate.c   |   34 +-
 src/acpica/source/components/executer/exdebug.c    |   34 +-
 src/acpica/source/components/executer/exdump.c     |   43 +-
 src/acpica/source/components/executer/exfield.c    |   32 +-
 src/acpica/source/components/executer/exfldio.c    |   55 +-
 src/acpica/source/components/executer/exmisc.c     |   33 +-
 src/acpica/source/components/executer/exmutex.c    |   34 +-
 src/acpica/source/components/executer/exnames.c    |   31 +-
 src/acpica/source/components/executer/exoparg1.c   |   38 +-
 src/acpica/source/components/executer/exoparg2.c   |   40 +-
 src/acpica/source/components/executer/exoparg3.c   |   31 +-
 src/acpica/source/components/executer/exoparg6.c   |   31 +-
 src/acpica/source/components/executer/exprep.c     |   40 +-
 src/acpica/source/components/executer/exregion.c   |   39 +-
 src/acpica/source/components/executer/exresnte.c   |   37 +-
 src/acpica/source/components/executer/exresolv.c   |   31 +-
 src/acpica/source/components/executer/exresop.c    |   33 +-
 src/acpica/source/components/executer/exstore.c    |   55 +-
 src/acpica/source/components/executer/exstoren.c   |   41 +-
 src/acpica/source/components/executer/exstorob.c   |   33 +-
 src/acpica/source/components/executer/exsystem.c   |   36 +-
 src/acpica/source/components/executer/exutils.c    |   47 +-
 src/acpica/source/components/hardware/hwacpi.c     |   48 +-
 src/acpica/source/components/hardware/hwesleep.c   |   51 +-
 src/acpica/source/components/hardware/hwgpe.c      |   41 +-
 src/acpica/source/components/hardware/hwpci.c      |   30 +-
 src/acpica/source/components/hardware/hwregs.c     |   27 +-
 src/acpica/source/components/hardware/hwsleep.c    |   53 +-
 src/acpica/source/components/hardware/hwvalid.c    |   29 +-
 src/acpica/source/components/hardware/hwxface.c    |  162 +--
 src/acpica/source/components/hardware/hwxfsleep.c  |   50 +-
 src/acpica/source/components/namespace/nsaccess.c  |   31 +-
 src/acpica/source/components/namespace/nsalloc.c   |   32 +-
 .../source/components/namespace/nsarguments.c      |  375 ++++++
 src/acpica/source/components/namespace/nsconvert.c |  553 +++++++++
 src/acpica/source/components/namespace/nsdump.c    |   38 +-
 src/acpica/source/components/namespace/nsdumpdv.c  |   28 +-
 src/acpica/source/components/namespace/nseval.c    |  273 ++--
 src/acpica/source/components/namespace/nsinit.c    |   57 +-
 src/acpica/source/components/namespace/nsload.c    |   37 +-
 src/acpica/source/components/namespace/nsnames.c   |   30 +-
 src/acpica/source/components/namespace/nsobject.c  |   36 +-
 src/acpica/source/components/namespace/nsparse.c   |   36 +-
 src/acpica/source/components/namespace/nspredef.c  | 1044 ++--------------
 src/acpica/source/components/namespace/nsprepkg.c  |  719 +++++++++++
 src/acpica/source/components/namespace/nsrepair.c  |  458 +++----
 src/acpica/source/components/namespace/nsrepair2.c |  115 +-
 src/acpica/source/components/namespace/nssearch.c  |   27 +-
 src/acpica/source/components/namespace/nsutils.c   |  135 +-
 src/acpica/source/components/namespace/nswalk.c    |   38 +-
 src/acpica/source/components/namespace/nsxfeval.c  |  221 +++-
 src/acpica/source/components/namespace/nsxfname.c  |   99 +-
 src/acpica/source/components/namespace/nsxfobj.c   |   31 +-
 src/acpica/source/components/parser/psargs.c       |   40 +-
 src/acpica/source/components/parser/psloop.c       |  667 +---------
 src/acpica/source/components/parser/psobject.c     |  755 ++++++++++++
 src/acpica/source/components/parser/psopcode.c     |  212 +---
 src/acpica/source/components/parser/psopinfo.c     |  310 +++++
 src/acpica/source/components/parser/psparse.c      |   40 +-
 src/acpica/source/components/parser/psscope.c      |   27 +-
 src/acpica/source/components/parser/pstree.c       |   28 +-
 src/acpica/source/components/parser/psutils.c      |   42 +-
 src/acpica/source/components/parser/pswalk.c       |   26 +-
 src/acpica/source/components/parser/psxface.c      |   40 +-
 src/acpica/source/components/resources/rsaddr.c    |   28 +-
 src/acpica/source/components/resources/rscalc.c    |   47 +-
 src/acpica/source/components/resources/rscreate.c  |   31 +-
 src/acpica/source/components/resources/rsdump.c    |  349 +-----
 .../source/components/resources/rsdumpinfo.c       |  429 +++++++
 src/acpica/source/components/resources/rsinfo.c    |   26 +-
 src/acpica/source/components/resources/rsio.c      |   28 +-
 src/acpica/source/components/resources/rsirq.c     |   58 +-
 src/acpica/source/components/resources/rslist.c    |   44 +-
 src/acpica/source/components/resources/rsmemory.c  |   28 +-
 src/acpica/source/components/resources/rsmisc.c    |   90 +-
 src/acpica/source/components/resources/rsserial.c  |   34 +-
 src/acpica/source/components/resources/rsutils.c   |   32 +-
 src/acpica/source/components/resources/rsxface.c   |  145 ++-
 src/acpica/source/components/tables/tbfadt.c       |   31 +-
 src/acpica/source/components/tables/tbfind.c       |   28 +-
 src/acpica/source/components/tables/tbinstal.c     |   49 +-
 src/acpica/source/components/tables/tbutils.c      |   28 +-
 src/acpica/source/components/tables/tbxface.c      |  100 +-
 src/acpica/source/components/tables/tbxfload.c     |   30 +-
 src/acpica/source/components/tables/tbxfroot.c     |   31 +-
 src/acpica/source/components/utilities/utaddress.c |   26 +-
 src/acpica/source/components/utilities/utalloc.c   |   27 +-
 src/acpica/source/components/utilities/utcache.c   |   46 +-
 src/acpica/source/components/utilities/utcopy.c    |   28 +-
 src/acpica/source/components/utilities/utdebug.c   |  189 +--
 src/acpica/source/components/utilities/utdecode.c  |   26 +-
 src/acpica/source/components/utilities/utdelete.c  |  190 +--
 src/acpica/source/components/utilities/uteval.c    |   28 +-
 src/acpica/source/components/utilities/utexcep.c   |   55 +-
 src/acpica/source/components/utilities/utglobal.c  |   28 +-
 src/acpica/source/components/utilities/utids.c     |  132 +-
 src/acpica/source/components/utilities/utinit.c    |   28 +-
 src/acpica/source/components/utilities/utlock.c    |   27 +-
 src/acpica/source/components/utilities/utmath.c    |   30 +-
 src/acpica/source/components/utilities/utmisc.c    | 1121 +++--------------
 src/acpica/source/components/utilities/utmutex.c   |   53 +-
 src/acpica/source/components/utilities/utobject.c  |   38 +-
 src/acpica/source/components/utilities/utosi.c     |   57 +-
 src/acpica/source/components/utilities/utownerid.c |  313 +++++
 src/acpica/source/components/utilities/utpredef.c  |  524 ++++++++
 src/acpica/source/components/utilities/utresrc.c   |  104 +-
 src/acpica/source/components/utilities/utstate.c   |   70 +-
 src/acpica/source/components/utilities/utstring.c  |  746 +++++++++++
 src/acpica/source/components/utilities/uttrack.c   |  155 ++-
 src/acpica/source/components/utilities/utxface.c   |  458 ++-----
 src/acpica/source/components/utilities/utxferror.c |   85 +-
 src/acpica/source/components/utilities/utxfinit.c  |  430 +++++++
 src/acpica/source/include/acapps.h                 |   29 +-
 src/acpica/source/include/acbuffer.h               |  318 +++++
 src/acpica/source/include/accommon.h               |   26 +-
 src/acpica/source/include/acconfig.h               |   44 +-
 src/acpica/source/include/acdebug.h                |   81 +-
 src/acpica/source/include/acdisasm.h               |   73 +-
 src/acpica/source/include/acdispat.h               |   26 +-
 src/acpica/source/include/acevents.h               |   55 +-
 src/acpica/source/include/acexcep.h                |  447 +++----
 src/acpica/source/include/acglobal.h               |   36 +-
 src/acpica/source/include/achware.h                |   47 +-
 src/acpica/source/include/acinterp.h               |   28 +-
 src/acpica/source/include/aclocal.h                |   89 +-
 src/acpica/source/include/acmacros.h               |  244 ++--
 src/acpica/source/include/acnames.h                |   32 +-
 src/acpica/source/include/acnamesp.h               |  124 +-
 src/acpica/source/include/acobject.h               |   31 +-
 src/acpica/source/include/acopcode.h               |   32 +-
 src/acpica/source/include/acoutput.h               |  210 +++-
 src/acpica/source/include/acparser.h               |   61 +-
 src/acpica/source/include/acpi.h                   |   26 +-
 src/acpica/source/include/acpiosxf.h               |   31 +-
 src/acpica/source/include/acpixf.h                 |   47 +-
 src/acpica/source/include/acpredef.h               | 1288 +++++++++++++------
 src/acpica/source/include/acresrc.h                |   34 +-
 src/acpica/source/include/acrestyp.h               |   42 +-
 src/acpica/source/include/acstruct.h               |   68 +-
 src/acpica/source/include/actables.h               |   26 +-
 src/acpica/source/include/actbl.h                  |   88 +-
 src/acpica/source/include/actbl1.h                 |   42 +-
 src/acpica/source/include/actbl2.h                 |  242 +++-
 src/acpica/source/include/actbl3.h                 |  161 ++-
 src/acpica/source/include/actypes.h                |   95 +-
 src/acpica/source/include/acutils.h                |  204 +--
 src/acpica/source/include/amlcode.h                |   26 +-
 src/acpica/source/include/amlresrc.h               |   28 +-
 src/acpica/source/include/platform/acenv.h         |   30 +-
 src/acpica/source/include/platform/acgcc.h         |   28 +-
 src/acpica/source/include/platform/aclinux.h       |   63 +-
 .../source/os_specific/service_layers/osunixxf.c   |  164 ++-
 src/acpica/source/tools/acpiexec/aecommon.h        |   27 +-
 src/acpica/source/tools/acpiexec/aehandlers.c      |  121 +-
 287 files changed, 24126 insertions(+), 15022 deletions(-)
 create mode 100644 src/acpica/source/compiler/aslfileio.c
 create mode 100644 src/acpica/source/compiler/aslhex.c
 create mode 100644 src/acpica/source/compiler/asllistsup.c
 create mode 100644 src/acpica/source/compiler/aslmethod.c
 create mode 100644 src/acpica/source/compiler/aslnamesp.c
 create mode 100644 src/acpica/source/compiler/asloffset.c
 create mode 100644 src/acpica/source/compiler/aslprepkg.c
 create mode 100644 src/acpica/source/compiler/aslxref.c
 create mode 100644 src/acpica/source/components/debugger/dbconvert.c
 create mode 100644 src/acpica/source/components/disassembler/dmdeferred.c
 create mode 100644 src/acpica/source/components/events/evhandler.c
 create mode 100644 src/acpica/source/components/namespace/nsarguments.c
 create mode 100644 src/acpica/source/components/namespace/nsconvert.c
 create mode 100644 src/acpica/source/components/namespace/nsprepkg.c
 create mode 100644 src/acpica/source/components/parser/psobject.c
 create mode 100644 src/acpica/source/components/parser/psopinfo.c
 create mode 100644 src/acpica/source/components/resources/rsdumpinfo.c
 create mode 100644 src/acpica/source/components/utilities/utownerid.c
 create mode 100644 src/acpica/source/components/utilities/utpredef.c
 create mode 100644 src/acpica/source/components/utilities/utstring.c
 create mode 100644 src/acpica/source/components/utilities/utxfinit.c
 create mode 100644 src/acpica/source/include/acbuffer.h
Alex Hung - May 6, 2013, 11:47 a.m.
On 05/03/2013 12:18 PM, Colin King wrote:
> From: Colin Ian King<colin.king@canonical.com>
>
> Update to use ACPICA version 20130418, commits:

Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu - May 7, 2013, 2:38 a.m.
Acked-by: Ivan Hu <ivan.hu@canonical.com>

Patch

diff --git a/src/acpica/Makefile.am b/src/acpica/Makefile.am
index 832d92b..1cf8c15 100644
--- a/src/acpica/Makefile.am
+++ b/src/acpica/Makefile.am
@@ -83,6 +83,7 @@  libfwtsacpica_la_SOURCES =			\
 	$(ACPICA_COMP)/debugger/dbxface.c	\
 	$(ACPICA_COMP)/debugger/dbmethod.c	\
 	$(ACPICA_COMP)/debugger/dbnames.c	\
+	$(ACPICA_COMP)/debugger/dbconvert.c	\
 	$(ACPICA_COMP)/disassembler/dmbuffer.c	\
 	$(ACPICA_COMP)/disassembler/dmnames.c	\
 	$(ACPICA_COMP)/disassembler/dmobject.c	\
@@ -93,6 +94,7 @@  libfwtsacpica_la_SOURCES =			\
 	$(ACPICA_COMP)/disassembler/dmutils.c	\
 	$(ACPICA_COMP)/disassembler/dmwalk.c	\
 	$(ACPICA_COMP)/disassembler/dmresrcl2.c	\
+	$(ACPICA_COMP)/disassembler/dmdeferred.c \
 	$(ACPICA_COMP)/dispatcher/dsfield.c	\
 	$(ACPICA_COMP)/dispatcher/dsinit.c	\
 	$(ACPICA_COMP)/dispatcher/dsmethod.c	\
@@ -120,6 +122,7 @@  libfwtsacpica_la_SOURCES =			\
 	$(ACPICA_COMP)/events/evxfevnt.c	\
 	$(ACPICA_COMP)/events/evxfregn.c	\
 	$(ACPICA_COMP)/events/evglock.c		\
+	$(ACPICA_COMP)/events/evhandler.c	\
 	$(ACPICA_COMP)/executer/exfield.c	\
 	$(ACPICA_COMP)/executer/exfldio.c	\
 	$(ACPICA_COMP)/executer/exmisc.c	\
@@ -172,6 +175,9 @@  libfwtsacpica_la_SOURCES =			\
 	$(ACPICA_COMP)/namespace/nsxfeval.c	\
 	$(ACPICA_COMP)/namespace/nsxfname.c	\
 	$(ACPICA_COMP)/namespace/nsxfobj.c	\
+	$(ACPICA_COMP)/namespace/nsconvert.c	\
+	$(ACPICA_COMP)/namespace/nsprepkg.c	\
+	$(ACPICA_COMP)/namespace/nsarguments.c	\
 	$(ACPICA_COMP)/parser/psargs.c		\
 	$(ACPICA_COMP)/parser/psloop.c		\
 	$(ACPICA_COMP)/parser/psopcode.c	\
@@ -181,6 +187,8 @@  libfwtsacpica_la_SOURCES =			\
 	$(ACPICA_COMP)/parser/psutils.c		\
 	$(ACPICA_COMP)/parser/pswalk.c		\
 	$(ACPICA_COMP)/parser/psxface.c		\
+	$(ACPICA_COMP)/parser/psopinfo.c	\
+	$(ACPICA_COMP)/parser/psobject.c	\
 	$(ACPICA_COMP)/resources/rsaddr.c	\
 	$(ACPICA_COMP)/resources/rscalc.c	\
 	$(ACPICA_COMP)/resources/rscreate.c	\
@@ -194,6 +202,7 @@  libfwtsacpica_la_SOURCES =			\
 	$(ACPICA_COMP)/resources/rsutils.c	\
 	$(ACPICA_COMP)/resources/rsxface.c	\
 	$(ACPICA_COMP)/resources/rsserial.c	\
+	$(ACPICA_COMP)/resources/rsdumpinfo.c	\
 	$(ACPICA_COMP)/tables/tbfadt.c		\
 	$(ACPICA_COMP)/tables/tbfind.c		\
 	$(ACPICA_COMP)/tables/tbinstal.c	\
@@ -224,6 +233,10 @@  libfwtsacpica_la_SOURCES =			\
 	$(ACPICA_COMP)/utilities/utxface.c	\
 	$(ACPICA_COMP)/utilities/utdecode.c	\
 	$(ACPICA_COMP)/utilities/utexcep.c	\
+	$(ACPICA_COMP)/utilities/utpredef.c	\
+	$(ACPICA_COMP)/utilities/utstring.c	\
+	$(ACPICA_COMP)/utilities/utownerid.c	\
+	$(ACPICA_COMP)/utilities/utxfinit.c	\
 	$(ACPICA_SRC)/tools/acpiexec/aehandlers.c
 
 libfwtsacpica_la_LIBADD = \
diff --git a/src/acpica/source/common/adfile.c b/src/acpica/source/common/adfile.c
index 36c3176..1af4cc2 100644
--- a/src/acpica/source/common/adfile.c
+++ b/src/acpica/source/common/adfile.c
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -172,7 +172,7 @@  AdGenerateFilename (
 
     FilenameBuf[i] = 0;
     strcat (FilenameBuf, ACPI_TABLE_FILE_SUFFIX);
-    return FilenameBuf;
+    return (FilenameBuf);
 }
 
 
@@ -196,19 +196,24 @@  AdWriteBuffer (
     char                    *Buffer,
     UINT32                  Length)
 {
-    FILE                    *fp;
+    FILE                    *File;
     ACPI_SIZE               Actual;
 
 
-    fp = fopen (Filename, "wb");
-    if (!fp)
+    File = fopen (Filename, "wb");
+    if (!File)
     {
-        printf ("Couldn't open %s\n", Filename);
+        printf ("Could not open file %s\n", Filename);
         return (-1);
     }
 
-    Actual = fwrite (Buffer, (size_t) Length, 1, fp);
-    fclose (fp);
+    Actual = fwrite (Buffer, 1, (size_t) Length, File);
+    if (Actual != Length)
+    {
+        printf ("Could not write to file %s\n", Filename);
+    }
+
+    fclose (File);
     return ((INT32) Actual);
 }
 
@@ -255,7 +260,7 @@  AdWriteTable (
  * RETURN:      New filename containing the original base + the new suffix
  *
  * DESCRIPTION: Generate a new filename from the ASL source filename and a new
- *              extension.  Used to create the *.LST, *.TXT, etc. files.
+ *              extension. Used to create the *.LST, *.TXT, etc. files.
  *
  ******************************************************************************/
 
@@ -295,7 +300,7 @@  FlGenerateFilename (
         strcat (NewFilename, Suffix);
     }
 
-    return NewFilename;
+    return (NewFilename);
 }
 
 
@@ -404,5 +409,3 @@  FlSplitInputPathname (
     *OutFilename = Filename;
     return (AE_OK);
 }
-
-
diff --git a/src/acpica/source/common/adisasm.c b/src/acpica/source/common/adisasm.c
index 6cd67c7..5d6f7ba 100644
--- a/src/acpica/source/common/adisasm.c
+++ b/src/acpica/source/common/adisasm.c
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -132,16 +132,20 @@ 
 #define _COMPONENT          ACPI_TOOLS
         ACPI_MODULE_NAME    ("adisasm")
 
-
+/*
+ * Older versions of Bison won't emit this external in the generated header.
+ * Newer versions do emit the external, so we don't need to do it.
+ */
+#ifndef ASLCOMPILER_ASLCOMPILERPARSE_H
 extern int                  AslCompilerdebug;
-
+#endif
 
 ACPI_STATUS
-LsDisplayNamespace (
+NsDisplayNamespace (
     void);
 
 void
-LsSetupNsList (
+NsSetupNamespaceListing (
     void                    *Handle);
 
 
@@ -156,17 +160,6 @@  AdCreateTableHeader (
     char                    *Filename,
     ACPI_TABLE_HEADER       *Table);
 
-static ACPI_STATUS
-AdDeferredParse (
-    ACPI_PARSE_OBJECT       *Op,
-    UINT8                   *Aml,
-    UINT32                  AmlLength);
-
-static ACPI_STATUS
-AdParseDeferredOps (
-    ACPI_PARSE_OBJECT       *Root);
-
-
 /* Stubs for ASL compiler */
 
 #ifndef ACPI_ASL_COMPILER
@@ -364,7 +357,7 @@  AdAmlDisassemble (
         Status = AcpiDbGetTableFromFile (Filename, &Table);
         if (ACPI_FAILURE (Status))
         {
-            return Status;
+            return (Status);
         }
 
         /*
@@ -379,14 +372,13 @@  AdAmlDisassemble (
                 /* Next external file */
 
                 ExternalFileList = ExternalFileList->Next;
-
                 continue;
             }
 
             Status = AcpiDbGetTableFromFile (ExternalFilename, &ExternalTable);
             if (ACPI_FAILURE (Status))
             {
-                return Status;
+                return (Status);
             }
 
             /* Load external table for symbol resolution */
@@ -398,7 +390,7 @@  AdAmlDisassemble (
                 {
                     AcpiOsPrintf ("Could not parse external ACPI tables, %s\n",
                         AcpiFormatException (Status));
-                    return Status;
+                    return (Status);
                 }
 
                 /*
@@ -429,12 +421,12 @@  AdAmlDisassemble (
         {
             AcpiOsPrintf ("Could not get ACPI tables, %s\n",
                 AcpiFormatException (Status));
-            return Status;
+            return (Status);
         }
 
         if (!AcpiGbl_DbOpt_disasm)
         {
-            return AE_OK;
+            return (AE_OK);
         }
 
         /* Obtained the local tables, just disassemble the DSDT */
@@ -444,7 +436,7 @@  AdAmlDisassemble (
         {
             AcpiOsPrintf ("Could not get DSDT, %s\n",
                 AcpiFormatException (Status));
-            return Status;
+            return (Status);
         }
 
         AcpiOsPrintf ("\nDisassembly of DSDT\n");
@@ -452,7 +444,7 @@  AdAmlDisassemble (
     }
 
     /*
-     * Output:  ASL code. Redirect to a file if requested
+     * Output: ASL code. Redirect to a file if requested
      */
     if (OutToFile)
     {
@@ -509,8 +501,8 @@  AdAmlDisassemble (
         {
             AcpiOsPrintf ("/**** Before second load\n");
 
-            LsSetupNsList (File);
-            LsDisplayNamespace ();
+            NsSetupNamespaceListing (File);
+            NsDisplayNamespace ();
             AcpiOsPrintf ("*****/\n");
         }
 
@@ -578,8 +570,8 @@  AdAmlDisassemble (
             if (AslCompilerdebug)
             {
                 AcpiOsPrintf ("/**** After second load and resource conversion\n");
-                LsSetupNsList (File);
-                LsDisplayNamespace ();
+                NsSetupNamespaceListing (File);
+                NsDisplayNamespace ();
                 AcpiOsPrintf ("*****/\n");
 
                 AcpiDmDumpTree (AcpiGbl_ParseOpRoot);
@@ -599,7 +591,14 @@  AdAmlDisassemble (
 
         if (AcpiGbl_DbOpt_disasm)
         {
+            /* This is the real disassembly */
+
             AdDisplayTables (Filename, Table);
+
+            /* Dump hex table if requested (-vt) */
+
+            AcpiDmDumpDataTable (Table);
+
             fprintf (stderr, "Disassembly completed\n");
             fprintf (stderr, "ASL Output:    %s - %u bytes\n",
                 DisasmFilename, AdGetFileSize (File));
@@ -613,17 +612,12 @@  Cleanup:
         ACPI_FREE (Table);
     }
 
-    if (DisasmFilename)
-    {
-        ACPI_FREE (DisasmFilename);
-    }
-
     if (OutToFile && File)
     {
         if (AslCompilerdebug) /* Display final namespace, with transforms */
         {
-            LsSetupNsList (File);
-            LsDisplayNamespace ();
+            NsSetupNamespaceListing (File);
+            NsDisplayNamespace ();
         }
 
         fclose (File);
@@ -740,7 +734,7 @@  AdCreateTableHeader (
     AcpiOsPrintf (" *     OEM Revision     0x%8.8X (%u)\n", Table->OemRevision, Table->OemRevision);
     AcpiOsPrintf (" *     Compiler ID      \"%.4s\"\n",     Table->AslCompilerId);
     AcpiOsPrintf (" *     Compiler Version 0x%8.8X (%u)\n", Table->AslCompilerRevision, Table->AslCompilerRevision);
-    AcpiOsPrintf (" */\n\n");
+    AcpiOsPrintf (" */\n");
 
     /* Create AML output filename based on input filename */
 
@@ -788,7 +782,7 @@  AdDisplayTables (
 
     if (!AcpiGbl_ParseOpRoot)
     {
-        return AE_NOT_EXIST;
+        return (AE_NOT_EXIST);
     }
 
     if (!AcpiGbl_DbOpt_verbose)
@@ -801,216 +795,15 @@  AdDisplayTables (
     if (AcpiGbl_DbOpt_verbose)
     {
         AcpiOsPrintf ("\n\nTable Header:\n");
-        AcpiUtDumpBuffer ((UINT8 *) Table, sizeof (ACPI_TABLE_HEADER),
+        AcpiUtDebugDumpBuffer ((UINT8 *) Table, sizeof (ACPI_TABLE_HEADER),
             DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
 
         AcpiOsPrintf ("Table Body (Length 0x%X)\n", Table->Length);
-        AcpiUtDumpBuffer (((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER)), Table->Length,
-            DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
-    }
-
-    return AE_OK;
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AdDeferredParse
- *
- * PARAMETERS:  Op                  - Root Op of the deferred opcode
- *              Aml                 - Pointer to the raw AML
- *              AmlLength           - Length of the AML
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Parse one deferred opcode
- *              (Methods, operation regions, etc.)
- *
- *****************************************************************************/
-
-static ACPI_STATUS
-AdDeferredParse (
-    ACPI_PARSE_OBJECT       *Op,
-    UINT8                   *Aml,
-    UINT32                  AmlLength)
-{
-    ACPI_WALK_STATE         *WalkState;
-    ACPI_STATUS             Status;
-    ACPI_PARSE_OBJECT       *SearchOp;
-    ACPI_PARSE_OBJECT       *StartOp;
-    UINT32                  BaseAmlOffset;
-    ACPI_PARSE_OBJECT       *ExtraOp;
-
-
-    ACPI_FUNCTION_TRACE (AdDeferredParse);
-
-
-    fprintf (stderr, ".");
-
-    if (!Aml || !AmlLength)
-    {
-        return_ACPI_STATUS (AE_OK);
-    }
-
-    ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Parsing %s [%4.4s]\n",
-        Op->Common.AmlOpName, (char *) &Op->Named.Name));
-
-    WalkState = AcpiDsCreateWalkState (0, Op, NULL, NULL);
-    if (!WalkState)
-    {
-        return_ACPI_STATUS (AE_NO_MEMORY);
-    }
-
-    Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, Aml,
-                    AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
-    if (ACPI_FAILURE (Status))
-    {
-        return_ACPI_STATUS (Status);
-    }
-
-    /* Parse the method */
-
-    WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE;
-    WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE;
-    Status = AcpiPsParseAml (WalkState);
-
-    /*
-     * We need to update all of the Aml offsets, since the parser thought
-     * that the method began at offset zero.  In reality, it began somewhere
-     * within the ACPI table, at the BaseAmlOffset.  Walk the entire tree that
-     * was just created and update the AmlOffset in each Op
-     */
-    BaseAmlOffset = (Op->Common.Value.Arg)->Common.AmlOffset + 1;
-    StartOp = (Op->Common.Value.Arg)->Common.Next;
-    SearchOp = StartOp;
-
-    /* Walk the parse tree */
-
-    while (SearchOp)
-    {
-        SearchOp->Common.AmlOffset += BaseAmlOffset;
-        SearchOp = AcpiPsGetDepthNext (StartOp, SearchOp);
-    }
-
-    /*
-     * Link the newly parsed subtree into the main parse tree
-     */
-    switch (Op->Common.AmlOpcode)
-    {
-    case AML_BUFFER_OP:
-    case AML_PACKAGE_OP:
-    case AML_VAR_PACKAGE_OP:
-
-        switch (Op->Common.AmlOpcode)
-        {
-        case AML_PACKAGE_OP:
-            ExtraOp = Op->Common.Value.Arg;
-            ExtraOp = ExtraOp->Common.Next;
-            Op->Common.Value.Arg = ExtraOp->Common.Value.Arg;
-            break;
-
-        case AML_VAR_PACKAGE_OP:
-        case AML_BUFFER_OP:
-        default:
-            ExtraOp = Op->Common.Value.Arg;
-            Op->Common.Value.Arg = ExtraOp->Common.Value.Arg;
-            break;
-        }
-
-        /* Must point all parents to the main tree */
-
-        StartOp = Op;
-        SearchOp = StartOp;
-        while (SearchOp)
-        {
-            if (SearchOp->Common.Parent == ExtraOp)
-            {
-                SearchOp->Common.Parent = Op;
-            }
-            SearchOp = AcpiPsGetDepthNext (StartOp, SearchOp);
-        }
-        break;
-
-    default:
-        break;
-    }
-
-    return_ACPI_STATUS (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AdParseDeferredOps
- *
- * PARAMETERS:  Root                - Root of the parse tree
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Parse the deferred opcodes (Methods, regions, etc.)
- *
- *****************************************************************************/
-
-static ACPI_STATUS
-AdParseDeferredOps (
-    ACPI_PARSE_OBJECT       *Root)
-{
-    ACPI_PARSE_OBJECT       *Op = Root;
-    ACPI_STATUS             Status = AE_OK;
-    const ACPI_OPCODE_INFO  *OpInfo;
-
-
-    ACPI_FUNCTION_NAME (AdParseDeferredOps);
-    fprintf (stderr, "Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n");
-
-    while (Op)
-    {
-        OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
-        if (!(OpInfo->Flags & AML_DEFER))
-        {
-            Op = AcpiPsGetDepthNext (Root, Op);
-            continue;
-        }
-
-        switch (Op->Common.AmlOpcode)
-        {
-        case AML_METHOD_OP:
-        case AML_BUFFER_OP:
-        case AML_PACKAGE_OP:
-        case AML_VAR_PACKAGE_OP:
-
-            Status = AdDeferredParse (Op, Op->Named.Data, Op->Named.Length);
-            if (ACPI_FAILURE (Status))
-            {
-                return_ACPI_STATUS (Status);
-            }
-            break;
-
-        case AML_REGION_OP:
-        case AML_DATA_REGION_OP:
-        case AML_CREATE_QWORD_FIELD_OP:
-        case AML_CREATE_DWORD_FIELD_OP:
-        case AML_CREATE_WORD_FIELD_OP:
-        case AML_CREATE_BYTE_FIELD_OP:
-        case AML_CREATE_BIT_FIELD_OP:
-        case AML_CREATE_FIELD_OP:
-        case AML_BANK_FIELD_OP:
-
-            /* Nothing to do in these cases */
-
-            break;
-
-        default:
-            ACPI_ERROR ((AE_INFO, "Unhandled deferred opcode [%s]",
-                Op->Common.AmlOpName));
-            break;
-        }
-
-        Op = AcpiPsGetDepthNext (Root, Op);
+        AcpiUtDebugDumpBuffer (((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER)),
+            Table->Length, DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
     }
 
-    fprintf (stderr, "\n");
-    return Status;
+    return (AE_OK);
 }
 
 
@@ -1047,7 +840,7 @@  AdGetLocalTables (
         if (!NewTable)
         {
             fprintf (stderr, "Could not obtain RSDT\n");
-            return AE_NO_ACPI_TABLES;
+            return (AE_NO_ACPI_TABLES);
         }
         else
         {
@@ -1067,7 +860,7 @@  AdGetLocalTables (
         /*
          * Determine the number of tables pointed to by the RSDT/XSDT.
          * This is defined by the ACPI Specification to be the number of
-         * pointers contained within the RSDT/XSDT.  The size of the pointers
+         * pointers contained within the RSDT/XSDT. The size of the pointers
          * is architecture-dependent.
          */
         NumTables = (NewTable->Length - sizeof (ACPI_TABLE_HEADER)) / PointerSize;
@@ -1104,13 +897,13 @@  AdGetLocalTables (
         if (ACPI_FAILURE (Status))
         {
             fprintf (stderr, "Could not store DSDT\n");
-            return AE_NO_ACPI_TABLES;
+            return (AE_NO_ACPI_TABLES);
         }
     }
     else
     {
         fprintf (stderr, "Could not obtain DSDT\n");
-        return AE_NO_ACPI_TABLES;
+        return (AE_NO_ACPI_TABLES);
     }
 
 #if 0
@@ -1129,7 +922,7 @@  AdGetLocalTables (
     } while (NewTable);
 #endif
 
-    return AE_OK;
+    return (AE_OK);
 }
 
 
@@ -1164,7 +957,7 @@  AdParseTable (
 
     if (!Table)
     {
-        return AE_NOT_EXIST;
+        return (AE_NOT_EXIST);
     }
 
     /* Pass 1:  Parse everything except control method bodies */
@@ -1179,7 +972,7 @@  AdParseTable (
     AcpiGbl_ParseOpRoot = AcpiPsCreateScopeOp ();
     if (!AcpiGbl_ParseOpRoot)
     {
-        return AE_NO_MEMORY;
+        return (AE_NO_MEMORY);
     }
 
     /* Create and initialize a new walk state */
@@ -1204,7 +997,7 @@  AdParseTable (
     Status = AcpiPsParseAml (WalkState);
     if (ACPI_FAILURE (Status))
     {
-        return Status;
+        return (Status);
     }
 
     /* If LoadTable is FALSE, we are parsing the last loaded table */
@@ -1219,19 +1012,19 @@  AdParseTable (
                     Table->Length, ACPI_TABLE_ORIGIN_ALLOCATED, &TableIndex);
         if (ACPI_FAILURE (Status))
         {
-            return Status;
+            return (Status);
         }
         Status = AcpiTbAllocateOwnerId (TableIndex);
         if (ACPI_FAILURE (Status))
         {
-            return Status;
+            return (Status);
         }
         if (OwnerId)
         {
             Status = AcpiTbGetOwnerId (TableIndex, OwnerId);
             if (ACPI_FAILURE (Status))
             {
-                return Status;
+                return (Status);
             }
         }
     }
@@ -1248,19 +1041,19 @@  AdParseTable (
 
     if (External)
     {
-        return AE_OK;
+        return (AE_OK);
     }
 
     /* Pass 3: Parse control methods and link their parse trees into the main parse tree */
 
-    Status = AdParseDeferredOps (AcpiGbl_ParseOpRoot);
+    fprintf (stderr, "Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n");
+    Status = AcpiDmParseDeferredOps (AcpiGbl_ParseOpRoot);
+    fprintf (stderr, "\n");
 
     /* Process Resource Templates */
 
     AcpiDmFindResources (AcpiGbl_ParseOpRoot);
 
     fprintf (stderr, "Parsing completed\n");
-    return AE_OK;
+    return (AE_OK);
 }
-
-
diff --git a/src/acpica/source/common/adwalk.c b/src/acpica/source/common/adwalk.c
index 00d9bb6..0e3c71a 100644
--- a/src/acpica/source/common/adwalk.c
+++ b/src/acpica/source/common/adwalk.c
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -726,8 +726,8 @@  AcpiDmLoadDescendingOp (
 
         while (AcpiGbl_PreDefinedNames[PreDefineIndex].Name)
         {
-            if (!ACPI_STRNCMP (Node->Name.Ascii,
-                AcpiGbl_PreDefinedNames[PreDefineIndex].Name, 4))
+            if (ACPI_COMPARE_NAME (Node->Name.Ascii,
+                AcpiGbl_PreDefinedNames[PreDefineIndex].Name))
             {
                 PreDefined = TRUE;
                 break;
@@ -859,7 +859,7 @@  AcpiDmXrefDescendingOp (
     }
 
     /*
-     * Lookup the name in the namespace.  Name must exist at this point, or it
+     * Lookup the name in the namespace. Name must exist at this point, or it
      * is an invalid reference.
      *
      * The namespace is also used as a lookup table for references to resource
@@ -909,7 +909,7 @@  AcpiDmXrefDescendingOp (
             }
         }
 
-        AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, ParamCount);
+        AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, ParamCount | 0x80);
         Op->Common.Node = Node;
     }
     else
@@ -1090,5 +1090,3 @@  AcpiDmInspectPossibleArgs (
 
     return (Last);
 }
-
-
diff --git a/src/acpica/source/common/ahpredef.c b/src/acpica/source/common/ahpredef.c
index b8f18cd..78e1960 100644
--- a/src/acpica/source/common/ahpredef.c
+++ b/src/acpica/source/common/ahpredef.c
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -133,7 +133,7 @@ 
 const AH_PREDEFINED_NAME    AslPredefinedInfo[] =
 {
     AH_PREDEF ("_ACx",    "Active Cooling", "Returns the active cooling policy threshold values"),
-    AH_PREDEF ("_ADR",    "Address", "Returns the address of a device on its parent bus"),
+    AH_PREDEF ("_ADR",    "Address", "Returns address of a device on parent bus, and resource field"),
     AH_PREDEF ("_AEI",    "ACPI Event Interrupts", "Returns a list of GPIO events to be used as ACPI events"),
     AH_PREDEF ("_ALC",    "Ambient Light Chromaticity", "Returns the ambient light color chromaticity"),
     AH_PREDEF ("_ALI",    "Ambient Light Illuminance", "Returns the ambient light brightness"),
@@ -185,7 +185,7 @@  const AH_PREDEFINED_NAME    AslPredefinedInfo[] =
     AH_PREDEF ("_DGS",    "Display Graphics State", "Return the current state of the output device"),
     AH_PREDEF ("_DIS",    "Disable Device", "Disables a device"),
     AH_PREDEF ("_DLM",    "Device Lock Mutex", "Defines mutex for OS/AML sharing"),
-    AH_PREDEF ("_DMA",    "Direct Memory Access", "Returns a device's current resources for DMA transactions"),
+    AH_PREDEF ("_DMA",    "Direct Memory Access", "Returns device current resources for DMA transactions, and resource field"),
     AH_PREDEF ("_DOD",    "Display Output Devices", "Enumerate all devices attached to the display adapter"),
     AH_PREDEF ("_DOS",    "Disable Output Switching", "Sets the display output switching mode"),
     AH_PREDEF ("_DPL",    "Device Selection Polarity", "Polarity of Device Selection signal, Resource Descriptor field"),
@@ -270,7 +270,7 @@  const AH_PREDEFINED_NAME    AslPredefinedInfo[] =
     AH_PREDEF ("_PIC",    "Interrupt Model", "Inform AML of the interrupt model in use"),
     AH_PREDEF ("_PIF",    "Power Source Information", "Returns a Power Source information block"),
     AH_PREDEF ("_PIN",    "Pin List", "Pin list, Resource Descriptor field"),
-    AH_PREDEF ("_PLD",    "Physical Device Location", "Returns a device's physical location information"),
+    AH_PREDEF ("_PLD",    "Physical Location of Device", "Returns a device's physical location information"),
     AH_PREDEF ("_PMC",    "Power Meter Capabilities", "Returns a list of Power Meter capabilities info"),
     AH_PREDEF ("_PMD",    "Power Metered Devices", "Returns a list of devices that are measured by the power meter device"),
     AH_PREDEF ("_PMM",    "Power Meter Measurement", "Returns the current value of the Power Meter"),
diff --git a/src/acpica/source/common/dmextern.c b/src/acpica/source/common/dmextern.c
index 622db8a..c9f0fda 100644
--- a/src/acpica/source/common/dmextern.c
+++ b/src/acpica/source/common/dmextern.c
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -118,6 +118,7 @@ 
 #include "amlcode.h"
 #include "acnamesp.h"
 #include "acdisasm.h"
+#include <stdio.h>
 
 
 /*
@@ -225,10 +226,17 @@  AcpiDmNormalizeParentPrefix (
     char                    *Fullpath;
     char                    *ParentPath;
     ACPI_SIZE               Length;
+    UINT32                  Index = 0;
 
 
-    /* Search upwards in the parse tree until we reach a namespace node */
+    if (!Op)
+    {
+        return (NULL);
+    }
 
+    /* Search upwards in the parse tree until we reach the next namespace node */
+
+    Op = Op->Common.Parent;
     while (Op)
     {
         if (Op->Common.Node)
@@ -277,6 +285,13 @@  AcpiDmNormalizeParentPrefix (
          * for the required dot separator (ParentPath.Path)
          */
         Length++;
+
+        /* For External() statements, we do not want a leading '\' */
+
+        if (*ParentPath == AML_ROOT_PREFIX)
+        {
+            Index = 1;
+        }
     }
 
     Fullpath = ACPI_ALLOCATE_ZEROED (Length);
@@ -291,7 +306,7 @@  AcpiDmNormalizeParentPrefix (
      *
      * Copy the parent path
      */
-    ACPI_STRCAT (Fullpath, ParentPath);
+    ACPI_STRCPY (Fullpath, &ParentPath[Index]);
 
     /*
      * Add dot separator
@@ -431,6 +446,7 @@  AcpiDmAddToExternalList (
     ACPI_EXTERNAL_LIST      *NextExternal;
     ACPI_EXTERNAL_LIST      *PrevExternal = NULL;
     ACPI_STATUS             Status;
+    BOOLEAN                 Resolved = FALSE;
 
 
     if (!Path)
@@ -438,7 +454,31 @@  AcpiDmAddToExternalList (
         return;
     }
 
-    /* Externalize the ACPI path */
+    if (Type == ACPI_TYPE_METHOD)
+    {
+        if (Value & 0x80)
+        {
+            Resolved = TRUE;
+        }
+        Value &= 0x07;
+    }
+
+    /*
+     * We don't want External() statements to contain a leading '\'.
+     * This prevents duplicate external statements of the form:
+     *
+     *    External (\ABCD)
+     *    External (ABCD)
+     *
+     * This would cause a compile time error when the disassembled
+     * output file is recompiled.
+     */
+    if ((*Path == AML_ROOT_PREFIX) && (Path[1]))
+    {
+        Path++;
+    }
+
+    /* Externalize the ACPI pathname */
 
     Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path,
                 NULL, &ExternalPath);
@@ -447,8 +487,10 @@  AcpiDmAddToExternalList (
         return;
     }
 
-    /* Get the full pathname from root if "Path" has a parent prefix */
-
+    /*
+     * Get the full pathname from the root if "Path" has one or more
+     * parent prefixes (^). Note: path will not contain a leading '\'.
+     */
     if (*Path == (UINT8) AML_PARENT_PREFIX)
     {
         Fullpath = AcpiDmNormalizeParentPrefix (Op, ExternalPath);
@@ -505,6 +547,7 @@  AcpiDmAddToExternalList (
     NewExternal->Path = ExternalPath;
     NewExternal->Type = Type;
     NewExternal->Value = Value;
+    NewExternal->Resolved = Resolved;
     NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath);
 
     /* Was the external path with parent prefix normalized to a fullpath? */
@@ -725,6 +768,29 @@  AcpiDmEmitExternals (
     }
 
     /*
+     * Determine the number of control methods in the external list, and
+     * also how many of those externals were resolved via the namespace.
+     */
+    NextExternal = AcpiGbl_ExternalList;
+    while (NextExternal)
+    {
+        if (NextExternal->Type == ACPI_TYPE_METHOD)
+        {
+            AcpiGbl_NumExternalMethods++;
+            if (NextExternal->Resolved)
+            {
+                AcpiGbl_ResolvedExternalMethods++;
+            }
+        }
+
+        NextExternal = NextExternal->Next;
+    }
+
+    /* Check if any control methods were unresolved */
+
+    AcpiDmUnresolvedWarning (1);
+
+    /*
      * Walk the list of externals (unresolved references)
      * found during the AML parsing
      */
@@ -736,8 +802,17 @@  AcpiDmEmitExternals (
 
         if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD)
         {
-            AcpiOsPrintf (")    // %u Arguments\n",
-                AcpiGbl_ExternalList->Value);
+            if (AcpiGbl_ExternalList->Resolved)
+            {
+                AcpiOsPrintf (")    // %u Arguments\n",
+                    AcpiGbl_ExternalList->Value);
+            }
+            else
+            {
+                AcpiOsPrintf (")    // Warning: unresolved Method, "
+                    "assuming %u arguments (may be incorrect, see warning above)\n",
+                    AcpiGbl_ExternalList->Value);
+            }
         }
         else
         {
@@ -760,3 +835,172 @@  AcpiDmEmitExternals (
     AcpiOsPrintf ("\n");
 }
 
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDmUnresolvedWarning
+ *
+ * PARAMETERS:  Type                - Where to output the warning.
+ *                                    0 means write to stderr
+ *                                    1 means write to AcpiOsPrintf
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Issue warning message if there are unresolved external control
+ *              methods within the disassembly.
+ *
+ ******************************************************************************/
+
+#if 0
+Summary of the external control method problem:
+
+When the -e option is used with disassembly, the various SSDTs are simply
+loaded into a global namespace for the disassembler to use in order to
+resolve control method references (invocations).
+
+The disassembler tracks any such references, and will emit an External()
+statement for these types of methods, with the proper number of arguments .
+
+Without the SSDTs, the AML does not contain enough information to properly
+disassemble the control method invocation -- because the disassembler does
+not know how many arguments to parse.
+
+An example: Assume we have two control methods. ABCD has one argument, and
+EFGH has zero arguments. Further, we have two additional control methods
+that invoke ABCD and EFGH, named T1 and T2:
+
+    Method (ABCD, 1)
+    {
+    }
+    Method (EFGH, 0)
+    {
+    }
+    Method (T1)
+    {
+        ABCD (Add (2, 7, Local0))
+    }
+    Method (T2)
+    {
+        EFGH ()
+        Add (2, 7, Local0)
+    }
+
+Here is the AML code that is generated for T1 and T2:
+
+     185:      Method (T1)
+
+0000034C:  14 10 54 31 5F 5F 00 ...    "..T1__."
+
+     186:      {
+     187:          ABCD (Add (2, 7, Local0))
+
+00000353:  41 42 43 44 ............    "ABCD"
+00000357:  72 0A 02 0A 07 60 ......    "r....`"
+
+     188:      }
+
+     190:      Method (T2)
+
+0000035D:  14 10 54 32 5F 5F 00 ...    "..T2__."
+
+     191:      {
+     192:          EFGH ()
+
+00000364:  45 46 47 48 ............    "EFGH"
+
+     193:          Add (2, 7, Local0)
+
+00000368:  72 0A 02 0A 07 60 ......    "r....`"
+     194:      }
+
+Note that the AML code for T1 and T2 is essentially identical. When
+disassembling this code, the methods ABCD and EFGH must be known to the
+disassembler, otherwise it does not know how to handle the method invocations.
+
+In other words, if ABCD and EFGH are actually external control methods
+appearing in an SSDT, the disassembler does not know what to do unless
+the owning SSDT has been loaded via the -e option.
+#endif
+
+void
+AcpiDmUnresolvedWarning (
+    UINT8                   Type)
+{
+
+    if (!AcpiGbl_NumExternalMethods)
+    {
+        return;
+    }
+
+    if (Type)
+    {
+        if (!AcpiGbl_ExternalFileList)
+        {
+            /* The -e option was not specified */
+
+           AcpiOsPrintf ("    /*\n"
+                "     * iASL Warning: There were %u external control methods found during\n"
+                "     * disassembly, but additional ACPI tables to resolve these externals\n"
+                "     * were not specified. This resulting disassembler output file may not\n"
+                "     * compile because the disassembler did not know how many arguments\n"
+                "     * to assign to these methods. To specify the tables needed to resolve\n"
+                "     * external control method references, use the one of the following\n"
+                "     * example iASL invocations:\n"
+                "     *     iasl -e <ssdt1.aml,ssdt2.aml...> -d <dsdt.aml>\n"
+                "     *     iasl -e <dsdt.aml,ssdt2.aml...> -d <ssdt1.aml>\n"
+                "     */\n",
+                AcpiGbl_NumExternalMethods);
+        }
+        else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods)
+        {
+            /* The -e option was specified, but there are still some unresolved externals */
+
+            AcpiOsPrintf ("    /*\n"
+                "     * iASL Warning: There were %u external control methods found during\n"
+                "     * disassembly, but only %u %s resolved (%u unresolved). Additional\n"
+                "     * ACPI tables are required to properly disassemble the code. This\n"
+                "     * resulting disassembler output file may not compile because the\n"
+                "     * disassembler did not know how many arguments to assign to the\n"
+                "     * unresolved methods.\n"
+                "     */\n",
+                AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods,
+                (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"),
+                (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods));
+        }
+    }
+    else
+    {
+        if (!AcpiGbl_ExternalFileList)
+        {
+            /* The -e option was not specified */
+
+            fprintf (stderr, "\n"
+                "iASL Warning: There were %u external control methods found during\n"
+                "disassembly, but additional ACPI tables to resolve these externals\n"
+                "were not specified. The resulting disassembler output file may not\n"
+                "compile because the disassembler did not know how many arguments\n"
+                "to assign to these methods. To specify the tables needed to resolve\n"
+                "external control method references, use the one of the following\n"
+                "example iASL invocations:\n"
+                "    iasl -e <ssdt1.aml,ssdt2.aml...> -d <dsdt.aml>\n"
+                "    iasl -e <dsdt.aml,ssdt2.aml...> -d <ssdt1.aml>\n",
+                AcpiGbl_NumExternalMethods);
+        }
+        else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods)
+        {
+            /* The -e option was specified, but there are still some unresolved externals */
+
+            fprintf (stderr, "\n"
+                "iASL Warning: There were %u external control methods found during\n"
+                "disassembly, but only %u %s resolved (%u unresolved). Additional\n"
+                "ACPI tables are required to properly disassemble the code. The\n"
+                "resulting disassembler output file may not compile because the\n"
+                "disassembler did not know how many arguments to assign to the\n"
+                "unresolved methods.\n",
+                AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods,
+                (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"),
+                (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods));
+        }
+    }
+
+}
diff --git a/src/acpica/source/common/dmrestag.c b/src/acpica/source/common/dmrestag.c
index 3097f15..9ba112b 100644
--- a/src/acpica/source/common/dmrestag.c
+++ b/src/acpica/source/common/dmrestag.c
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -161,7 +161,7 @@  AcpiDmAddResourceToNamespace (
     UINT32                  Length,
     UINT32                  Offset,
     UINT8                   ResourceIndex,
-    void                    *Context);
+    void                    **Context);
 
 static void
 AcpiDmAddResourcesToNamespace (
@@ -697,7 +697,7 @@  AcpiGetTagPathname (
     Aml = ACPI_CAST_PTR (AML_RESOURCE,
             &Op->Named.Data[ResourceNode->Value]);
 
-    Status = AcpiUtValidateResource (Aml, &ResourceTableIndex);
+    Status = AcpiUtValidateResource (NULL, Aml, &ResourceTableIndex);
     if (ACPI_FAILURE (Status))
     {
         return (NULL);
@@ -1010,7 +1010,7 @@  AcpiDmFindResources (
                  * resource descriptors to the namespace, as children of the
                  * buffer node.
                  */
-                if (ACPI_SUCCESS (AcpiDmIsResourceTemplate (Op)))
+                if (ACPI_SUCCESS (AcpiDmIsResourceTemplate (NULL, Op)))
                 {
                     Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE;
                     AcpiDmAddResourcesToNamespace (Parent->Common.Node, Op);
@@ -1063,9 +1063,9 @@  AcpiDmAddResourcesToNamespace (
      * Insert each resource into the namespace
      * NextOp contains the Aml pointer and the Aml length
      */
-    AcpiUtWalkAmlResources ((UINT8 *) NextOp->Named.Data,
+    AcpiUtWalkAmlResources (NULL, (UINT8 *) NextOp->Named.Data,
         (ACPI_SIZE) NextOp->Common.Value.Integer,
-        AcpiDmAddResourceToNamespace, BufferNode);
+        AcpiDmAddResourceToNamespace, (void **) BufferNode);
 }
 
 
@@ -1091,7 +1091,7 @@  AcpiDmAddResourceToNamespace (
     UINT32                  Length,
     UINT32                  Offset,
     UINT8                   ResourceIndex,
-    void                    *Context)
+    void                    **Context)
 {
     ACPI_STATUS             Status;
     ACPI_GENERIC_STATE      ScopeInfo;
@@ -1122,4 +1122,3 @@  AcpiDmAddResourceToNamespace (
     Node->Length = Length;
     return (AE_OK);
 }
-
diff --git a/src/acpica/source/common/dmtable.c b/src/acpica/source/common/dmtable.c
index 5c9d5be..34b855c 100644
--- a/src/acpica/source/common/dmtable.c
+++ b/src/acpica/source/common/dmtable.c
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -349,26 +349,29 @@  static const char           *AcpiDmGasAccessWidth[] =
 ACPI_DMTABLE_DATA    AcpiDmTableData[] =
 {
     {ACPI_SIG_ASF,  NULL,                   AcpiDmDumpAsf,  DtCompileAsf,   TemplateAsf,    "Alert Standard Format table"},
-    {ACPI_SIG_BOOT, AcpiDmTableInfoBoot,    NULL,           NULL,           TemplateBoot,   "Simple Boot Flag Table"},
     {ACPI_SIG_BERT, AcpiDmTableInfoBert,    NULL,           NULL,           TemplateBert,   "Boot Error Record Table"},
     {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt,    NULL,           NULL,           TemplateBgrt,   "Boot Graphics Resource Table"},
+    {ACPI_SIG_BOOT, AcpiDmTableInfoBoot,    NULL,           NULL,           TemplateBoot,   "Simple Boot Flag Table"},
     {ACPI_SIG_CPEP, NULL,                   AcpiDmDumpCpep, DtCompileCpep,  TemplateCpep,   "Corrected Platform Error Polling table"},
+    {ACPI_SIG_CSRT, NULL,                   AcpiDmDumpCsrt, DtCompileCsrt,  TemplateCsrt,   "Core System Resource Table"},
+    {ACPI_SIG_DBG2, NULL,                   AcpiDmDumpDbg2, NULL,           NULL,           "Debug Port table type 2"},
     {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp,    NULL,           NULL,           TemplateDbgp,   "Debug Port table"},
     {ACPI_SIG_DMAR, NULL,                   AcpiDmDumpDmar, DtCompileDmar,  TemplateDmar,   "DMA Remapping table"},
     {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt,    NULL,           NULL,           TemplateEcdt,   "Embedded Controller Boot Resources Table"},
     {ACPI_SIG_EINJ, NULL,                   AcpiDmDumpEinj, DtCompileEinj,  TemplateEinj,   "Error Injection table"},
     {ACPI_SIG_ERST, NULL,                   AcpiDmDumpErst, DtCompileErst,  TemplateErst,   "Error Record Serialization Table"},
-    {ACPI_SIG_FADT, NULL,                   AcpiDmDumpFadt, DtCompileFadt,  TemplateFadt,   "Fixed ACPI Description Table"},
+    {ACPI_SIG_FADT, NULL,                   AcpiDmDumpFadt, DtCompileFadt,  TemplateFadt,   "Fixed ACPI Description Table (FADT)"},
     {ACPI_SIG_FPDT, NULL,                   AcpiDmDumpFpdt, DtCompileFpdt,  TemplateFpdt,   "Firmware Performance Data Table"},
     {ACPI_SIG_GTDT, AcpiDmTableInfoGtdt,    NULL,           NULL,           TemplateGtdt,   "Generic Timer Description Table"},
     {ACPI_SIG_HEST, NULL,                   AcpiDmDumpHest, DtCompileHest,  TemplateHest,   "Hardware Error Source Table"},
     {ACPI_SIG_HPET, AcpiDmTableInfoHpet,    NULL,           NULL,           TemplateHpet,   "High Precision Event Timer table"},
     {ACPI_SIG_IVRS, NULL,                   AcpiDmDumpIvrs, DtCompileIvrs,  TemplateIvrs,   "I/O Virtualization Reporting Structure"},
-    {ACPI_SIG_MADT, NULL,                   AcpiDmDumpMadt, DtCompileMadt,  TemplateMadt,   "Multiple APIC Description Table"},
+    {ACPI_SIG_MADT, NULL,                   AcpiDmDumpMadt, DtCompileMadt,  TemplateMadt,   "Multiple APIC Description Table (MADT)"},
     {ACPI_SIG_MCFG, NULL,                   AcpiDmDumpMcfg, DtCompileMcfg,  TemplateMcfg,   "Memory Mapped Configuration table"},
     {ACPI_SIG_MCHI, AcpiDmTableInfoMchi,    NULL,           NULL,           TemplateMchi,   "Management Controller Host Interface table"},
     {ACPI_SIG_MPST, AcpiDmTableInfoMpst,    AcpiDmDumpMpst, DtCompileMpst,  TemplateMpst,   "Memory Power State Table"},
     {ACPI_SIG_MSCT, NULL,                   AcpiDmDumpMsct, DtCompileMsct,  TemplateMsct,   "Maximum System Characteristics Table"},
+    {ACPI_SIG_MTMR, NULL,                   AcpiDmDumpMtmr, DtCompileMtmr,  TemplateMtmr,   "MID Timer Table"},
     {ACPI_SIG_PCCT, NULL,                   AcpiDmDumpPcct, NULL,           NULL,           "Platform Communications Channel Table"},
     {ACPI_SIG_PMTT, NULL,                   AcpiDmDumpPmtt, DtCompilePmtt,  TemplatePmtt,   "Platform Memory Topology Table"},
     {ACPI_SIG_RSDT, NULL,                   AcpiDmDumpRsdt, DtCompileRsdt,  TemplateRsdt,   "Root System Description Table"},
@@ -380,7 +383,9 @@  ACPI_DMTABLE_DATA    AcpiDmTableData[] =
     {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi,    NULL,           NULL,           TemplateSpmi,   "Server Platform Management Interface table"},
     {ACPI_SIG_SRAT, NULL,                   AcpiDmDumpSrat, DtCompileSrat,  TemplateSrat,   "System Resource Affinity Table"},
     {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa,    NULL,           NULL,           TemplateTcpa,   "Trusted Computing Platform Alliance table"},
+    {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2,    NULL,           NULL,           TemplateTpm2,   "Trusted Platform Module hardware interface table"},
     {ACPI_SIG_UEFI, AcpiDmTableInfoUefi,    NULL,           DtCompileUefi,  TemplateUefi,   "UEFI Boot Optimization Table"},
+    {ACPI_SIG_VRTC, AcpiDmTableInfoVrtc,    AcpiDmDumpVrtc, DtCompileVrtc,  TemplateVrtc,   "Virtual Real-Time Clock Table"},
     {ACPI_SIG_WAET, AcpiDmTableInfoWaet,    NULL,           NULL,           TemplateWaet,   "Windows ACPI Emulated Devices Table"},
     {ACPI_SIG_WDAT, NULL,                   AcpiDmDumpWdat, DtCompileWdat,  TemplateWdat,   "Watchdog Action Table"},
     {ACPI_SIG_WDDT, AcpiDmTableInfoWddt,    NULL,           NULL,           TemplateWddt,   "Watchdog Description Table"},
@@ -485,6 +490,18 @@  AcpiDmDumpDataTable (
 
     if (AcpiUtIsAmlTable (Table))
     {
+        if (Gbl_VerboseTemplates)
+        {
+            /* Dump the raw table data */
+
+            Length = Table->Length;
+
+            AcpiOsPrintf ("\n/*\n%s: Length %d (0x%X)\n\n",
+                ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
+            AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),
+                Length, DB_BYTE_DISPLAY, 0);
+            AcpiOsPrintf (" */\n");
+        }
         return;
     }
 
@@ -532,6 +549,8 @@  AcpiDmDumpDataTable (
             {
                 AcpiOsPrintf ("\n**** Unknown ACPI table type [%4.4s]\n\n",
                     Table->Signature);
+                fprintf (stderr, "Unknown ACPI table signature [%4.4s], decoding header only\n",
+                    Table->Signature);
             }
         }
         else if (TableData->TableHandler)
@@ -554,7 +573,8 @@  AcpiDmDumpDataTable (
 
         AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n",
             ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
-        AcpiUtDumpBuffer2 (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY);
+        AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),
+            Length, DB_BYTE_DISPLAY, 0);
     }
 }
 
diff --git a/src/acpica/source/common/dmtbdump.c b/src/acpica/source/common/dmtbdump.c
index 0ff0082..5125681 100644
--- a/src/acpica/source/common/dmtbdump.c
+++ b/src/acpica/source/common/dmtbdump.c
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -124,11 +124,79 @@ 
         ACPI_MODULE_NAME    ("dmtbdump")
 
 
+/* Local prototypes */
+
 static void
 AcpiDmValidateFadtLength (
     UINT32                  Revision,
     UINT32                  Length);
 
+static void
+AcpiDmDumpBuffer (
+    void                    *Table,
+    UINT32                  BufferOffset,
+    UINT32                  Length,
+    UINT32                  AbsoluteOffset,
+    char                    *Header);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDmDumpBuffer
+ *
+ * PARAMETERS:  Table               - ACPI Table or subtable
+ *              BufferOffset        - Offset of buffer from Table above
+ *              Length              - Length of the buffer
+ *              AbsoluteOffset      - Offset of buffer in the main ACPI table
+ *              Header              - Name of the buffer field (printed on the
+ *                                    first line only.)
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Format the contents of an arbitrary length data buffer (in the
+ *              disassembler output format.)
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmDumpBuffer (
+    void                    *Table,
+    UINT32                  BufferOffset,
+    UINT32                  Length,
+    UINT32                  AbsoluteOffset,
+    char                    *Header)
+{
+    UINT8                   *Buffer;
+    UINT32                  i;
+
+
+    if (!Length)
+    {
+        return;
+    }
+
+    Buffer = ACPI_CAST_PTR (UINT8, Table) + BufferOffset;
+    i = 0;
+
+    while (i < Length)
+    {
+        if (!(i % 16))
+        {
+            AcpiOsPrintf ("\n");
+            AcpiDmLineHeader (AbsoluteOffset,
+                ((Length - i) > 16) ? 16 : (Length - i), Header);
+            Header = NULL;
+        }
+
+        AcpiOsPrintf ("%.02X ", *Buffer);
+        i++;
+        Buffer++;
+        AbsoluteOffset++;
+    }
+
+    AcpiOsPrintf ("\n");
+}
+
 
 /*******************************************************************************
  *
@@ -601,6 +669,219 @@  AcpiDmDumpCpep (
 
 /*******************************************************************************
  *
+ * FUNCTION:    AcpiDmDumpCsrt
+ *
+ * PARAMETERS:  Table               - A CSRT table
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Format the contents of a CSRT. This table type consists
+ *              of an open-ended number of subtables.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpCsrt (
+    ACPI_TABLE_HEADER       *Table)
+{
+    ACPI_STATUS             Status;
+    ACPI_CSRT_GROUP         *SubTable;
+    ACPI_CSRT_SHARED_INFO   *SharedInfoTable;
+    ACPI_CSRT_DESCRIPTOR    *SubSubTable;
+    UINT32                  Length = Table->Length;
+    UINT32                  Offset = sizeof (ACPI_TABLE_CSRT);
+    UINT32                  SubOffset;
+    UINT32                  SubSubOffset;
+    UINT32                  InfoLength;
+
+
+    /* The main table only contains the ACPI header, thus already handled */
+
+    /* Sub-tables (Resource Groups) */
+
+    SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
+    while (Offset < Table->Length)
+    {
+        /* Resource group subtable */
+
+        AcpiOsPrintf ("\n");
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
+                    SubTable->Length, AcpiDmTableInfoCsrt0);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
+
+        /* Shared info subtable (One per resource group) */
+
+        SubOffset = sizeof (ACPI_CSRT_GROUP);
+        SharedInfoTable = ACPI_ADD_PTR (ACPI_CSRT_SHARED_INFO, Table,
+            Offset + SubOffset);
+
+        AcpiOsPrintf ("\n");
+        Status = AcpiDmDumpTable (Length, Offset + SubOffset, SharedInfoTable,
+                    sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
+
+        SubOffset += SubTable->SharedInfoLength;
+
+        /* Sub-Subtables (Resource Descriptors) */
+
+        SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table,
+            Offset + SubOffset);
+
+        while ((SubOffset < SubTable->Length) &&
+              ((Offset + SubOffset) < Table->Length))
+        {
+            AcpiOsPrintf ("\n");
+            Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubTable,
+                        SubSubTable->Length, AcpiDmTableInfoCsrt2);
+            if (ACPI_FAILURE (Status))
+            {
+                return;
+            }
+
+            SubSubOffset = sizeof (ACPI_CSRT_DESCRIPTOR);
+
+            /* Resource-specific info buffer */
+
+            InfoLength = SubSubTable->Length - SubSubOffset;
+
+            AcpiDmDumpBuffer (SubSubTable, SubSubOffset, InfoLength,
+                Offset + SubOffset + SubSubOffset, "ResourceInfo");
+            SubSubOffset += InfoLength;
+
+            /* Point to next sub-subtable */
+
+            SubOffset += SubSubTable->Length;
+            SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubTable,
+                        SubSubTable->Length);
+        }
+
+        /* Point to next sub-table */
+
+        Offset += SubTable->Length;
+        SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable,
+                    SubTable->Length);
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDmDumpDbg2
+ *
+ * PARAMETERS:  Table               - A DBG2 table
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Format the contents of a DBG2. This table type consists
+ *              of an open-ended number of subtables.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpDbg2 (
+    ACPI_TABLE_HEADER       *Table)
+{
+    ACPI_STATUS             Status;
+    ACPI_DBG2_DEVICE        *SubTable;
+    UINT32                  Length = Table->Length;
+    UINT32                  Offset = sizeof (ACPI_TABLE_DBG2);
+    UINT32                  i;
+    UINT32                  ArrayOffset;
+    UINT32                  AbsoluteOffset;
+    UINT8                   *Array;
+
+
+    /* Main table */
+
+    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2);
+    if (ACPI_FAILURE (Status))
+    {
+        return;
+    }
+
+    /* Sub-tables */
+
+    SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
+    while (Offset < Table->Length)
+    {
+        AcpiOsPrintf ("\n");
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
+                    SubTable->Length, AcpiDmTableInfoDbg2Device);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
+
+        /* Dump the BaseAddress array */
+
+        for (i = 0; i < SubTable->RegisterCount; i++)
+        {
+            ArrayOffset = SubTable->BaseAddressOffset +
+                (sizeof (ACPI_GENERIC_ADDRESS) * i);
+            AbsoluteOffset = Offset + ArrayOffset;
+            Array = (UINT8 *) SubTable + ArrayOffset;
+
+            Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
+                        SubTable->Length, AcpiDmTableInfoDbg2Addr);
+            if (ACPI_FAILURE (Status))
+            {
+                return;
+            }
+        }
+
+        /* Dump the AddressSize array */
+
+        for (i = 0; i < SubTable->RegisterCount; i++)
+        {
+            ArrayOffset = SubTable->AddressSizeOffset +
+                (sizeof (UINT32) * i);
+            AbsoluteOffset = Offset + ArrayOffset;
+            Array = (UINT8 *) SubTable + ArrayOffset;
+
+            Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
+                        SubTable->Length, AcpiDmTableInfoDbg2Size);
+            if (ACPI_FAILURE (Status))
+            {
+                return;
+            }
+        }
+
+        /* Dump the Namestring (required) */
+
+        AcpiOsPrintf ("\n");
+        ArrayOffset = SubTable->NamepathOffset;
+        AbsoluteOffset = Offset + ArrayOffset;
+        Array = (UINT8 *) SubTable + ArrayOffset;
+
+        Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
+                    SubTable->Length, AcpiDmTableInfoDbg2Name);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
+
+        /* Dump the OemData (optional) */
+
+        AcpiDmDumpBuffer (SubTable, SubTable->OemDataOffset, SubTable->OemDataLength,
+            Offset + SubTable->OemDataOffset, "OEM Data");
+
+        /* Point to next sub-table */
+
+        Offset += SubTable->Length;
+        SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, SubTable,
+                    SubTable->Length);
+    }
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    AcpiDmDumpDmar
  *
  * PARAMETERS:  Table               - A DMAR table
@@ -612,6 +893,7 @@  AcpiDmDumpCpep (
  *
  ******************************************************************************/
 
+
 void
 AcpiDmDumpDmar (
     ACPI_TABLE_HEADER       *Table)
@@ -1412,8 +1694,8 @@  AcpiDmDumpMpst (
     ACPI_MPST_DATA_HDR      *SubTable1;
     ACPI_MPST_POWER_DATA    *SubTable2;
     UINT16                  SubtableCount;
-    UINT8                   PowerStateCount;
-    UINT8                   ComponentCount;
+    UINT32                  PowerStateCount;
+    UINT32                  ComponentCount;
 
 
     /* Main table */
@@ -1586,6 +1868,58 @@  AcpiDmDumpMsct (
 
 /*******************************************************************************
  *
+ * FUNCTION:    AcpiDmDumpMtmr
+ *
+ * PARAMETERS:  Table               - A MTMR table
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Format the contents of a MTMR
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpMtmr (
+    ACPI_TABLE_HEADER       *Table)
+{
+    ACPI_STATUS             Status;
+    UINT32                  Offset = sizeof (ACPI_TABLE_MTMR);
+    ACPI_MTMR_ENTRY         *SubTable;
+
+
+    /* Main table */
+
+    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMtmr);
+    if (ACPI_FAILURE (Status))
+    {
+        return;
+    }
+
+    /* Sub-tables */
+
+    SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Table, Offset);
+    while (Offset < Table->Length)
+    {
+        /* Common sub-table header */
+
+        AcpiOsPrintf ("\n");
+        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
+                    sizeof (ACPI_MTMR_ENTRY), AcpiDmTableInfoMtmr0);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
+
+        /* Point to next sub-table */
+
+        Offset += sizeof (ACPI_MTMR_ENTRY);
+        SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, SubTable, sizeof (ACPI_MTMR_ENTRY));
+    }
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    AcpiDmDumpPcct
  *
  * PARAMETERS:  Table               - A PCCT table
@@ -2168,6 +2502,58 @@  NextSubTable:
 
 /*******************************************************************************
  *
+ * FUNCTION:    AcpiDmDumpVrtc
+ *
+ * PARAMETERS:  Table               - A VRTC table
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Format the contents of a VRTC
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpVrtc (
+    ACPI_TABLE_HEADER       *Table)
+{
+    ACPI_STATUS             Status;
+    UINT32                  Offset = sizeof (ACPI_TABLE_VRTC);
+    ACPI_VRTC_ENTRY         *SubTable;
+
+
+    /* Main table */
+
+    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoVrtc);
+    if (ACPI_FAILURE (Status))
+    {
+        return;
+    }
+
+    /* Sub-tables */
+
+    SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, Table, Offset);
+    while (Offset < Table->Length)
+    {
+        /* Common sub-table header */
+
+        AcpiOsPrintf ("\n");
+        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
+                    sizeof (ACPI_VRTC_ENTRY), AcpiDmTableInfoVrtc0);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
+
+        /* Point to next sub-table */
+
+        Offset += sizeof (ACPI_VRTC_ENTRY);
+        SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, SubTable, sizeof (ACPI_VRTC_ENTRY));
+    }
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    AcpiDmDumpWdat
  *
  * PARAMETERS:  Table               - A WDAT table
diff --git a/src/acpica/source/common/dmtbinfo.c b/src/acpica/source/common/dmtbinfo.c
index 361e7fb..743c654 100644
--- a/src/acpica/source/common/dmtbinfo.c
+++ b/src/acpica/source/common/dmtbinfo.c
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -158,6 +158,7 @@ 
 #define ACPI_BGRT_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_BGRT,f)
 #define ACPI_BOOT_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_BOOT,f)
 #define ACPI_CPEP_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_CPEP,f)
+#define ACPI_DBG2_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_DBG2,f)
 #define ACPI_DBGP_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_DBGP,f)
 #define ACPI_DMAR_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_DMAR,f)
 #define ACPI_DRTM_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_DRTM,f)
@@ -182,6 +183,7 @@ 
 #define ACPI_SPMI_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_SPMI,f)
 #define ACPI_SRAT_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_SRAT,f)
 #define ACPI_TCPA_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA,f)
+#define ACPI_TPM2_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM2,f)
 #define ACPI_UEFI_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f)
 #define ACPI_WAET_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_WAET,f)
 #define ACPI_WDAT_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_WDAT,f)
@@ -198,6 +200,10 @@ 
 #define ACPI_ASF3_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_ASF_RMCP,f)
 #define ACPI_ASF4_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f)
 #define ACPI_CPEP0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f)
+#define ACPI_CSRT0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_CSRT_GROUP,f)
+#define ACPI_CSRT1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_CSRT_SHARED_INFO,f)
+#define ACPI_CSRT2_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_CSRT_DESCRIPTOR,f)
+#define ACPI_DBG20_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_DBG2_DEVICE,f)
 #define ACPI_DMARS_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_DMAR_DEVICE_SCOPE,f)
 #define ACPI_DMAR0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f)
 #define ACPI_DMAR1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f)
@@ -245,6 +251,7 @@ 
 #define ACPI_MPST1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_MPST_DATA_HDR,f)
 #define ACPI_MPST2_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_DATA,f)
 #define ACPI_MSCT0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f)
+#define ACPI_MTMR0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_MTMR_ENTRY,f)
 #define ACPI_PCCT0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f)
 #define ACPI_PMTT0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_PMTT_SOCKET,f)
 #define ACPI_PMTT1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f)
@@ -261,6 +268,7 @@ 
 #define ACPI_SRAT0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
 #define ACPI_SRAT1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
 #define ACPI_SRAT2_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f)
+#define ACPI_VRTC0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_VRTC_ENTRY,f)
 #define ACPI_WDAT0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f)
 
 /*
@@ -713,6 +721,114 @@  ACPI_DMTABLE_INFO           AcpiDmTableInfoCpep0[] =
 
 /*******************************************************************************
  *
+ * CSRT - Core System Resource Table
+ *
+ ******************************************************************************/
+
+/* Main table consists only of the standard ACPI table header */
+
+/* Resource Group subtable */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoCsrt0[] =
+{
+    {ACPI_DMT_UINT32,   ACPI_CSRT0_OFFSET (Length),                 "Length", 0},
+    {ACPI_DMT_UINT32,   ACPI_CSRT0_OFFSET (VendorId),               "Vendor ID", 0},
+    {ACPI_DMT_UINT32,   ACPI_CSRT0_OFFSET (SubvendorId),            "Subvendor ID", 0},
+    {ACPI_DMT_UINT16,   ACPI_CSRT0_OFFSET (DeviceId),               "Device ID", 0},
+    {ACPI_DMT_UINT16,   ACPI_CSRT0_OFFSET (SubdeviceId),            "Subdevice ID", 0},
+    {ACPI_DMT_UINT16,   ACPI_CSRT0_OFFSET (Revision),               "Revision", 0},
+    {ACPI_DMT_UINT16,   ACPI_CSRT0_OFFSET (Reserved),               "Reserved", 0},
+    {ACPI_DMT_UINT32,   ACPI_CSRT0_OFFSET (SharedInfoLength),       "Shared Info Length", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+/* Shared Info subtable */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoCsrt1[] =
+{
+    {ACPI_DMT_UINT16,   ACPI_CSRT1_OFFSET (MajorVersion),           "Major Version", 0},
+    {ACPI_DMT_UINT16,   ACPI_CSRT1_OFFSET (MinorVersion),           "Minor Version", 0},
+    {ACPI_DMT_UINT32,   ACPI_CSRT1_OFFSET (MmioBaseLow),            "MMIO Base Address Low", 0},
+    {ACPI_DMT_UINT32,   ACPI_CSRT1_OFFSET (MmioBaseHigh),           "MMIO Base Address High", 0},
+    {ACPI_DMT_UINT32,   ACPI_CSRT1_OFFSET (GsiInterrupt),           "GSI Interrupt", 0},
+    {ACPI_DMT_UINT8,    ACPI_CSRT1_OFFSET (InterruptPolarity),      "Interrupt Polarity", 0},
+    {ACPI_DMT_UINT8,    ACPI_CSRT1_OFFSET (InterruptMode),          "Interrupt Mode", 0},
+    {ACPI_DMT_UINT8,    ACPI_CSRT1_OFFSET (NumChannels),            "Num Channels", 0},
+    {ACPI_DMT_UINT8,    ACPI_CSRT1_OFFSET (DmaAddressWidth),        "DMA Address Width", 0},
+    {ACPI_DMT_UINT16,   ACPI_CSRT1_OFFSET (BaseRequestLine),        "Base Request Line", 0},
+    {ACPI_DMT_UINT16,   ACPI_CSRT1_OFFSET (NumHandshakeSignals),    "Num Handshake Signals", 0},
+    {ACPI_DMT_UINT32,   ACPI_CSRT1_OFFSET (MaxBlockSize),           "Max Block Size", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+
+/* Resource Descriptor subtable */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoCsrt2[] =
+{
+    {ACPI_DMT_UINT32,   ACPI_CSRT2_OFFSET (Length),                 "Length", 0},
+    {ACPI_DMT_UINT16,   ACPI_CSRT2_OFFSET (Type),                   "Type", 0},
+    {ACPI_DMT_UINT16,   ACPI_CSRT2_OFFSET (Subtype),                "Subtype", 0},
+    {ACPI_DMT_UINT32,   ACPI_CSRT2_OFFSET (Uid),                    "UID", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
+ * DBG2 - Debug Port Table 2
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoDbg2[] =
+{
+    {ACPI_DMT_UINT32,   ACPI_DBG2_OFFSET (InfoOffset),              "Info Offset", 0},
+    {ACPI_DMT_UINT32,   ACPI_DBG2_OFFSET (InfoCount),               "Info Count", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+/* Debug Device Information Subtable */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoDbg2Device[] =
+{
+    {ACPI_DMT_UINT8,    ACPI_DBG20_OFFSET (Revision),               "Revision", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (Length),                 "Length", 0},
+    {ACPI_DMT_UINT8,    ACPI_DBG20_OFFSET (RegisterCount),          "Register Count", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (NamepathLength),         "Namepath Length", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (NamepathOffset),         "Namepath Offset", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (OemDataLength),          "OEM Data Length", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (OemDataOffset),          "OEM Data Offset", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (PortType),               "Port Type", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (PortSubtype),            "Port Subtype", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (Reserved),               "Reserved", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (BaseAddressOffset),      "Base Address Offset", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (AddressSizeOffset),      "Address Size Offset", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+/* Variable-length data for the subtable */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoDbg2Addr[] =
+{
+    {ACPI_DMT_GAS,      0,                                          "Base Address Register", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoDbg2Size[] =
+{
+    {ACPI_DMT_UINT32,   0,                                          "Address Size", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoDbg2Name[] =
+{
+    {ACPI_DMT_STRING,   0,                                          "Namepath", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
  * DBGP - Debug Port
  *
  ******************************************************************************/
@@ -1498,10 +1614,10 @@  ACPI_DMTABLE_INFO           AcpiDmTableInfoMchi[] =
 
 ACPI_DMTABLE_INFO           AcpiDmTableInfoMpst[] =
 {
-    {ACPI_DMT_UINT16,   ACPI_MPST_OFFSET (Reserved1),               "Reserved", 0},
     {ACPI_DMT_UINT8,    ACPI_MPST_OFFSET (ChannelId),               "Channel ID", 0},
-    {ACPI_DMT_UINT8,    ACPI_MPST_OFFSET (Reserved2),               "Reserved", 0},
+    {ACPI_DMT_UINT24,   ACPI_MPST_OFFSET (Reserved1[0]),            "Reserved", 0},
     {ACPI_DMT_UINT16,   ACPI_MPST_OFFSET (PowerNodeCount),          "Power Node Count", 0},
+    {ACPI_DMT_UINT16,   ACPI_MPST_OFFSET (Reserved2),               "Reserved", 0},
     ACPI_DMT_TERMINATOR
 };
 
@@ -1518,12 +1634,11 @@  ACPI_DMTABLE_INFO           AcpiDmTableInfoMpst0[] =
 
     {ACPI_DMT_UINT8,    ACPI_MPST0_OFFSET (Reserved1),              "Reserved", 0},
     {ACPI_DMT_UINT16,   ACPI_MPST0_OFFSET (NodeId),                 "Node ID", 0},
-    {ACPI_DMT_UINT32,   ACPI_MPST0_OFFSET (Length),                 "Length", DT_LENGTH},
+    {ACPI_DMT_UINT32,   ACPI_MPST0_OFFSET (Length),                 "Length", 0},
     {ACPI_DMT_UINT64,   ACPI_MPST0_OFFSET (RangeAddress),           "Range Address", 0},
     {ACPI_DMT_UINT64,   ACPI_MPST0_OFFSET (RangeLength),            "Range Length", 0},
-    {ACPI_DMT_UINT8,    ACPI_MPST0_OFFSET (NumPowerStates),         "Num Power States", 0},
-    {ACPI_DMT_UINT8,    ACPI_MPST0_OFFSET (NumPhysicalComponents),  "Num Physical Components", 0},
-    {ACPI_DMT_UINT16,   ACPI_MPST0_OFFSET (Reserved2),              "Reserved", 0},
+    {ACPI_DMT_UINT32,   ACPI_MPST0_OFFSET (NumPowerStates),         "Num Power States", 0},
+    {ACPI_DMT_UINT32,   ACPI_MPST0_OFFSET (NumPhysicalComponents),  "Num Physical Components", 0},
     ACPI_DMT_TERMINATOR
 };
 
@@ -1549,6 +1664,7 @@  ACPI_DMTABLE_INFO           AcpiDmTableInfoMpst0B[] =
 ACPI_DMTABLE_INFO           AcpiDmTableInfoMpst1[] =
 {
     {ACPI_DMT_UINT16,   ACPI_MPST1_OFFSET (CharacteristicsCount),   "Characteristics Count", 0},
+    {ACPI_DMT_UINT16,   ACPI_MPST1_OFFSET (Reserved),               "Reserved", 0},
     ACPI_DMT_TERMINATOR
 };
 
@@ -1556,7 +1672,7 @@  ACPI_DMTABLE_INFO           AcpiDmTableInfoMpst1[] =
 
 ACPI_DMTABLE_INFO           AcpiDmTableInfoMpst2[] =
 {
-    {ACPI_DMT_UINT8,    ACPI_MPST2_OFFSET (Revision),               "Revision", 0},
+    {ACPI_DMT_UINT8,    ACPI_MPST2_OFFSET (StructureId),            "Structure ID", 0},
     {ACPI_DMT_UINT8,    ACPI_MPST2_OFFSET (Flags),                  "Flags (decoded below)", DT_FLAG},
     {ACPI_DMT_FLAG0,    ACPI_MPST2_FLAG_OFFSET (Flags,0),           "Memory Preserved", 0},
     {ACPI_DMT_FLAG1,    ACPI_MPST2_FLAG_OFFSET (Flags,0),           "Auto Entry", 0},
@@ -1602,6 +1718,28 @@  ACPI_DMTABLE_INFO           AcpiDmTableInfoMsct0[] =
 
 /*******************************************************************************
  *
+ * MTMR - MID Timer Table
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoMtmr[] =
+{
+    ACPI_DMT_TERMINATOR
+};
+
+/* MTMR Subtables - MTMR Entry */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoMtmr0[] =
+{
+    {ACPI_DMT_GAS,      ACPI_MTMR0_OFFSET (PhysicalAddress),        "PhysicalAddress", 0},
+    {ACPI_DMT_UINT32,   ACPI_MTMR0_OFFSET (Frequency),              "Frequency", 0},
+    {ACPI_DMT_UINT32,   ACPI_MTMR0_OFFSET (Irq),                    "IRQ", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
  * PCCT - Platform Communications Channel Table (ACPI 5.0)
  *
  ******************************************************************************/
@@ -1964,6 +2102,21 @@  ACPI_DMTABLE_INFO           AcpiDmTableInfoTcpa[] =
 
 /*******************************************************************************
  *
+ * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoTpm2[] =
+{
+    {ACPI_DMT_UINT32,   ACPI_TPM2_OFFSET (Flags),                   "Flags", 0},
+    {ACPI_DMT_UINT64,   ACPI_TPM2_OFFSET (ControlAddress),          "Control Address", 0},
+    {ACPI_DMT_UINT32,   ACPI_TPM2_OFFSET (StartMethod),             "Start Method", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
  * UEFI - UEFI Boot optimization Table
  *
  ******************************************************************************/
@@ -1978,6 +2131,27 @@  ACPI_DMTABLE_INFO           AcpiDmTableInfoUefi[] =
 
 /*******************************************************************************
  *
+ * VRTC - Virtual Real Time Clock Table
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoVrtc[] =
+{
+    ACPI_DMT_TERMINATOR
+};
+
+/* VRTC Subtables - VRTC Entry */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoVrtc0[] =
+{
+    {ACPI_DMT_GAS,      ACPI_VRTC0_OFFSET (PhysicalAddress),        "PhysicalAddress", 0},
+    {ACPI_DMT_UINT32,   ACPI_VRTC0_OFFSET (Irq),                    "IRQ", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
  * WAET - Windows ACPI Emulated devices Table
  *
  ******************************************************************************/
diff --git a/src/acpica/source/compiler/Makefile.am b/src/acpica/source/compiler/Makefile.am
index b7a72c9..25e2533 100644
--- a/src/acpica/source/compiler/Makefile.am
+++ b/src/acpica/source/compiler/Makefile.am
@@ -97,6 +97,14 @@  libfwtsiasl_la_SOURCES = \
 	$(ACPICA_COMPILER)/aslbtypes.c \
 	$(ACPICA_COMPILER)/aslwalks.c \
 	$(ACPICA_COMPILER)/asluuid.c \
+	$(ACPICA_COMPILER)/aslmethod.c \
+	$(ACPICA_COMPILER)/aslhex.c \
+	$(ACPICA_COMPILER)/aslnamesp.c \
+	$(ACPICA_COMPILER)/aslfileio.c \
+	$(ACPICA_COMPILER)/asllistsup.c \
+	$(ACPICA_COMPILER)/asloffset.c \
+	$(ACPICA_COMPILER)/aslxref.c \
+	$(ACPICA_COMPILER)/aslprepkg.c \
 	$(ACPICA_COMPILER)/dtfield.c \
 	$(ACPICA_COMPILER)/dtio.c \
 	$(ACPICA_COMPILER)/dtsubtable.c \
@@ -131,6 +139,11 @@  libfwtsiasl_la_SOURCES = \
 	$(ACPICA_UTILS)/utxface.c \
 	$(ACPICA_UTILS)/utxferror.c \
 	$(ACPICA_UTILS)/utdecode.c \
+	$(ACPICA_UTILS)/utpredef.c \
+	$(ACPICA_UTILS)/utstring.c \
+	$(ACPICA_UTILS)/utaddress.c \
+	$(ACPICA_UTILS)/utownerid.c \
+	$(ACPICA_UTILS)/utexcep.c \
 	$(ACPICA_NAMESPACE)/nsaccess.c \
 	$(ACPICA_NAMESPACE)/nsalloc.c \
 	$(ACPICA_NAMESPACE)/nsdump.c \
@@ -149,6 +162,8 @@  libfwtsiasl_la_SOURCES = \
 	$(ACPICA_PARSER)/pstree.c \
 	$(ACPICA_PARSER)/psutils.c \
 	$(ACPICA_PARSER)/pswalk.c \
+	$(ACPICA_PARSER)/psobject.c \
+	$(ACPICA_PARSER)/psopinfo.c \
 	$(ACPICA_DISPATCHER)/dswscope.c \
 	$(ACPICA_DISPATCHER)/dswstate.c \
 	$(ACPICA_DISPATCHER)/dsfield.c \
@@ -199,6 +214,8 @@  libfwtsiasl_la_SOURCES = \
 	$(ACPICA_DISASSEMBLER)/dmresrcs.c \
 	$(ACPICA_DISASSEMBLER)/dmutils.c \
 	$(ACPICA_DISASSEMBLER)/dmwalk.c \
+	$(ACPICA_DISASSEMBLER)/dmdeferred.c \
+	$(ACPICA_DISASSEMBLER)/dmresrcl2.c \
 	$(ACPICA_TABLES)/tbfadt.c \
 	$(ACPICA_TABLES)/tbinstal.c \
 	$(ACPICA_TABLES)/tbutils.c \
diff --git a/src/acpica/source/compiler/aslanalyze.c b/src/acpica/source/compiler/aslanalyze.c
index 4a39e41..99b17e6 100644
--- a/src/acpica/source/compiler/aslanalyze.c
+++ b/src/acpica/source/compiler/aslanalyze.c
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
diff --git a/src/acpica/source/compiler/aslbtypes.c b/src/acpica/source/compiler/aslbtypes.c
index 962ae7a..cb30afd 100644
--- a/src/acpica/source/compiler/aslbtypes.c
+++ b/src/acpica/source/compiler/aslbtypes.c
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
diff --git a/src/acpica/source/compiler/aslcodegen.c b/src/acpica/source/compiler/aslcodegen.c
index 2252ab4..4cbc1ca 100644
--- a/src/acpica/source/compiler/aslcodegen.c
+++ b/src/acpica/source/compiler/aslcodegen.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslcodegen - AML code generation
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -161,7 +160,7 @@  CgWriteNode (
  *
  * RETURN:      None
  *
- * DESCRIPTION: Generate AML code.  Currently generates the listing file
+ * DESCRIPTION: Generate AML code. Currently generates the listing file
  *              simultaneously.
  *
  ******************************************************************************/
@@ -518,7 +517,7 @@  CgWriteTableHeader (
 
     /* Compiler ID */
 
-    strncpy (TableHeader.AslCompilerId, ASL_CREATOR_ID, 4);
+    ACPI_MOVE_NAME (TableHeader.AslCompilerId, ASL_CREATOR_ID);
 
     /* Compiler version */
 
@@ -661,5 +660,3 @@  CgWriteNode (
         break;
     }
 }
-
-
diff --git a/src/acpica/source/compiler/aslcompile.c b/src/acpica/source/compiler/aslcompile.c
index 623bc3d..436a392 100644
--- a/src/acpica/source/compiler/aslcompile.c
+++ b/src/acpica/source/compiler/aslcompile.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslcompile - top level compile module
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -115,6 +114,7 @@ 
  *****************************************************************************/
 
 #include "aslcompiler.h"
+#include "dtcompiler.h"
 
 #include <stdio.h>
 #include <time.h>
@@ -123,6 +123,15 @@ 
 #define _COMPONENT          ACPI_COMPILER
         ACPI_MODULE_NAME    ("aslcompile")
 
+/*
+ * Main parser entry
+ * External is here in case the parser emits the same external in the
+ * generated header. (Newer versions of Bison)
+ */
+int
+AslCompilerparse(
+    void);
+
 /* Local prototypes */
 
 static void
@@ -189,6 +198,7 @@  AslCompilerSignon (
         break;
 
     case ASL_FILE_C_SOURCE_OUTPUT:
+    case ASL_FILE_C_OFFSET_OUTPUT:
     case ASL_FILE_C_INCLUDE_OUTPUT:
 
         Prefix = " * ";
@@ -262,6 +272,7 @@  AslCompilerFileHeader (
         break;
 
     case ASL_FILE_C_SOURCE_OUTPUT:
+    case ASL_FILE_C_OFFSET_OUTPUT:
     case ASL_FILE_C_INCLUDE_OUTPUT:
 
         Prefix = " * ";
@@ -285,6 +296,7 @@  AslCompilerFileHeader (
     switch (FileId)
     {
     case ASL_FILE_C_SOURCE_OUTPUT:
+    case ASL_FILE_C_OFFSET_OUTPUT:
     case ASL_FILE_C_INCLUDE_OUTPUT:
         FlPrintFile (FileId, " */\n");
         break;
@@ -347,7 +359,7 @@  FlConsumeAnsiComment (
     BOOLEAN                 ClosingComment = FALSE;
 
 
-    while (fread (&Byte, 1, 1, Handle))
+    while (fread (&Byte, 1, 1, Handle) == 1)
     {
         /* Scan until comment close is found */
 
@@ -390,7 +402,7 @@  FlConsumeNewComment (
     UINT8                   Byte;
 
 
-    while (fread (&Byte, 1, 1, Handle))
+    while (fread (&Byte, 1, 1, Handle) == 1)
     {
         Status->Offset++;
 
@@ -407,6 +419,89 @@  FlConsumeNewComment (
 
 /*******************************************************************************
  *
+ * FUNCTION:    FlCheckForAcpiTable
+ *
+ * PARAMETERS:  Handle              - Open input file
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Determine if a file seems to be a binary ACPI table, via the
+ *              following checks on what would be the table header:
+ *              0) File must be at least as long as an ACPI_TABLE_HEADER
+ *              1) The header length field must match the file size
+ *              2) Signature, OemId, OemTableId, AslCompilerId must be ASCII
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+FlCheckForAcpiTable (
+    FILE                    *Handle)
+{
+    ACPI_TABLE_HEADER       Table;
+    UINT32                  FileSize;
+    size_t                  Actual;
+    UINT32                  i;
+
+
+    /* Read a potential table header */
+
+    Actual = fread (&Table, 1, sizeof (ACPI_TABLE_HEADER), Handle);
+    fseek (Handle, 0, SEEK_SET);
+
+    if (Actual < sizeof (ACPI_TABLE_HEADER))
+    {
+        return (AE_ERROR);
+    }
+
+    /* Header length field must match the file size */
+
+    FileSize = DtGetFileSize (Handle);
+    if (Table.Length != FileSize)
+    {
+        return (AE_ERROR);
+    }
+
+    /*
+     * These fields must be ASCII:
+     * Signature, OemId, OemTableId, AslCompilerId.
+     * We allow a NULL terminator in OemId and OemTableId.
+     */
+    for (i = 0; i < ACPI_NAME_SIZE; i++)
+    {
+        if (!ACPI_IS_ASCII ((UINT8) Table.Signature[i]))
+        {
+            return (AE_ERROR);
+        }
+
+        if (!ACPI_IS_ASCII ((UINT8) Table.AslCompilerId[i]))
+        {
+            return (AE_ERROR);
+        }
+    }
+
+    for (i = 0; (i < ACPI_OEM_ID_SIZE) && (Table.OemId[i]); i++)
+    {
+        if (!ACPI_IS_ASCII ((UINT8) Table.OemId[i]))
+        {
+            return (AE_ERROR);
+        }
+    }
+
+    for (i = 0; (i < ACPI_OEM_TABLE_ID_SIZE) && (Table.OemTableId[i]); i++)
+    {
+        if (!ACPI_IS_ASCII ((UINT8) Table.OemTableId[i]))
+        {
+            return (AE_ERROR);
+        }
+    }
+
+    printf ("Binary file appears to be a valid ACPI table, disassembling\n");
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    FlCheckForAscii
  *
  * PARAMETERS:  Handle              - Open input file
@@ -441,7 +536,7 @@  FlCheckForAscii (
 
     /* Read the entire file */
 
-    while (fread (&Byte, 1, 1, Handle))
+    while (fread (&Byte, 1, 1, Handle) == 1)
     {
         /* Ignore comment fields (allow non-ascii within) */
 
@@ -552,7 +647,7 @@  CmDoCompile (
         {
             UtEndEvent (Event);
             CmCleanupAndExit ();
-            return 0;
+            return (0);
         }
     }
     UtEndEvent (Event);
@@ -620,7 +715,7 @@  CmDoCompile (
     if (ACPI_FAILURE (Status))
     {
         AePrintErrorLog (ASL_FILE_STDERR);
-        return -1;
+        return (-1);
     }
 
     /* Interpret and generate all compile-time constants */
@@ -661,7 +756,7 @@  CmDoCompile (
             UtDisplaySummary (ASL_FILE_STDOUT);
         }
         UtEndEvent (FullCompile);
-        return 0;
+        return (0);
     }
 
     /*
@@ -681,7 +776,7 @@  CmDoCompile (
     /* Namespace cross-reference */
 
     AslGbl_NamespaceEvent = UtBeginEvent ("Cross reference parse tree and Namespace");
-    Status = LkCrossReferenceNamespace ();
+    Status = XfCrossReferenceNamespace ();
     if (ACPI_FAILURE (Status))
     {
         goto ErrorExit;
@@ -693,7 +788,7 @@  CmDoCompile (
     UtEndEvent (AslGbl_NamespaceEvent);
 
     /*
-     * Semantic analysis.  This can happen only after the
+     * Semantic analysis. This can happen only after the
      * namespace has been loaded and cross-referenced.
      *
      * part one - check control methods
@@ -703,8 +798,8 @@  CmDoCompile (
 
     DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method analysis\n\n");
     TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE,
-        AnMethodAnalysisWalkBegin,
-        AnMethodAnalysisWalkEnd, &AnalysisWalkInfo);
+        MtMethodAnalysisWalkBegin,
+        MtMethodAnalysisWalkEnd, &AnalysisWalkInfo);
     UtEndEvent (Event);
 
     /* Semantic error checking part two - typing of method returns */
@@ -754,7 +849,7 @@  CmDoCompile (
 
     UtEndEvent (FullCompile);
     CmCleanupAndExit ();
-    return 0;
+    return (0);
 
 ErrorExit:
     UtEndEvent (FullCompile);
@@ -783,11 +878,11 @@  CmDoOutputFiles (
     /* Create listings and hex files */
 
     LsDoListings ();
-    LsDoHexOutput ();
+    HxDoHexOutput ();
 
     /* Dump the namespace to the .nsp file if requested */
 
-    (void) LsDisplayNamespace ();
+    (void) NsDisplayNamespace ();
 }
 
 
@@ -830,12 +925,12 @@  CmDumpAllEvents (
 
             Delta = (UINT32) (Event->EndTime - Event->StartTime);
 
-            USec = Delta / 10;
-            MSec = Delta / 10000;
+            USec = Delta / ACPI_100NSEC_PER_USEC;
+            MSec = Delta / ACPI_100NSEC_PER_MSEC;
 
             /* Round milliseconds up */
 
-            if ((USec - (MSec * 1000)) >= 500)
+            if ((USec - (MSec * ACPI_USEC_PER_MSEC)) >= 500)
             {
                 MSec++;
             }
@@ -872,6 +967,7 @@  CmCleanupAndExit (
     void)
 {
     UINT32                  i;
+    BOOLEAN                 DeleteAmlFile = FALSE;
 
 
     AePrintErrorLog (ASL_FILE_STDERR);
@@ -923,6 +1019,16 @@  CmCleanupAndExit (
 
     UtDisplaySummary (ASL_FILE_STDOUT);
 
+    /*
+     * We will delete the AML file if there are errors and the
+     * force AML output option has not been used.
+     */
+    if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors) &&
+        Gbl_Files[ASL_FILE_AML_OUTPUT].Handle)
+    {
+        DeleteAmlFile = TRUE;
+    }
+
     /* Close all open files */
 
     Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */
@@ -934,29 +1040,17 @@  CmCleanupAndExit (
 
     /* Delete AML file if there are errors */
 
-    if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors) &&
-        Gbl_Files[ASL_FILE_AML_OUTPUT].Handle)
+    if (DeleteAmlFile)
     {
-        if (remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename))
-        {
-            printf ("%s: ",
-                Gbl_Files[ASL_FILE_AML_OUTPUT].Filename);
-            perror ("Could not delete AML file");
-        }
+        FlDeleteFile (ASL_FILE_AML_OUTPUT);
     }
 
     /* Delete the preprocessor output file (.i) unless -li flag is set */
 
     if (!Gbl_PreprocessorOutputFlag &&
-        Gbl_PreprocessFlag &&
-        Gbl_Files[ASL_FILE_PREPROCESSOR].Filename)
+        Gbl_PreprocessFlag)
     {
-        if (remove (Gbl_Files[ASL_FILE_PREPROCESSOR].Filename))
-        {
-            printf ("%s: ",
-                Gbl_Files[ASL_FILE_PREPROCESSOR].Filename);
-            perror ("Could not delete preprocessor .i file");
-        }
+        FlDeleteFile (ASL_FILE_PREPROCESSOR);
     }
 
     /*
@@ -973,15 +1067,8 @@  CmCleanupAndExit (
      *
      * TBD: SourceOutput should be .TMP, then rename if we want to keep it?
      */
-    if (!Gbl_SourceOutputFlag && Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename)
+    if (!Gbl_SourceOutputFlag)
     {
-        if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename))
-        {
-            printf ("%s: ",
-                Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename);
-            perror ("Could not delete SRC file");
-        }
+        FlDeleteFile (ASL_FILE_SOURCE_OUTPUT);
     }
 }
-
-
diff --git a/src/acpica/source/compiler/aslcompiler.h b/src/acpica/source/compiler/aslcompiler.h
index 03303f5..4c2bfcb 100644
--- a/src/acpica/source/compiler/aslcompiler.h
+++ b/src/acpica/source/compiler/aslcompiler.h
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslcompiler.h - common include file for iASL
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -159,10 +158,6 @@ 
 /*
  * Main ASL parser - generated from flex/bison, lex/yacc, etc.
  */
-int
-AslCompilerparse(
-    void);
-
 ACPI_PARSE_OBJECT *
 AslDoError (
     void);
@@ -237,6 +232,10 @@  CmCleanupAndExit (
     void);
 
 ACPI_STATUS
+FlCheckForAcpiTable (
+    FILE                    *Handle);
+
+ACPI_STATUS
 FlCheckForAscii (
     FILE                    *Handle,
     char                    *Filename,
@@ -265,19 +264,23 @@  AnOperandTypecheckWalkEnd (
     void                    *Context);
 
 ACPI_STATUS
-AnMethodAnalysisWalkBegin (
+AnMethodTypingWalkEnd (
     ACPI_PARSE_OBJECT       *Op,
     UINT32                  Level,
     void                    *Context);
 
+
+/*
+ * aslmethod - Control method analysis walk
+ */
 ACPI_STATUS
-AnMethodAnalysisWalkEnd (
+MtMethodAnalysisWalkBegin (
     ACPI_PARSE_OBJECT       *Op,
     UINT32                  Level,
     void                    *Context);
 
 ACPI_STATUS
-AnMethodTypingWalkEnd (
+MtMethodAnalysisWalkEnd (
     ACPI_PARSE_OBJECT       *Op,
     UINT32                  Level,
     void                    *Context);
@@ -428,13 +431,67 @@  LsWriteNode (
     UINT32                  FileId);
 
 void
-LsDoHexOutput (
+LsDumpParseTree (
     void);
 
+
+/*
+ * asllistsup - Listing file support utilities
+ */
 void
-LsDumpParseTree (
+LsDumpAscii (
+    UINT32                  FileId,
+    UINT32                  Count,
+    UINT8                   *Buffer);
+
+void
+LsDumpAsciiInComment (
+    UINT32                  FileId,
+    UINT32                  Count,
+    UINT8                   *Buffer);
+
+void
+LsCheckException (
+    UINT32                  LineNumber,
+    UINT32                  FileId);
+
+void
+LsFlushListingBuffer (
+    UINT32                  FileId);
+
+void
+LsWriteListingHexBytes (
+    UINT8                   *Buffer,
+    UINT32                  Length,
+    UINT32                  FileId);
+
+void
+LsWriteSourceLines (
+    UINT32                  ToLineNumber,
+    UINT32                  ToLogicalLineNumber,
+    UINT32                  FileId);
+
+UINT32
+LsWriteOneSourceLine (
+    UINT32                  FileId);
+
+void
+LsPushNode (
+    char                    *Filename);
+
+ASL_LISTING_NODE *
+LsPopNode (
     void);
 
+
+/*
+ * aslhex - generate all "hex" output files (C, ASM, ASL)
+ */
+void
+HxDoHexOutput (
+    void);
+
+
 /*
  * aslfold - constant folding
  */
@@ -446,6 +503,24 @@  OpcAmlConstantWalk (
 
 
 /*
+ * asloffset - generate C offset file for BIOS support
+ */
+ACPI_STATUS
+LsAmlOffsetWalk (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context);
+
+void
+LsDoOffsetTableHeader (
+    UINT32                  FileId);
+
+void
+LsDoOffsetTableFooter (
+    UINT32                  FileId);
+
+
+/*
  * aslopcodes - generate AML opcodes
  */
 ACPI_STATUS
@@ -571,12 +646,28 @@  ApCheckForPredefinedObject (
     ACPI_PARSE_OBJECT       *Op,
     char                    *Name);
 
+ACPI_STATUS
+ApCheckObjectType (
+    const char              *PredefinedName,
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  ExpectedBtypes,
+    UINT32                  PackageIndex);
+
 void
 ApDisplayReservedNames (
     void);
 
 
 /*
+ * aslprepkg - ACPI predefined names support for packages
+ */
+void
+ApCheckPackage (
+    ACPI_PARSE_OBJECT           *ParentOp,
+    const ACPI_PREDEFINED_INFO  *Predefined);
+
+
+/*
  * asltransform - parse tree transformations
  */
 ACPI_STATUS
@@ -666,6 +757,11 @@  TrSetNodeFlags (
     UINT32                  Flags);
 
 ACPI_PARSE_OBJECT *
+TrSetNodeAmlLength (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Length);
+
+ACPI_PARSE_OBJECT *
 TrLinkPeerNodes (
     UINT32                  NumPeers,
     ...);
@@ -728,6 +824,10 @@  FlPrintFile (
     ...);
 
 void
+FlDeleteFile (
+    UINT32                  FileId);
+
+void
 FlSetLineNumber (
     UINT32                  LineNumber);
 
@@ -757,26 +857,34 @@  LdLoadNamespace (
 
 
 /*
- * asllookup - namespace cross reference
+ * asllookup - namespace lookup functions
  */
-ACPI_STATUS
-LkCrossReferenceNamespace (
-    void);
-
 void
 LkFindUnreferencedObjects (
     void);
 
+
+/*
+ * aslnamesp - namespace output file generation
+ */
 ACPI_STATUS
-LsDisplayNamespace (
+NsDisplayNamespace (
     void);
 
 void
-LsSetupNsList (
+NsSetupNamespaceListing (
     void                    *Handle);
 
 
 /*
+ * aslxref - namespace cross reference
+ */
+ACPI_STATUS
+XfCrossReferenceNamespace (
+    void);
+
+
+/*
  * aslutils - common compiler utilites
  */
 void
@@ -846,6 +954,10 @@  char *
 UtGetStringBuffer (
     UINT32                  Length);
 
+void
+UtExpandLineBuffers (
+    void);
+
 ACPI_STATUS
 UtInternalizeName (
     char                    *ExternalName,
@@ -1187,4 +1299,3 @@  DtCreateTemplates (
     char                    *Signature);
 
 #endif /*  __ASLCOMPILER_H */
-
diff --git a/src/acpica/source/compiler/aslcompiler.l b/src/acpica/source/compiler/aslcompiler.l
index 98f9e7e..f981796 100644
--- a/src/acpica/source/compiler/aslcompiler.l
+++ b/src/acpica/source/compiler/aslcompiler.l
@@ -9,13 +9,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +32,7 @@ 
  * 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
+ * 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
@@ -44,11 +44,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +56,7 @@ 
  * 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
+ * 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
@@ -81,10 +81,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +93,14 @@ 
  * 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
+ * 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
+ * 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
@@ -273,7 +273,7 @@  NamePathTail                [.]{NameSeg}
 "Mutex"                     { count (2); return (PARSEOP_MUTEX); }
 "Name"                      { count (2); return (PARSEOP_NAME); }
 "NAnd"                      { count (3); return (PARSEOP_NAND); }
-"Noop"                      { count (3); return (PARSEOP_NOOP); }
+"Noop"                      { if (!AcpiGbl_IgnoreNoopOperator) {count (3); return (PARSEOP_NOOP);} }
 "NOr"                       { count (3); return (PARSEOP_NOR); }
 "Not"                       { count (3); return (PARSEOP_NOT); }
 "Notify"                    { count (3); return (PARSEOP_NOTIFY); }
diff --git a/src/acpica/source/compiler/aslcompiler.y b/src/acpica/source/compiler/aslcompiler.y
index 9675b1d..7191e85 100644
--- a/src/acpica/source/compiler/aslcompiler.y
+++ b/src/acpica/source/compiler/aslcompiler.y
@@ -9,13 +9,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +32,7 @@ 
  * 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
+ * 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
@@ -44,11 +44,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +56,7 @@ 
  * 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
+ * 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
@@ -81,10 +81,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +93,14 @@ 
  * 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
+ * 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
+ * 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
@@ -632,7 +632,7 @@  void *                      AslLocalAllocate (unsigned int Size);
 %type <n> SwitchTerm
 %type <n> UnloadTerm
 %type <n> WhileTerm
-//%type <n> CaseTermList
+/* %type <n> CaseTermList */
 
 /* Type 2 opcodes */
 
@@ -733,6 +733,7 @@  void *                      AslLocalAllocate (unsigned int Size);
 /* Types */
 
 %type <n> SuperName
+%type <n> ObjectTypeName
 %type <n> ArgTerm
 %type <n> LocalTerm
 %type <n> DebugTerm
@@ -2063,7 +2064,7 @@  NotTerm
 
 ObjectTypeTerm
     : PARSEOP_OBJECTTYPE '('        {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);}
-        SuperName
+        ObjectTypeName
         ')'                         {$$ = TrLinkChildren ($<n>3,1,$4);}
     | PARSEOP_OBJECTTYPE '('
         error ')'                   {$$ = AslDoError(); yyclearin;}
@@ -2511,6 +2512,18 @@  SuperName
     | LocalTerm                     {}
     | DebugTerm                     {}
     | Type6Opcode                   {}
+
+/* For ObjectType: SuperName except for UserTerm (method invocation) */
+
+ObjectTypeName
+    : NameString                    {}
+    | ArgTerm                       {}
+    | LocalTerm                     {}
+    | DebugTerm                     {}
+    | RefOfTerm                     {}
+    | DerefOfTerm                   {}
+    | IndexTerm                     {}
+
 /*    | UserTerm                      {} */  /* Caused reduce/reduce with Type6Opcode->UserTerm */
     ;
 
@@ -2579,30 +2592,38 @@  ConstExprTerm
     | PARSEOP___PATH__              {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);}
     ;
 
+/*
+ * The NODE_COMPILE_TIME_CONST flag in the following constant expressions
+ * enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes
+ * to simple integers. It is an error if these types of expressions cannot be
+ * reduced, since the AML grammar for ****ConstExpr requires a simple constant.
+ * Note: The required byte length of the constant is passed through to the
+ * constant folding code in the node AmlLength field.
+ */
 ByteConstExpr
-    : Type3Opcode                   {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
-    | Type2IntegerOpcode            {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
+    : Type3Opcode                   {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);}
+    | Type2IntegerOpcode            {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);}
     | ConstExprTerm                 {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
     | ByteConst                     {}
     ;
 
 WordConstExpr
-    : Type3Opcode                   {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
-    | Type2IntegerOpcode            {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
+    : Type3Opcode                   {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);}
+    | Type2IntegerOpcode            {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);}
     | ConstExprTerm                 {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
     | WordConst                     {}
     ;
 
 DWordConstExpr
-    : Type3Opcode                   {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
-    | Type2IntegerOpcode            {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
+    : Type3Opcode                   {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);}
+    | Type2IntegerOpcode            {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);}
     | ConstExprTerm                 {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
     | DWordConst                    {}
     ;
 
 QWordConstExpr
-    : Type3Opcode                   {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
-    | Type2IntegerOpcode            {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
+    : Type3Opcode                   {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);}
+    | Type2IntegerOpcode            {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);}
     | ConstExprTerm                 {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
     | QWordConst                    {}
     ;
@@ -2911,10 +2932,10 @@  ExtendedSpaceTerm
 
 FixedDmaTerm
     : PARSEOP_FIXEDDMA '('          {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);}
-        WordConstExpr               // 04: DMA RequestLines
-        ',' WordConstExpr           // 06: DMA Channels
-        OptionalXferSize            // 07: DMA TransferSize
-        OptionalNameString          // 08: DescriptorName
+        WordConstExpr               /* 04: DMA RequestLines */
+        ',' WordConstExpr           /* 06: DMA Channels */
+        OptionalXferSize            /* 07: DMA TransferSize */
+        OptionalNameString          /* 08: DescriptorName */
         ')'                         {$$ = TrLinkChildren ($<n>3,4,$4,$6,$7,$8);}
     | PARSEOP_FIXEDDMA '('
         error ')'                   {$$ = AslDoError(); yyclearin;}
@@ -2932,16 +2953,16 @@  FixedIOTerm
 
 GpioIntTerm
     : PARSEOP_GPIO_INT '('          {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);}
-        InterruptTypeKeyword        // 04: InterruptType
-        ',' InterruptLevel          // 06: InterruptLevel
-        OptionalShareType           // 07: SharedType
-        ',' PinConfigByte           // 09: PinConfig
-        OptionalWordConstExpr       // 10: DebounceTimeout
-        ',' StringData              // 12: ResourceSource
-        OptionalByteConstExpr       // 13: ResourceSourceIndex
-        OptionalResourceType        // 14: ResourceType
-        OptionalNameString          // 15: DescriptorName
-        OptionalBuffer_Last         // 16: VendorData
+        InterruptTypeKeyword        /* 04: InterruptType */
+        ',' InterruptLevel          /* 06: InterruptLevel */
+        OptionalShareType           /* 07: SharedType */
+        ',' PinConfigByte           /* 09: PinConfig */
+        OptionalWordConstExpr       /* 10: DebounceTimeout */
+        ',' StringData              /* 12: ResourceSource */
+        OptionalByteConstExpr       /* 13: ResourceSourceIndex */
+        OptionalResourceType        /* 14: ResourceType */
+        OptionalNameString          /* 15: DescriptorName */
+        OptionalBuffer_Last         /* 16: VendorData */
         ')' '{'
             DWordConstExpr '}'      {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);}
     | PARSEOP_GPIO_INT '('
@@ -2950,16 +2971,16 @@  GpioIntTerm
 
 GpioIoTerm
     : PARSEOP_GPIO_IO '('           {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);}
-        OptionalShareType_First     // 04: SharedType
-        ',' PinConfigByte           // 06: PinConfig
-        OptionalWordConstExpr       // 07: DebounceTimeout
-        OptionalWordConstExpr       // 08: DriveStrength
-        OptionalIoRestriction       // 09: IoRestriction
-        ',' StringData              // 11: ResourceSource
-        OptionalByteConstExpr       // 12: ResourceSourceIndex
-        OptionalResourceType        // 13: ResourceType
-        OptionalNameString          // 14: DescriptorName
-        OptionalBuffer_Last         // 15: VendorData
+        OptionalShareType_First     /* 04: SharedType */
+        ',' PinConfigByte           /* 06: PinConfig */
+        OptionalWordConstExpr       /* 07: DebounceTimeout */
+        OptionalWordConstExpr       /* 08: DriveStrength */
+        OptionalIoRestriction       /* 09: IoRestriction */
+        ',' StringData              /* 11: ResourceSource */
+        OptionalByteConstExpr       /* 12: ResourceSourceIndex */
+        OptionalResourceType        /* 13: ResourceType */
+        OptionalNameString          /* 14: DescriptorName */
+        OptionalBuffer_Last         /* 15: VendorData */
         ')' '{'
             DWordList '}'           {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);}
     | PARSEOP_GPIO_IO '('
@@ -2968,15 +2989,15 @@  GpioIoTerm
 
 I2cSerialBusTerm
     : PARSEOP_I2C_SERIALBUS '('     {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);}
-        WordConstExpr               // 04: SlaveAddress
-        OptionalSlaveMode           // 05: SlaveMode
-        ',' DWordConstExpr          // 07: ConnectionSpeed
-        OptionalAddressingMode      // 08: AddressingMode
-        ',' StringData              // 10: ResourceSource
-        OptionalByteConstExpr       // 11: ResourceSourceIndex
-        OptionalResourceType        // 12: ResourceType
-        OptionalNameString          // 13: DescriptorName
-        OptionalBuffer_Last         // 14: VendorData
+        WordConstExpr               /* 04: SlaveAddress */
+        OptionalSlaveMode           /* 05: SlaveMode */
+        ',' DWordConstExpr          /* 07: ConnectionSpeed */
+        OptionalAddressingMode      /* 08: AddressingMode */
+        ',' StringData              /* 10: ResourceSource */
+        OptionalByteConstExpr       /* 11: ResourceSourceIndex */
+        OptionalResourceType        /* 12: ResourceType */
+        OptionalNameString          /* 13: DescriptorName */
+        OptionalBuffer_Last         /* 14: VendorData */
         ')'                         {$$ = TrLinkChildren ($<n>3,9,$4,$5,$7,$8,$10,$11,$12,$13,$14);}
     | PARSEOP_I2C_SERIALBUS '('
         error ')'                   {$$ = AslDoError(); yyclearin;}
@@ -3149,19 +3170,19 @@  RegisterTerm
 
 SpiSerialBusTerm
     : PARSEOP_SPI_SERIALBUS '('     {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);}
-        WordConstExpr               // 04: DeviceSelection
-        OptionalDevicePolarity      // 05: DevicePolarity
-        OptionalWireMode            // 06: WireMode
-        ',' ByteConstExpr           // 08: DataBitLength
-        OptionalSlaveMode           // 09: SlaveMode
-        ',' DWordConstExpr          // 11: ConnectionSpeed
-        ',' ClockPolarityKeyword    // 13: ClockPolarity
-        ',' ClockPhaseKeyword       // 15: ClockPhase
-        ',' StringData              // 17: ResourceSource
-        OptionalByteConstExpr       // 18: ResourceSourceIndex
-        OptionalResourceType        // 19: ResourceType
-        OptionalNameString          // 20: DescriptorName
-        OptionalBuffer_Last         // 21: VendorData
+        WordConstExpr               /* 04: DeviceSelection */
+        OptionalDevicePolarity      /* 05: DevicePolarity */
+        OptionalWireMode            /* 06: WireMode */
+        ',' ByteConstExpr           /* 08: DataBitLength */
+        OptionalSlaveMode           /* 09: SlaveMode */
+        ',' DWordConstExpr          /* 11: ConnectionSpeed */
+        ',' ClockPolarityKeyword    /* 13: ClockPolarity */
+        ',' ClockPhaseKeyword       /* 15: ClockPhase */
+        ',' StringData              /* 17: ResourceSource */
+        OptionalByteConstExpr       /* 18: ResourceSourceIndex */
+        OptionalResourceType        /* 19: ResourceType */
+        OptionalNameString          /* 20: DescriptorName */
+        OptionalBuffer_Last         /* 21: VendorData */
         ')'                         {$$ = TrLinkChildren ($<n>3,13,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21);}
     | PARSEOP_SPI_SERIALBUS '('
         error ')'                   {$$ = AslDoError(); yyclearin;}
@@ -3187,20 +3208,20 @@  StartDependentFnTerm
 
 UartSerialBusTerm
     : PARSEOP_UART_SERIALBUS '('    {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);}
-        DWordConstExpr              // 04: ConnectionSpeed
-        OptionalBitsPerByte         // 05: BitsPerByte
-        OptionalStopBits            // 06: StopBits
-        ',' ByteConstExpr           // 08: LinesInUse
-        OptionalEndian              // 09: Endianess
-        OptionalParityType          // 10: Parity
-        OptionalFlowControl         // 11: FlowControl
-        ',' WordConstExpr           // 13: Rx BufferSize
-        ',' WordConstExpr           // 15: Tx BufferSize
-        ',' StringData              // 17: ResourceSource
-        OptionalByteConstExpr       // 18: ResourceSourceIndex
-        OptionalResourceType        // 19: ResourceType
-        OptionalNameString          // 20: DescriptorName
-        OptionalBuffer_Last         // 21: VendorData
+        DWordConstExpr              /* 04: ConnectionSpeed */
+        OptionalBitsPerByte         /* 05: BitsPerByte */
+        OptionalStopBits            /* 06: StopBits */
+        ',' ByteConstExpr           /* 08: LinesInUse */
+        OptionalEndian              /* 09: Endianess */
+        OptionalParityType          /* 10: Parity */
+        OptionalFlowControl         /* 11: FlowControl */
+        ',' WordConstExpr           /* 13: Rx BufferSize */
+        ',' WordConstExpr           /* 15: Tx BufferSize */
+        ',' StringData              /* 17: ResourceSource */
+        OptionalByteConstExpr       /* 18: ResourceSourceIndex */
+        OptionalResourceType        /* 19: ResourceType */
+        OptionalNameString          /* 20: DescriptorName */
+        OptionalBuffer_Last         /* 21: VendorData */
         ')'                         {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21);}
     | PARSEOP_UART_SERIALBUS '('
         error ')'                   {$$ = AslDoError(); yyclearin;}
@@ -3573,7 +3594,7 @@  OptionalXferSize
 int
 AslCompilerwrap(void)
 {
-  return 1;
+  return (1);
 }
 
 /*! [End] no source code translation !*/
diff --git a/src/acpica/source/compiler/asldefine.h b/src/acpica/source/compiler/asldefine.h
index 146ab6d..4920f00 100644
--- a/src/acpica/source/compiler/asldefine.h
+++ b/src/acpica/source/compiler/asldefine.h
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: asldefine.h - Common defines for the iASL compiler
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -193,13 +192,15 @@ 
 #define FILE_SUFFIX_ASM_INCLUDE     "inc"
 #define FILE_SUFFIX_C_INCLUDE       "h"
 #define FILE_SUFFIX_ASL_CODE        "asl"
+#define FILE_SUFFIX_C_OFFSET        "offset.h"
 
 
 /* Types for input files */
 
 #define ASL_INPUT_TYPE_BINARY       0
-#define ASL_INPUT_TYPE_ASCII_ASL    1
-#define ASL_INPUT_TYPE_ASCII_DATA   2
+#define ASL_INPUT_TYPE_ACPI_TABLE   1
+#define ASL_INPUT_TYPE_ASCII_ASL    2
+#define ASL_INPUT_TYPE_ASCII_DATA   3
 
 
 /* Misc */
@@ -210,6 +211,11 @@ 
 #define ASL_EOF                     ACPI_UINT32_MAX
 
 
+/* Listings */
+
+#define ASL_LISTING_LINE_PREFIX         ":  "
+
+
 /* Support for reserved method names */
 
 #define ACPI_VALID_RESERVED_NAME_MAX    0x80000000
@@ -246,4 +252,3 @@ 
     RsCreateResourceField (Op, Name, ByteOffset, 0, 64);
 
 #endif /* ASLDEFINE.H */
-
diff --git a/src/acpica/source/compiler/aslerror.c b/src/acpica/source/compiler/aslerror.c
index 4d7c846..01a2013 100644
--- a/src/acpica/source/compiler/aslerror.c
+++ b/src/acpica/source/compiler/aslerror.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslerror - Error handling and statistics
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -167,7 +166,7 @@  AeClearErrorLog (
  *
  * RETURN:      None
  *
- * DESCRIPTION: Add a new error node to the error log.  The error log is
+ * DESCRIPTION: Add a new error node to the error log. The error log is
  *              ordered by the "logical" line number (cumulative line number
  *              including all include files.)
  *
@@ -255,6 +254,7 @@  AePrintException (
     FILE                    *SourceFile = NULL;
     long                    FileSize;
     BOOLEAN                 PrematureEOF = FALSE;
+    UINT32                  Total = 0;
 
 
     if (Gbl_NoErrors)
@@ -366,17 +366,45 @@  AePrintException (
                         else
                         {
                             RActual = fread (&SourceByte, 1, 1, SourceFile);
-                            if (!RActual)
+                            if (RActual != 1)
                             {
                                 fprintf (OutputFile,
                                     "[*** iASL: Read error on source code temp file %s ***]",
                                     Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename);
                             }
-
-                            else while (RActual && SourceByte && (SourceByte != '\n'))
+                            else
                             {
-                                fwrite (&SourceByte, 1, 1, OutputFile);
-                                RActual = fread (&SourceByte, 1, 1, SourceFile);
+                                /* Read/write the source line, up to the maximum line length */
+
+                                while (RActual && SourceByte && (SourceByte != '\n'))
+                                {
+                                    if (Total < 256)
+                                    {
+                                        /* After the max line length, we will just read the line, no write */
+
+                                        if (fwrite (&SourceByte, 1, 1, OutputFile) != 1)
+                                        {
+                                            printf ("[*** iASL: Write error on output file ***]\n");
+                                            return;
+                                        }
+                                    }
+                                    else if (Total == 256)
+                                    {
+                                        fprintf (OutputFile,
+                                            "\n[*** iASL: Very long input line, message below refers to column %u ***]",
+                                            Enode->Column);
+                                    }
+
+                                    RActual = fread (&SourceByte, 1, 1, SourceFile);
+                                    if (RActual != 1)
+                                    {
+                                        fprintf (OutputFile,
+                                            "[*** iASL: Read error on source code temp file %s ***]",
+                                            Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename);
+                                        return;
+                                    }
+                                    Total++;
+                                }
                             }
                         }
                     }
@@ -453,20 +481,28 @@  AePrintException (
 
             if (Gbl_VerboseErrors && !PrematureEOF)
             {
-                SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2;
-                ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1;
-
-                if ((MsgLength + ErrorColumn) < (SourceColumn - 1))
+                if (Total >= 256)
                 {
-                    fprintf (OutputFile, "%*s%s",
-                        (int) ((SourceColumn - 1) - ErrorColumn),
-                        MainMessage, " ^ ");
+                    fprintf (OutputFile, "    %s",
+                        MainMessage);
                 }
                 else
                 {
-                    fprintf (OutputFile, "%*s %s",
-                        (int) ((SourceColumn - ErrorColumn) + 1), "^",
-                        MainMessage);
+                    SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2;
+                    ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1;
+
+                    if ((MsgLength + ErrorColumn) < (SourceColumn - 1))
+                    {
+                        fprintf (OutputFile, "%*s%s",
+                            (int) ((SourceColumn - 1) - ErrorColumn),
+                            MainMessage, " ^ ");
+                    }
+                    else
+                    {
+                        fprintf (OutputFile, "%*s %s",
+                            (int) ((SourceColumn - ErrorColumn) + 1), "^",
+                            MainMessage);
+                    }
                 }
             }
             else
@@ -702,7 +738,6 @@  AslCommonError (
 
         Gbl_SourceLine = 0;
         Gbl_NextError = Gbl_ErrorLog;
-        CmDoOutputFiles ();
         CmCleanupAndExit ();
         exit(1);
     }
@@ -836,5 +871,5 @@  AslCompilererror (
         Gbl_CurrentColumn, Gbl_Files[ASL_FILE_INPUT].Filename,
         ACPI_CAST_PTR (char, CompilerMessage));
 
-    return 0;
+    return (0);
 }
diff --git a/src/acpica/source/compiler/aslfileio.c b/src/acpica/source/compiler/aslfileio.c
new file mode 100644
index 0000000..9a4fc09
--- /dev/null
+++ b/src/acpica/source/compiler/aslfileio.c
@@ -0,0 +1,465 @@ 
+/******************************************************************************
+ *
+ * Module Name: aslfileio - File I/O support
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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 "aslcompiler.h"
+
+#define _COMPONENT          ACPI_COMPILER
+        ACPI_MODULE_NAME    ("aslfileio")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AslAbort
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Dump the error log and abort the compiler. Used for serious
+ *              I/O errors.
+ *
+ ******************************************************************************/
+
+void
+AslAbort (
+    void)
+{
+
+    AePrintErrorLog (ASL_FILE_STDERR);
+    if (Gbl_DebugFlag)
+    {
+        /* Print error summary to stdout also */
+
+        AePrintErrorLog (ASL_FILE_STDOUT);
+    }
+
+    exit (1);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    FlFileError
+ *
+ * PARAMETERS:  FileId              - Index into file info array
+ *              ErrorId             - Index into error message array
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Decode errno to an error message and add the entire error
+ *              to the error log.
+ *
+ ******************************************************************************/
+
+void
+FlFileError (
+    UINT32                  FileId,
+    UINT8                   ErrorId)
+{
+
+    sprintf (MsgBuffer, "\"%s\" (%s)", Gbl_Files[FileId].Filename,
+        strerror (errno));
+    AslCommonError (ASL_ERROR, ErrorId, 0, 0, 0, 0, NULL, MsgBuffer);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    FlOpenFile
+ *
+ * PARAMETERS:  FileId              - Index into file info array
+ *              Filename            - file pathname to open
+ *              Mode                - Open mode for fopen
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Open a file.
+ *              NOTE: Aborts compiler on any error.
+ *
+ ******************************************************************************/
+
+void
+FlOpenFile (
+    UINT32                  FileId,
+    char                    *Filename,
+    char                    *Mode)
+{
+    FILE                    *File;
+
+
+    File = fopen (Filename, Mode);
+    if (!File)
+    {
+        FlFileError (FileId, ASL_MSG_OPEN);
+        AslAbort ();
+    }
+
+    Gbl_Files[FileId].Filename = Filename;
+    Gbl_Files[FileId].Handle   = File;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    FlGetFileSize
+ *
+ * PARAMETERS:  FileId              - Index into file info array
+ *
+ * RETURN:      File Size
+ *
+ * DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open.
+ *
+ ******************************************************************************/
+
+UINT32
+FlGetFileSize (
+    UINT32                  FileId)
+{
+    FILE                    *fp;
+    UINT32                  FileSize;
+    long                    Offset;
+
+
+    fp = Gbl_Files[FileId].Handle;
+    Offset = ftell (fp);
+
+    fseek (fp, 0, SEEK_END);
+    FileSize = (UINT32) ftell (fp);
+
+    /* Restore file pointer */
+
+    fseek (fp, Offset, SEEK_SET);
+    return (FileSize);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    FlReadFile
+ *
+ * PARAMETERS:  FileId              - Index into file info array
+ *              Buffer              - Where to place the data
+ *              Length              - Amount to read
+ *
+ * RETURN:      Status. AE_ERROR indicates EOF.
+ *
+ * DESCRIPTION: Read data from an open file.
+ *              NOTE: Aborts compiler on any error.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+FlReadFile (
+    UINT32                  FileId,
+    void                    *Buffer,
+    UINT32                  Length)
+{
+    UINT32                  Actual;
+
+
+    /* Read and check for error */
+
+    Actual = fread (Buffer, 1, Length, Gbl_Files[FileId].Handle);
+    if (Actual < Length)
+    {
+        if (feof (Gbl_Files[FileId].Handle))
+        {
+            /* End-of-file, just return error */
+
+            return (AE_ERROR);
+        }
+
+        FlFileError (FileId, ASL_MSG_READ);
+        AslAbort ();
+    }
+
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    FlWriteFile
+ *
+ * PARAMETERS:  FileId              - Index into file info array
+ *              Buffer              - Data to write
+ *              Length              - Amount of data to write
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Write data to an open file.
+ *              NOTE: Aborts compiler on any error.
+ *
+ ******************************************************************************/
+
+void
+FlWriteFile (
+    UINT32                  FileId,
+    void                    *Buffer,
+    UINT32                  Length)
+{
+    UINT32                  Actual;
+
+
+    /* Write and check for error */
+
+    Actual = fwrite ((char *) Buffer, 1, Length, Gbl_Files[FileId].Handle);
+    if (Actual != Length)
+    {
+        FlFileError (FileId, ASL_MSG_WRITE);
+        AslAbort ();
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    FlPrintFile
+ *
+ * PARAMETERS:  FileId              - Index into file info array
+ *              Format              - Printf format string
+ *              ...                 - Printf arguments
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Formatted write to an open file.
+ *              NOTE: Aborts compiler on any error.
+ *
+ ******************************************************************************/
+
+void
+FlPrintFile (
+    UINT32                  FileId,
+    char                    *Format,
+    ...)
+{
+    INT32                   Actual;
+    va_list                 Args;
+
+
+    va_start (Args, Format);
+
+    Actual = vfprintf (Gbl_Files[FileId].Handle, Format, Args);
+    va_end (Args);
+
+    if (Actual == -1)
+    {
+        FlFileError (FileId, ASL_MSG_WRITE);
+        AslAbort ();
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    FlSeekFile
+ *
+ * PARAMETERS:  FileId              - Index into file info array
+ *              Offset              - Absolute byte offset in file
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Seek to absolute offset.
+ *              NOTE: Aborts compiler on any error.
+ *
+ ******************************************************************************/
+
+void
+FlSeekFile (
+    UINT32                  FileId,
+    long                    Offset)
+{
+    int                     Error;
+
+
+    Error = fseek (Gbl_Files[FileId].Handle, Offset, SEEK_SET);
+    if (Error)
+    {
+        FlFileError (FileId, ASL_MSG_SEEK);
+        AslAbort ();
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    FlCloseFile
+ *
+ * PARAMETERS:  FileId              - Index into file info array
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Close an open file. Aborts compiler on error
+ *
+ ******************************************************************************/
+
+void
+FlCloseFile (
+    UINT32                  FileId)
+{
+    int                     Error;
+
+
+    if (!Gbl_Files[FileId].Handle)
+    {
+        return;
+    }
+
+    Error = fclose (Gbl_Files[FileId].Handle);
+    if (Error)
+    {
+        FlFileError (FileId, ASL_MSG_CLOSE);
+        AslAbort ();
+    }
+
+    Gbl_Files[FileId].Handle = NULL;
+    return;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    FlDeleteFile
+ *
+ * PARAMETERS:  FileId              - Index into file info array
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Delete a file.
+ *
+ ******************************************************************************/
+
+void
+FlDeleteFile (
+    UINT32                  FileId)
+{
+    ASL_FILE_INFO           *Info = &Gbl_Files[FileId];
+
+
+    if (!Info->Filename)
+    {
+        return;
+    }
+
+    if (remove (Info->Filename))
+    {
+        printf ("%s (%s file) ",
+            Info->Filename, Info->Description);
+        perror ("Could not delete");
+    }
+
+    Info->Filename = NULL;
+    return;
+}
diff --git a/src/acpica/source/compiler/aslfiles.c b/src/acpica/source/compiler/aslfiles.c
index a2512a6..df3d368 100644
--- a/src/acpica/source/compiler/aslfiles.c
+++ b/src/acpica/source/compiler/aslfiles.c
@@ -1,7 +1,6 @@ 
-
 /******************************************************************************
  *
- * Module Name: aslfiles - file I/O suppoert
+ * Module Name: aslfiles - File support functions
  *
  *****************************************************************************/
 
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -137,317 +136,6 @@  FlParseInputPathname (
 
 /*******************************************************************************
  *
- * FUNCTION:    AslAbort
- *
- * PARAMETERS:  None
- *
- * RETURN:      None
- *
- * DESCRIPTION: Dump the error log and abort the compiler.  Used for serious
- *              I/O errors
- *
- ******************************************************************************/
-
-void
-AslAbort (
-    void)
-{
-
-    AePrintErrorLog (ASL_FILE_STDERR);
-    if (Gbl_DebugFlag)
-    {
-        /* Print error summary to stdout also */
-
-        AePrintErrorLog (ASL_FILE_STDOUT);
-    }
-
-    exit (1);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    FlFileError
- *
- * PARAMETERS:  FileId              - Index into file info array
- *              ErrorId             - Index into error message array
- *
- * RETURN:      None
- *
- * DESCRIPTION: Decode errno to an error message and add the entire error
- *              to the error log.
- *
- ******************************************************************************/
-
-void
-FlFileError (
-    UINT32                  FileId,
-    UINT8                   ErrorId)
-{
-
-    sprintf (MsgBuffer, "\"%s\" (%s)", Gbl_Files[FileId].Filename,
-        strerror (errno));
-    AslCommonError (ASL_ERROR, ErrorId, 0, 0, 0, 0, NULL, MsgBuffer);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    FlOpenFile
- *
- * PARAMETERS:  FileId              - Index into file info array
- *              Filename            - file pathname to open
- *              Mode                - Open mode for fopen
- *
- * RETURN:      None
- *
- * DESCRIPTION: Open a file.
- *              NOTE: Aborts compiler on any error.
- *
- ******************************************************************************/
-
-void
-FlOpenFile (
-    UINT32                  FileId,
-    char                    *Filename,
-    char                    *Mode)
-{
-    FILE                    *File;
-
-
-    File = fopen (Filename, Mode);
-
-    Gbl_Files[FileId].Filename = Filename;
-    Gbl_Files[FileId].Handle   = File;
-
-    if (!File)
-    {
-        FlFileError (FileId, ASL_MSG_OPEN);
-        AslAbort ();
-    }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    FlGetFileSize
- *
- * PARAMETERS:  FileId              - Index into file info array
- *
- * RETURN:      File Size
- *
- * DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open.
- *
- ******************************************************************************/
-
-UINT32
-FlGetFileSize (
-    UINT32                  FileId)
-{
-    FILE                    *fp;
-    UINT32                  FileSize;
-    long                    Offset;
-
-
-    fp = Gbl_Files[FileId].Handle;
-    Offset = ftell (fp);
-
-    fseek (fp, 0, SEEK_END);
-    FileSize = (UINT32) ftell (fp);
-
-    /* Restore file pointer */
-
-    fseek (fp, Offset, SEEK_SET);
-    return (FileSize);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    FlReadFile
- *
- * PARAMETERS:  FileId              - Index into file info array
- *              Buffer              - Where to place the data
- *              Length              - Amount to read
- *
- * RETURN:      Status.  AE_ERROR indicates EOF.
- *
- * DESCRIPTION: Read data from an open file.
- *              NOTE: Aborts compiler on any error.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-FlReadFile (
-    UINT32                  FileId,
-    void                    *Buffer,
-    UINT32                  Length)
-{
-    UINT32                  Actual;
-
-
-    /* Read and check for error */
-
-    Actual = fread (Buffer, 1, Length, Gbl_Files[FileId].Handle);
-    if (Actual != Length)
-    {
-        if (feof (Gbl_Files[FileId].Handle))
-        {
-            /* End-of-file, just return error */
-
-            return (AE_ERROR);
-        }
-
-        FlFileError (FileId, ASL_MSG_READ);
-        AslAbort ();
-    }
-
-    return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    FlWriteFile
- *
- * PARAMETERS:  FileId              - Index into file info array
- *              Buffer              - Data to write
- *              Length              - Amount of data to write
- *
- * RETURN:      None
- *
- * DESCRIPTION: Write data to an open file.
- *              NOTE: Aborts compiler on any error.
- *
- ******************************************************************************/
-
-void
-FlWriteFile (
-    UINT32                  FileId,
-    void                    *Buffer,
-    UINT32                  Length)
-{
-    UINT32                  Actual;
-
-
-    /* Write and check for error */
-
-    Actual = fwrite ((char *) Buffer, 1, Length, Gbl_Files[FileId].Handle);
-    if (Actual != Length)
-    {
-        FlFileError (FileId, ASL_MSG_WRITE);
-        AslAbort ();
-    }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    FlPrintFile
- *
- * PARAMETERS:  FileId              - Index into file info array
- *              Format              - Printf format string
- *              ...                 - Printf arguments
- *
- * RETURN:      None
- *
- * DESCRIPTION: Formatted write to an open file.
- *              NOTE: Aborts compiler on any error.
- *
- ******************************************************************************/
-
-void
-FlPrintFile (
-    UINT32                  FileId,
-    char                    *Format,
-    ...)
-{
-    INT32                   Actual;
-    va_list                 Args;
-
-
-    va_start (Args, Format);
-
-    Actual = vfprintf (Gbl_Files[FileId].Handle, Format, Args);
-    va_end (Args);
-
-    if (Actual == -1)
-    {
-        FlFileError (FileId, ASL_MSG_WRITE);
-        AslAbort ();
-    }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    FlSeekFile
- *
- * PARAMETERS:  FileId              - Index into file info array
- *              Offset              - Absolute byte offset in file
- *
- * RETURN:      None
- *
- * DESCRIPTION: Seek to absolute offset
- *              NOTE: Aborts compiler on any error.
- *
- ******************************************************************************/
-
-void
-FlSeekFile (
-    UINT32                  FileId,
-    long                    Offset)
-{
-    int                     Error;
-
-
-    Error = fseek (Gbl_Files[FileId].Handle, Offset, SEEK_SET);
-    if (Error)
-    {
-        FlFileError (FileId, ASL_MSG_SEEK);
-        AslAbort ();
-    }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    FlCloseFile
- *
- * PARAMETERS:  FileId              - Index into file info array
- *
- * RETURN:      None
- *
- * DESCRIPTION: Close an open file.  Aborts compiler on error
- *
- ******************************************************************************/
-
-void
-FlCloseFile (
-    UINT32                  FileId)
-{
-    int                     Error;
-
-
-    if (!Gbl_Files[FileId].Handle)
-    {
-        return;
-    }
-
-    Error = fclose (Gbl_Files[FileId].Handle);
-    if (Error)
-    {
-        FlFileError (FileId, ASL_MSG_CLOSE);
-        AslAbort ();
-    }
-
-    Gbl_Files[FileId].Handle = NULL;
-    return;
-}
-
-
-/*******************************************************************************
- *
  * FUNCTION:    FlSetLineNumber
  *
  * PARAMETERS:  Op        - Parse node for the LINE asl statement
@@ -696,16 +384,17 @@  FlOpenIncludeWithPrefix (
     /* Attempt to open the file, push if successful */
 
     IncludeFile = fopen (Pathname, "r");
-    if (IncludeFile)
+    if (!IncludeFile)
     {
-        /* Push the include file on the open input file stack */
-
-        AslPushInputFileStack (IncludeFile, Pathname);
-        return (IncludeFile);
+        fprintf (stderr, "Could not open include file %s\n", Pathname);
+        ACPI_FREE (Pathname);
+        return (NULL);
     }
 
-    ACPI_FREE (Pathname);
-    return (NULL);
+    /* Push the include file on the open input file stack */
+
+    AslPushInputFileStack (IncludeFile, Pathname);
+    return (IncludeFile);
 }
 
 
@@ -841,7 +530,7 @@  FlOpenInputFile (
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Create the output filename (*.AML) and open the file.  The file
+ * DESCRIPTION: Create the output filename (*.AML) and open the file. The file
  *              is created in the same directory as the parent input file.
  *
  ******************************************************************************/
@@ -896,6 +585,13 @@  FlOpenMiscOutputFiles (
     char                    *Filename;
 
 
+    /* All done for disassembler */
+
+    if (Gbl_FileType == ASL_INPUT_TYPE_ACPI_TABLE)
+    {
+        return (AE_OK);
+    }
+
     /* Create/Open a hex output file if asked */
 
     if (Gbl_HexOutputFlag)
@@ -989,7 +685,7 @@  FlOpenMiscOutputFiles (
         return (AE_OK);
     }
 
-   /* Create/Open a combined source output file */
+    /* Create/Open a combined source output file */
 
     Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_SOURCE);
     if (!Filename)
@@ -1051,6 +747,27 @@  FlOpenMiscOutputFiles (
         AslCompilerFileHeader (ASL_FILE_C_SOURCE_OUTPUT);
     }
 
+    /* Create/Open a C code source output file for the offset table if asked */
+
+    if (Gbl_C_OffsetTableFlag)
+    {
+        Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_C_OFFSET);
+        if (!Filename)
+        {
+            AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
+                0, 0, 0, 0, NULL, NULL);
+            return (AE_ERROR);
+        }
+
+        /* Open the C code source file, text mode */
+
+        FlOpenFile (ASL_FILE_C_OFFSET_OUTPUT, Filename, "w+t");
+
+        FlPrintFile (ASL_FILE_C_OFFSET_OUTPUT, "/*\n");
+        AslCompilerSignon (ASL_FILE_C_OFFSET_OUTPUT);
+        AslCompilerFileHeader (ASL_FILE_C_OFFSET_OUTPUT);
+    }
+
     /* Create/Open a assembly include output file if asked */
 
     if (Gbl_AsmIncludeOutputFlag)
@@ -1182,5 +899,3 @@  FlParseInputPathname (
     return (AE_OK);
 }
 #endif
-
-
diff --git a/src/acpica/source/compiler/aslfold.c b/src/acpica/source/compiler/aslfold.c
index dffcc57..0644e39 100644
--- a/src/acpica/source/compiler/aslfold.c
+++ b/src/acpica/source/compiler/aslfold.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslfold - Constant folding
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -145,6 +144,11 @@  OpcAmlCheckForConstant (
     UINT32                  Level,
     void                    *Context);
 
+static void
+OpcUpdateIntegerNode (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT64                  Value);
+
 
 /*******************************************************************************
  *
@@ -267,6 +271,19 @@  OpcAmlCheckForConstant (
     DbgPrint (ASL_PARSE_OUTPUT, "[%.4d] Opcode: %12.12s ",
                 Op->Asl.LogicalLineNumber, Op->Asl.ParseOpName);
 
+    /*
+     * These opcodes do not appear in the OpcodeInfo table, but
+     * they represent constants, so abort the constant walk now.
+     */
+    if ((WalkState->Opcode == AML_RAW_DATA_BYTE) ||
+        (WalkState->Opcode == AML_RAW_DATA_WORD) ||
+        (WalkState->Opcode == AML_RAW_DATA_DWORD) ||
+        (WalkState->Opcode == AML_RAW_DATA_QWORD))
+    {
+        WalkState->WalkType = ACPI_WALK_CONST_OPTIONAL;
+        return (AE_TYPE);
+    }
+
     if (!(WalkState->OpInfo->Flags & AML_CONSTANT))
     {
         /* The opcode is not a Type 3/4/5 opcode */
@@ -286,14 +303,14 @@  OpcAmlCheckForConstant (
         {
             /*
              * We are looking at at normal expression to see if it can be
-             * reduced.  It can't.  No error
+             * reduced. It can't. No error
              */
             return (AE_TYPE);
         }
 
         /*
          * This is an expression that MUST reduce to a constant, and it
-         * can't be reduced.  This is an error
+         * can't be reduced. This is an error
          */
         if (Op->Asl.CompileFlags & NODE_IS_TARGET)
         {
@@ -321,8 +338,8 @@  OpcAmlCheckForConstant (
     {
         DbgPrint (ASL_PARSE_OUTPUT, " TERMARG");
     }
-    DbgPrint (ASL_PARSE_OUTPUT, "\n");
 
+    DbgPrint (ASL_PARSE_OUTPUT, "\n");
     return (AE_OK);
 }
 
@@ -388,20 +405,20 @@  OpcAmlConstantWalk (
     WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
     if (!WalkState)
     {
-        return AE_NO_MEMORY;
+        return (AE_NO_MEMORY);
     }
 
-    WalkState->NextOp               = NULL;
-    WalkState->Params               = NULL;
-    WalkState->CallerReturnDesc     = &ObjDesc;
-    WalkState->WalkType             = WalkType;
+    WalkState->NextOp = NULL;
+    WalkState->Params = NULL;
+    WalkState->WalkType = WalkType;
+    WalkState->CallerReturnDesc = &ObjDesc;
 
     /*
      * Examine the entire subtree -- all nodes must be constants
      * or type 3/4/5 opcodes
      */
     Status = TrWalkParseTree (Op, ASL_WALK_VISIT_DOWNWARD,
-                OpcAmlCheckForConstant, NULL, WalkState);
+        OpcAmlCheckForConstant, NULL, WalkState);
 
     /*
      * Did we find an entire subtree that contains all constants and type 3/4/5
@@ -441,7 +458,7 @@  OpcAmlConstantWalk (
         /* Hand off the subtree to the AML interpreter */
 
         Status = TrWalkParseTree (Op, ASL_WALK_VISIT_TWICE,
-                    OpcAmlEvaluationWalk1, OpcAmlEvaluationWalk2, WalkState);
+            OpcAmlEvaluationWalk1, OpcAmlEvaluationWalk2, WalkState);
         Op->Common.Parent = OriginalParentOp;
 
         /* TBD: we really *should* release the RootOp node */
@@ -454,22 +471,26 @@  OpcAmlConstantWalk (
 
             Status = AcpiDsResultPop (&ObjDesc, WalkState);
         }
+
+        /* Check for error from the ACPICA core */
+
+        if (ACPI_FAILURE (Status))
+        {
+            AslCoreSubsystemError (Op, Status,
+                "Failure during constant evaluation", FALSE);
+        }
     }
 
     if (ACPI_FAILURE (Status))
     {
         /* We could not resolve the subtree for some reason */
 
-        AslCoreSubsystemError (Op, Status,
-            "Failure during constant evaluation", FALSE);
         AslError (ASL_ERROR, ASL_MSG_CONSTANT_EVALUATION, Op,
             Op->Asl.ParseOpName);
 
-        /* Set the subtree value to ZERO anyway.  Eliminates further errors */
+        /* Set the subtree value to ZERO anyway. Eliminates further errors */
 
-        Op->Asl.ParseOpcode      = PARSEOP_INTEGER;
-        Op->Common.Value.Integer = 0;
-        OpcSetOptimalIntegerSize (Op);
+        OpcUpdateIntegerNode (Op, 0);
     }
     else
     {
@@ -484,21 +505,20 @@  OpcAmlConstantWalk (
         {
         case ACPI_TYPE_INTEGER:
 
-            Op->Asl.ParseOpcode      = PARSEOP_INTEGER;
-            Op->Common.Value.Integer = ObjDesc->Integer.Value;
-            OpcSetOptimalIntegerSize (Op);
+            OpcUpdateIntegerNode (Op, ObjDesc->Integer.Value);
 
             DbgPrint (ASL_PARSE_OUTPUT,
-                "Constant expression reduced to (INTEGER) %8.8X%8.8X\n",
-                ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
+                "Constant expression reduced to (%s) %8.8X%8.8X\n",
+                Op->Asl.ParseOpName,
+                ACPI_FORMAT_UINT64 (Op->Common.Value.Integer));
             break;
 
 
         case ACPI_TYPE_STRING:
 
-            Op->Asl.ParseOpcode     = PARSEOP_STRING_LITERAL;
-            Op->Common.AmlOpcode    = AML_STRING_OP;
-            Op->Asl.AmlLength       = ACPI_STRLEN (ObjDesc->String.Pointer) + 1;
+            Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL;
+            Op->Common.AmlOpcode = AML_STRING_OP;
+            Op->Asl.AmlLength = ACPI_STRLEN (ObjDesc->String.Pointer) + 1;
             Op->Common.Value.String = ObjDesc->String.Pointer;
 
             DbgPrint (ASL_PARSE_OUTPUT,
@@ -510,18 +530,18 @@  OpcAmlConstantWalk (
 
         case ACPI_TYPE_BUFFER:
 
-            Op->Asl.ParseOpcode     = PARSEOP_BUFFER;
-            Op->Common.AmlOpcode    = AML_BUFFER_OP;
-            Op->Asl.CompileFlags    = NODE_AML_PACKAGE;
+            Op->Asl.ParseOpcode = PARSEOP_BUFFER;
+            Op->Common.AmlOpcode = AML_BUFFER_OP;
+            Op->Asl.CompileFlags = NODE_AML_PACKAGE;
             UtSetParseOpName (Op);
 
             /* Child node is the buffer length */
 
             RootOp = TrAllocateNode (PARSEOP_INTEGER);
 
-            RootOp->Asl.AmlOpcode     = AML_DWORD_OP;
+            RootOp->Asl.AmlOpcode = AML_DWORD_OP;
             RootOp->Asl.Value.Integer = ObjDesc->Buffer.Length;
-            RootOp->Asl.Parent        = Op;
+            RootOp->Asl.Parent = Op;
 
             (void) OpcSetOptimalIntegerSize (RootOp);
 
@@ -532,10 +552,10 @@  OpcAmlConstantWalk (
             /* Peer to the child is the raw buffer data */
 
             RootOp = TrAllocateNode (PARSEOP_RAW_DATA);
-            RootOp->Asl.AmlOpcode     = AML_RAW_DATA_BUFFER;
-            RootOp->Asl.AmlLength     = ObjDesc->Buffer.Length;
-            RootOp->Asl.Value.String  = (char *) ObjDesc->Buffer.Pointer;
-            RootOp->Asl.Parent        = Op->Asl.Parent;
+            RootOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
+            RootOp->Asl.AmlLength = ObjDesc->Buffer.Length;
+            RootOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer;
+            RootOp->Asl.Parent = Op->Asl.Parent;
 
             Op->Asl.Next = RootOp;
             Op = RootOp;
@@ -548,7 +568,7 @@  OpcAmlConstantWalk (
 
         default:
             printf ("Unsupported return type: %s\n",
-                        AcpiUtGetObjectTypeName (ObjDesc));
+                AcpiUtGetObjectTypeName (ObjDesc));
             break;
         }
     }
@@ -557,7 +577,62 @@  OpcAmlConstantWalk (
     Op->Asl.Child = NULL;
 
     AcpiDsDeleteWalkState (WalkState);
-
     return (AE_CTRL_DEPTH);
 }
 
+
+/*******************************************************************************
+ *
+ * FUNCTION:    OpcUpdateIntegerNode
+ *
+ * PARAMETERS:  Op                  - Current parse object
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Update node to the correct integer type.
+ *
+ ******************************************************************************/
+
+static void
+OpcUpdateIntegerNode (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT64                  Value)
+{
+
+    Op->Common.Value.Integer = Value;
+
+    /*
+     * The AmlLength is used by the parser to indicate a constant,
+     * (if non-zero). Length is either (1/2/4/8)
+     */
+    switch (Op->Asl.AmlLength)
+    {
+    case 1:
+        TrUpdateNode (PARSEOP_BYTECONST, Op);
+        Op->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
+        break;
+
+    case 2:
+        TrUpdateNode (PARSEOP_WORDCONST, Op);
+        Op->Asl.AmlOpcode = AML_RAW_DATA_WORD;
+        break;
+
+    case 4:
+        TrUpdateNode (PARSEOP_DWORDCONST, Op);
+        Op->Asl.AmlOpcode = AML_RAW_DATA_DWORD;
+        break;
+
+    case 8:
+        TrUpdateNode (PARSEOP_QWORDCONST, Op);
+        Op->Asl.AmlOpcode = AML_RAW_DATA_QWORD;
+        break;
+
+    case 0:
+    default:
+        OpcSetOptimalIntegerSize (Op);
+        TrUpdateNode (PARSEOP_INTEGER, Op);
+        break;
+    }
+
+    Op->Asl.AmlLength = 0;
+}
diff --git a/src/acpica/source/compiler/aslglobal.h b/src/acpica/source/compiler/aslglobal.h
index 5207f3b..9d285eb 100644
--- a/src/acpica/source/compiler/aslglobal.h
+++ b/src/acpica/source/compiler/aslglobal.h
@@ -1,5 +1,3 @@ 
-
-
 /******************************************************************************
  *
  * Module Name: aslglobal.h - Global variable definitions
@@ -10,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -33,7 +31,7 @@ 
  * 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
+ * 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
@@ -45,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -57,7 +55,7 @@ 
  * 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
+ * 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
@@ -82,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -94,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -121,7 +119,7 @@ 
 
 
 /*
- * Global variables.  Defined in aslmain.c only, externed in all other files
+ * Global variables. Defined in aslmain.c only, externed in all other files
  */
 
 #undef ASL_EXTERN
@@ -135,6 +133,42 @@ 
 #endif
 
 
+#ifdef _DECLARE_GLOBALS
+UINT32                              Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0};
+char                                AslHexLookup[] =
+{
+    '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
+};
+
+
+/* Table below must match ASL_FILE_TYPES in asltypes.h */
+
+ASL_FILE_INFO                       Gbl_Files [ASL_NUM_FILES] =
+{
+    {NULL, NULL, "stdout:       ", "Standard Output"},
+    {NULL, NULL, "stderr:       ", "Standard Error"},
+    {NULL, NULL, "Table Input:  ", "Source Input"},
+    {NULL, NULL, "Binary Output:", "AML Output"},
+    {NULL, NULL, "Source Output:", "Source Output"},
+    {NULL, NULL, "Preprocessor: ", "Preprocessor Output"},
+    {NULL, NULL, "Listing File: ", "Listing Output"},
+    {NULL, NULL, "Hex Dump:     ", "Hex Table Output"},
+    {NULL, NULL, "Namespace:    ", "Namespace Output"},
+    {NULL, NULL, "Debug File:   ", "Debug Output"},
+    {NULL, NULL, "ASM Source:   ", "Assembly Code Output"},
+    {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"}
+};
+
+#else
+extern UINT32                       Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS];
+extern char                         AslHexLookup[];
+extern ASL_FILE_INFO                Gbl_Files [ASL_NUM_FILES];
+#endif
+
+
 /*
  * Parser and other externals
  */
@@ -146,21 +180,22 @@  extern int                          PrParserdebug;
 extern const ASL_MAPPING_ENTRY      AslKeywordMapping[];
 extern char                         *AslCompilertext;
 
-#define ASL_LINE_BUFFER_SIZE        (4096 * 4) /* 16K */
-#define ASL_MSG_BUFFER_SIZE         4096
-#define HEX_TABLE_LINE_SIZE         8
-#define HEX_LISTING_LINE_SIZE       8
+#define ASL_DEFAULT_LINE_BUFFER_SIZE    (1024 * 32) /* 32K */
+#define ASL_MSG_BUFFER_SIZE             4096
+#define HEX_TABLE_LINE_SIZE             8
+#define HEX_LISTING_LINE_SIZE           8
 
 
 /* Source code buffers and pointers for error reporting */
 
-ASL_EXTERN char                     Gbl_CurrentLineBuffer[ASL_LINE_BUFFER_SIZE];
+ASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_CurrentLineBuffer, NULL);
+ASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_LineBufPtr, NULL);
+ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_LineBufferSize, ASL_DEFAULT_LINE_BUFFER_SIZE);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_CurrentColumn, 0);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_PreviousLineNumber, 0);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_CurrentLineNumber, 1);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_LogicalLineNumber, 1);
 ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_CurrentLineOffset, 0);
-ASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_LineBufPtr, Gbl_CurrentLineBuffer);
 
 /* Exception reporting */
 
@@ -175,13 +210,13 @@  ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_PreprocessOnly, FALSE);
 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_Acpi2, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, TRUE);
 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);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_AsmOutputFlag, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_C_OutputFlag, FALSE);
+ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_C_OffsetTableFlag, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_AsmIncludeOutputFlag, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_C_IncludeOutputFlag, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_ListingFlag, FALSE);
@@ -207,18 +242,16 @@  ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE);
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_CompileGeneric, FALSE);
 
 
-#define HEX_OUTPUT_NONE         0
-#define HEX_OUTPUT_C            1
-#define HEX_OUTPUT_ASM          2
-#define HEX_OUTPUT_ASL          3
+#define HEX_OUTPUT_NONE             0
+#define HEX_OUTPUT_C                1
+#define HEX_OUTPUT_ASM              2
+#define HEX_OUTPUT_ASL              3
 
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_HexOutputFlag, HEX_OUTPUT_NONE);
 
 
 /* Files */
 
-ASL_EXTERN ASL_FILE_INFO            Gbl_Files [ASL_NUM_FILES];
-
 ASL_EXTERN char                     *Gbl_DirectoryPath;
 ASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_IncludeFilename, NULL);
 ASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_OutputFilenamePrefix, NULL);
@@ -275,7 +308,6 @@  ASL_EXTERN FILE                     *AcpiGbl_DebugFile; /* Placeholder for oswin
 
 ASL_EXTERN ASL_ANALYSIS_WALK_INFO   AnalysisWalkInfo;
 ASL_EXTERN ACPI_TABLE_HEADER        TableHeader;
-extern char                         AslHexLookup[];
 
 /* Event timing */
 
@@ -292,11 +324,4 @@  ASL_EXTERN char                     StringBuffer[ASL_MSG_BUFFER_SIZE];
 ASL_EXTERN char                     StringBuffer2[ASL_MSG_BUFFER_SIZE];
 
 
-#ifdef _DECLARE_GLOBALS
-UINT32                              Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0};
-#else
-extern UINT32                       Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS];
-#endif
-
 #endif /* __ASLGLOBAL_H */
-
diff --git a/src/acpica/source/compiler/aslhex.c b/src/acpica/source/compiler/aslhex.c
new file mode 100644
index 0000000..d2e56ed
--- /dev/null
+++ b/src/acpica/source/compiler/aslhex.c
@@ -0,0 +1,473 @@ 
+/******************************************************************************
+ *
+ * Module Name: aslhex - ASCII hex output file generation (C, ASM, and ASL)
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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 "aslcompiler.h"
+
+#define _COMPONENT          ACPI_COMPILER
+        ACPI_MODULE_NAME    ("ashex")
+
+/*
+ * This module emits ASCII hex output files in either C, ASM, or ASL format
+ */
+
+
+/* Local prototypes */
+
+static void
+HxDoHexOutputC (
+    void);
+
+static void
+HxDoHexOutputAsl (
+    void);
+
+static void
+HxDoHexOutputAsm (
+    void);
+
+static UINT32
+HxReadAmlOutputFile (
+    UINT8                   *Buffer);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    HxDoHexOutput
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Create the hex output file. Note: data is obtained by reading
+ *              the entire AML output file that was previously generated.
+ *
+ ******************************************************************************/
+
+void
+HxDoHexOutput (
+    void)
+{
+
+    switch (Gbl_HexOutputFlag)
+    {
+    case HEX_OUTPUT_C:
+
+        HxDoHexOutputC ();
+        break;
+
+    case HEX_OUTPUT_ASM:
+
+        HxDoHexOutputAsm ();
+        break;
+
+    case HEX_OUTPUT_ASL:
+
+        HxDoHexOutputAsl ();
+        break;
+
+    default:
+        /* No other output types supported */
+        break;
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    HxReadAmlOutputFile
+ *
+ * PARAMETERS:  Buffer              - Where to return data
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Read a line of the AML output prior to formatting the data
+ *
+ ******************************************************************************/
+
+static UINT32
+HxReadAmlOutputFile (
+    UINT8                   *Buffer)
+{
+    UINT32                  Actual;
+
+
+    Actual = fread (Buffer, 1, HEX_TABLE_LINE_SIZE,
+        Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
+
+    if (ferror (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle))
+    {
+        FlFileError (ASL_FILE_AML_OUTPUT, ASL_MSG_READ);
+        AslAbort ();
+    }
+
+    return (Actual);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    HxDoHexOutputC
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Create the hex output file. This is the same data as the AML
+ *              output file, but formatted into hex/ascii bytes suitable for
+ *              inclusion into a C source file.
+ *
+ ******************************************************************************/
+
+static void
+HxDoHexOutputC (
+    void)
+{
+    UINT8                   FileData[HEX_TABLE_LINE_SIZE];
+    UINT32                  LineLength;
+    UINT32                  Offset = 0;
+    UINT32                  AmlFileSize;
+    UINT32                  i;
+
+
+    /* Get AML size, seek back to start */
+
+    AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT);
+    FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
+
+    FlPrintFile (ASL_FILE_HEX_OUTPUT, " * C source code output\n");
+    FlPrintFile (ASL_FILE_HEX_OUTPUT, " * AML code block contains 0x%X bytes\n *\n */\n",
+        AmlFileSize);
+    FlPrintFile (ASL_FILE_HEX_OUTPUT, "unsigned char AmlCode[] =\n{\n");
+
+    while (Offset < AmlFileSize)
+    {
+        /* Read enough bytes needed for one output line */
+
+        LineLength = HxReadAmlOutputFile (FileData);
+        if (!LineLength)
+        {
+            break;
+        }
+
+        FlPrintFile (ASL_FILE_HEX_OUTPUT, "    ");
+
+        for (i = 0; i < LineLength; i++)
+        {
+            /*
+             * Print each hex byte.
+             * Add a comma until the very last byte of the AML file
+             * (Some C compilers complain about a trailing comma)
+             */
+            FlPrintFile (ASL_FILE_HEX_OUTPUT, "0x%2.2X", FileData[i]);
+            if ((Offset + i + 1) < AmlFileSize)
+            {
+                FlPrintFile (ASL_FILE_HEX_OUTPUT, ",");
+            }
+            else
+            {
+                FlPrintFile (ASL_FILE_HEX_OUTPUT, " ");
+            }
+        }
+
+        /* Add fill spaces if needed for last line */
+
+        if (LineLength < HEX_TABLE_LINE_SIZE)
+        {
+            FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s",
+                5 * (HEX_TABLE_LINE_SIZE - LineLength), " ");
+        }
+
+        /* Emit the offset and ascii dump for the entire line */
+
+        FlPrintFile (ASL_FILE_HEX_OUTPUT, "  /* %8.8X", Offset);
+        LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData);
+        FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s*/\n",
+            HEX_TABLE_LINE_SIZE - LineLength + 1, " ");
+
+        Offset += LineLength;
+    }
+
+    FlPrintFile (ASL_FILE_HEX_OUTPUT, "};\n");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    HxDoHexOutputAsl
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Create the hex output file. This is the same data as the AML
+ *              output file, but formatted into hex/ascii bytes suitable for
+ *              inclusion into a C source file.
+ *
+ ******************************************************************************/
+
+static void
+HxDoHexOutputAsl (
+    void)
+{
+    UINT8                   FileData[HEX_TABLE_LINE_SIZE];
+    UINT32                  LineLength;
+    UINT32                  Offset = 0;
+    UINT32                  AmlFileSize;
+    UINT32                  i;
+
+
+    /* Get AML size, seek back to start */
+
+    AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT);
+    FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
+
+    FlPrintFile (ASL_FILE_HEX_OUTPUT, " * ASL source code output\n");
+    FlPrintFile (ASL_FILE_HEX_OUTPUT, " * AML code block contains 0x%X bytes\n *\n */\n",
+        AmlFileSize);
+    FlPrintFile (ASL_FILE_HEX_OUTPUT, "    Name (BUF1, Buffer()\n    {\n");
+
+    while (Offset < AmlFileSize)
+    {
+        /* Read enough bytes needed for one output line */
+
+        LineLength = HxReadAmlOutputFile (FileData);
+        if (!LineLength)
+        {
+            break;
+        }
+
+        FlPrintFile (ASL_FILE_HEX_OUTPUT, "        ");
+
+        for (i = 0; i < LineLength; i++)
+        {
+            /*
+             * Print each hex byte.
+             * Add a comma until the very last byte of the AML file
+             * (Some C compilers complain about a trailing comma)
+             */
+            FlPrintFile (ASL_FILE_HEX_OUTPUT, "0x%2.2X", FileData[i]);
+            if ((Offset + i + 1) < AmlFileSize)
+            {
+                FlPrintFile (ASL_FILE_HEX_OUTPUT, ",");
+            }
+            else
+            {
+                FlPrintFile (ASL_FILE_HEX_OUTPUT, " ");
+            }
+        }
+
+        /* Add fill spaces if needed for last line */
+
+        if (LineLength < HEX_TABLE_LINE_SIZE)
+        {
+            FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s",
+                5 * (HEX_TABLE_LINE_SIZE - LineLength), " ");
+        }
+
+        /* Emit the offset and ascii dump for the entire line */
+
+        FlPrintFile (ASL_FILE_HEX_OUTPUT, "  /* %8.8X", Offset);
+        LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData);
+        FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s*/\n",
+            HEX_TABLE_LINE_SIZE - LineLength + 1, " ");
+
+        Offset += LineLength;
+    }
+
+    FlPrintFile (ASL_FILE_HEX_OUTPUT, "    })\n");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    HxDoHexOutputAsm
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Create the hex output file. This is the same data as the AML
+ *              output file, but formatted into hex/ascii bytes suitable for
+ *              inclusion into a ASM source file.
+ *
+ ******************************************************************************/
+
+static void
+HxDoHexOutputAsm (
+    void)
+{
+    UINT8                   FileData[HEX_TABLE_LINE_SIZE];
+    UINT32                  LineLength;
+    UINT32                  Offset = 0;
+    UINT32                  AmlFileSize;
+    UINT32                  i;
+
+
+    /* Get AML size, seek back to start */
+
+    AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT);
+    FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
+
+    FlPrintFile (ASL_FILE_HEX_OUTPUT, "; Assembly code source output\n");
+    FlPrintFile (ASL_FILE_HEX_OUTPUT, "; AML code block contains 0x%X bytes\n;\n",
+        AmlFileSize);
+
+    while (Offset < AmlFileSize)
+    {
+        /* Read enough bytes needed for one output line */
+
+        LineLength = HxReadAmlOutputFile (FileData);
+        if (!LineLength)
+        {
+            break;
+        }
+
+        FlPrintFile (ASL_FILE_HEX_OUTPUT, "  db  ");
+
+        for (i = 0; i < LineLength; i++)
+        {
+            /*
+             * Print each hex byte.
+             * Add a comma until the last byte of the line
+             */
+            FlPrintFile (ASL_FILE_HEX_OUTPUT, "0%2.2Xh", FileData[i]);
+            if ((i + 1) < LineLength)
+            {
+                FlPrintFile (ASL_FILE_HEX_OUTPUT, ",");
+            }
+        }
+
+        FlPrintFile (ASL_FILE_HEX_OUTPUT, " ");
+
+        /* Add fill spaces if needed for last line */
+
+        if (LineLength < HEX_TABLE_LINE_SIZE)
+        {
+            FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s",
+                5 * (HEX_TABLE_LINE_SIZE - LineLength), " ");
+        }
+
+        /* Emit the offset and ascii dump for the entire line */
+
+        FlPrintFile (ASL_FILE_HEX_OUTPUT, "  ; %8.8X", Offset);
+        LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData);
+        FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n");
+
+        Offset += LineLength;
+    }
+
+    FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n");
+}
diff --git a/src/acpica/source/compiler/asllength.c b/src/acpica/source/compiler/asllength.c
index 7b13669..78372f1 100644
--- a/src/acpica/source/compiler/asllength.c
+++ b/src/acpica/source/compiler/asllength.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: asllength - Tree walk to determine package and opcode lengths
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -152,7 +151,7 @@  LnAdjustLengthToRoot (
  * RETURN:      Status
  *
  * DESCRIPTION: Walk callback to initialize (and re-initialize) the node
- *              subtree length(s) to zero.  The Subtree lengths are bubbled
+ *              subtree length(s) to zero. The Subtree lengths are bubbled
  *              up to the root node in order to get a total AML length.
  *
  ******************************************************************************/
@@ -184,7 +183,7 @@  LnInitLengthsWalk (
  *                 them all into the parent subtree length.
  *
  * Note:  The SubtreeLength represents the total AML length of all child nodes
- *        in all subtrees under a given node.  Therefore, once this walk is
+ *        in all subtrees under a given node. Therefore, once this walk is
  *        complete, the Root Node subtree length is the AML length of the entire
  *        tree (and thus, the entire ACPI table)
  *
@@ -498,7 +497,7 @@  CgGenerateAmlLengths (
  * RETURN:      None.
  *
  * DESCRIPTION: Change the Subtree length of the given node, and bubble the
- *              change all the way up to the root node.  This allows for
+ *              change all the way up to the root node. This allows for
  *              last second changes to a package length (for example, if the
  *              package length encoding gets shorter or longer.)
  *
@@ -526,5 +525,3 @@  LnAdjustLengthToRoot (
     Gbl_TableLength -= LengthDelta;
 }
 #endif
-
-
diff --git a/src/acpica/source/compiler/asllisting.c b/src/acpica/source/compiler/asllisting.c
index 7cb00d1..ba73b28 100644
--- a/src/acpica/source/compiler/asllisting.c
+++ b/src/acpica/source/compiler/asllisting.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: asllisting - Listing file generation
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -114,338 +113,50 @@ 
  *
  *****************************************************************************/
 
-
 #include "aslcompiler.h"
 #include "aslcompiler.y.h"
 #include "amlcode.h"
 #include "acparser.h"
 #include "acnamesp.h"
 
-#define _COMPONENT          ACPI_COMPILER
-        ACPI_MODULE_NAME    ("aslisting")
-
-/* Local prototypes */
 
-static void
-LsDumpAscii (
-    UINT32                  FileId,
-    UINT32                  Count,
-    UINT8                   *Buffer);
+#define _COMPONENT          ACPI_COMPILER
+        ACPI_MODULE_NAME    ("asllisting")
 
-static void
-LsDumpAsciiInComment (
-    UINT32                  FileId,
-    UINT32                  Count,
-    UINT8                   *Buffer);
 
-static ACPI_STATUS
-LsAmlListingWalk (
-    ACPI_PARSE_OBJECT       *Op,
-    UINT32                  Level,
-    void                    *Context);
+/* Local prototypes */
 
 static void
 LsGenerateListing (
     UINT32                  FileId);
 
-static void
-LsPushNode (
-    char                    *Filename);
-
-static ASL_LISTING_NODE *
-LsPopNode (
-    void);
-
-static void
-LsCheckException (
-    UINT32                  LineNumber,
-    UINT32                  FileId);
-
-static void
-LsFlushListingBuffer (
-    UINT32                  FileId);
-
-static void
-LsWriteListingHexBytes (
-    UINT8                   *Buffer,
-    UINT32                  Length,
-    UINT32                  FileId);
-
-static UINT32
-LsWriteOneSourceLine (
-    UINT32                  FileId);
-
-static void
-LsFinishSourceListing (
-    UINT32                  FileId);
-
-static void
-LsWriteSourceLines (
-    UINT32                  ToLineNumber,
-    UINT32                  ToLogicalLineNumber,
-    UINT32                  FileId);
-
-static void
-LsWriteNodeToListing (
-    ACPI_PARSE_OBJECT       *Op,
-    UINT32                  FileId);
-
-static void
-LsDoHexOutputC (
-    void);
-
-static void
-LsDoHexOutputAsm (
-    void);
-
-static void
-LsDoHexOutputAsl (
-    void);
-
 static ACPI_STATUS
-LsTreeWriteWalk (
+LsAmlListingWalk (
     ACPI_PARSE_OBJECT       *Op,
     UINT32                  Level,
     void                    *Context);
 
-
-/*******************************************************************************
- *
- * FUNCTION:    LsTreeWriteWalk
- *
- * PARAMETERS:  ASL_WALK_CALLBACK
- *
- *
- * RETURN:      None.
- *
- * DESCRIPTION: Dump entire parse tree, for compiler debug only
- *
- ******************************************************************************/
-
 static ACPI_STATUS
 LsTreeWriteWalk (
     ACPI_PARSE_OBJECT       *Op,
     UINT32                  Level,
-    void                    *Context)
-{
-
-    /* Debug output */
-
-    DbgPrint (ASL_TREE_OUTPUT,
-        "%5.5d [%2d]", Op->Asl.LogicalLineNumber, Level);
-    UtPrintFormattedName (Op->Asl.ParseOpcode, Level);
-
-
-    DbgPrint (ASL_TREE_OUTPUT, "\n");
-    return (AE_OK);
-}
-
-
-void
-LsDumpParseTree (
-    void)
-{
-
-    if (!Gbl_DebugFlag)
-    {
-        return;
-    }
-
-    DbgPrint (ASL_TREE_OUTPUT, "\nOriginal parse tree from parser:\n\n");
-    TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
-        LsTreeWriteWalk, NULL, NULL);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LsDumpAscii
- *
- * PARAMETERS:  FileId          - ID of current listing file
- *              Count           - Number of bytes to convert
- *              Buffer          - Buffer of bytes to convert
- *
- * RETURN:      None.
- *
- * DESCRIPTION: Convert hex bytes to ascii
- *
- ******************************************************************************/
-
-static void
-LsDumpAscii (
-    UINT32                  FileId,
-    UINT32                  Count,
-    UINT8                   *Buffer)
-{
-    UINT8                   BufChar;
-    UINT32                  i;
-
-
-    FlPrintFile (FileId, "    \"");
-    for (i = 0; i < Count; i++)
-    {
-        BufChar = Buffer[i];
-        if (isprint (BufChar))
-        {
-            FlPrintFile (FileId, "%c", BufChar);
-        }
-        else
-        {
-            /* Not a printable character, just put out a dot */
-
-            FlPrintFile (FileId, ".");
-        }
-    }
-    FlPrintFile (FileId, "\"");
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LsDumpAsciiInComment
- *
- * PARAMETERS:  FileId          - ID of current listing file
- *              Count           - Number of bytes to convert
- *              Buffer          - Buffer of bytes to convert
- *
- * RETURN:      None.
- *
- * DESCRIPTION: Convert hex bytes to ascii
- *
- ******************************************************************************/
+    void                    *Context);
 
 static void
-LsDumpAsciiInComment (
-    UINT32                  FileId,
-    UINT32                  Count,
-    UINT8                   *Buffer)
-{
-    UINT8                   BufChar = 0;
-    UINT8                   LastChar;
-    UINT32                  i;
-
-
-    FlPrintFile (FileId, "    \"");
-    for (i = 0; i < Count; i++)
-    {
-        LastChar = BufChar;
-        BufChar = Buffer[i];
-
-        if (isprint (BufChar))
-        {
-            /* Handle embedded C comment sequences */
-
-            if (((LastChar == '*') && (BufChar == '/')) ||
-                ((LastChar == '/') && (BufChar == '*')))
-            {
-                /* Insert a space to break the sequence */
-
-                FlPrintFile (FileId, ".", BufChar);
-            }
-
-            FlPrintFile (FileId, "%c", BufChar);
-        }
-        else
-        {
-            /* Not a printable character, just put out a dot */
-
-            FlPrintFile (FileId, ".");
-        }
-    }
-    FlPrintFile (FileId, "\"");
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LsAmlListingWalk
- *
- * PARAMETERS:  ASL_WALK_CALLBACK
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Process one node during a listing file generation.
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-LsAmlListingWalk (
+LsWriteNodeToListing (
     ACPI_PARSE_OBJECT       *Op,
-    UINT32                  Level,
-    void                    *Context)
-{
-    UINT8                   FileByte;
-    UINT32                  i;
-    UINT32                  FileId = (UINT32) ACPI_TO_INTEGER (Context);
-
-
-    LsWriteNodeToListing (Op, FileId);
-
-    if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DATA)
-    {
-        /* Buffer is a resource template, don't dump the data all at once */
-
-        return (AE_OK);
-    }
-
-    /* Write the hex bytes to the listing file(s) (if requested) */
-
-    for (i = 0; i < Op->Asl.FinalAmlLength; i++)
-    {
-        if (ACPI_FAILURE (FlReadFile (ASL_FILE_AML_OUTPUT, &FileByte, 1)))
-        {
-            FlFileError (ASL_FILE_AML_OUTPUT, ASL_MSG_READ);
-            AslAbort ();
-        }
-        LsWriteListingHexBytes (&FileByte, 1, FileId);
-    }
-
-    return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LsGenerateListing
- *
- * PARAMETERS:  FileId      - ID of listing file
- *
- * RETURN:      None
- *
- * DESCRIPTION: Generate a listing file.  This can be one of the several types
- *              of "listings" supported.
- *
- ******************************************************************************/
+    UINT32                  FileId);
 
 static void
-LsGenerateListing (
-    UINT32                  FileId)
-{
-
-    /* Start at the beginning of both the source and AML files */
-
-    FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0);
-    FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
-    Gbl_SourceLine = 0;
-    Gbl_CurrentHexColumn = 0;
-    LsPushNode (Gbl_Files[ASL_FILE_INPUT].Filename);
-
-    /* Process all parse nodes */
-
-    TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, LsAmlListingWalk,
-                        NULL, (void *) ACPI_TO_POINTER (FileId));
-
-    /* Final processing */
-
-    LsFinishSourceListing (FileId);
-}
+LsFinishSourceListing (
+    UINT32                  FileId);
 
 
 /*******************************************************************************
  *
  * FUNCTION:    LsDoListings
  *
- * PARAMETERS:  None.
+ * PARAMETERS:  None. Examines the various output file global flags.
  *
  * RETURN:      None
  *
@@ -482,521 +193,154 @@  LsDoListings (
     {
         LsGenerateListing (ASL_FILE_ASM_INCLUDE_OUTPUT);
     }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LsPushNode
- *
- * PARAMETERS:  Filename        - Pointer to the include filename
- *
- * RETURN:      None
- *
- * DESCRIPTION: Push a listing node on the listing/include file stack.  This
- *              stack enables tracking of include files (infinitely nested)
- *              and resumption of the listing of the parent file when the
- *              include file is finished.
- *
- ******************************************************************************/
-
-static void
-LsPushNode (
-    char                    *Filename)
-{
-    ASL_LISTING_NODE        *Lnode;
-
-
-    /* Create a new node */
-
-    Lnode = UtLocalCalloc (sizeof (ASL_LISTING_NODE));
-
-    /* Initialize */
-
-    Lnode->Filename = Filename;
-    Lnode->LineNumber = 0;
-
-    /* Link (push) */
-
-    Lnode->Next = Gbl_ListingNode;
-    Gbl_ListingNode = Lnode;
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LsPopNode
- *
- * PARAMETERS:  None
- *
- * RETURN:      List head after current head is popped off
- *
- * DESCRIPTION: Pop the current head of the list, free it, and return the
- *              next node on the stack (the new current node).
- *
- ******************************************************************************/
-
-static ASL_LISTING_NODE *
-LsPopNode (
-    void)
-{
-    ASL_LISTING_NODE        *Lnode;
-
-
-    /* Just grab the node at the head of the list */
-
-    Lnode = Gbl_ListingNode;
-    if ((!Lnode) ||
-        (!Lnode->Next))
-    {
-        AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, NULL,
-            "Could not pop empty listing stack");
-        return Gbl_ListingNode;
-    }
-
-    Gbl_ListingNode = Lnode->Next;
-    ACPI_FREE (Lnode);
-
-    /* New "Current" node is the new head */
-
-    return (Gbl_ListingNode);
-}
 
-
-/*******************************************************************************
- *
- * FUNCTION:    LsCheckException
- *
- * PARAMETERS:  LineNumber          - Current logical (cumulative) line #
- *              FileId              - ID of output listing file
- *
- * RETURN:      None
- *
- * DESCRIPTION: Check if there is an exception for this line, and if there is,
- *              put it in the listing immediately.  Handles multiple errors
- *              per line.  Gbl_NextError points to the next error in the
- *              sorted (by line #) list of compile errors/warnings.
- *
- ******************************************************************************/
-
-static void
-LsCheckException (
-    UINT32                  LineNumber,
-    UINT32                  FileId)
-{
-
-    if ((!Gbl_NextError) ||
-        (LineNumber < Gbl_NextError->LogicalLineNumber ))
+    if (Gbl_C_OffsetTableFlag)
     {
-        return;
-    }
-
-    /* Handle multiple errors per line */
-
-    if (FileId == ASL_FILE_LISTING_OUTPUT)
-    {
-        while (Gbl_NextError &&
-              (LineNumber >= Gbl_NextError->LogicalLineNumber))
-        {
-            AePrintException (FileId, Gbl_NextError, "\n[****iasl****]\n");
-
-            Gbl_NextError = Gbl_NextError->Next;
-        }
-
-        FlPrintFile (FileId, "\n");
+        LsGenerateListing (ASL_FILE_C_OFFSET_OUTPUT);
     }
 }
 
 
 /*******************************************************************************
  *
- * FUNCTION:    LsFlushListingBuffer
+ * FUNCTION:    LsGenerateListing
  *
- * PARAMETERS:  FileId          - ID of the listing file
+ * PARAMETERS:  FileId      - ID of listing file
  *
  * RETURN:      None
  *
- * DESCRIPTION: Flush out the current contents of the 16-byte hex AML code
- *              buffer.  Usually called at the termination of a single line
- *              of source code or when the buffer is full.
+ * DESCRIPTION: Generate a listing file. This can be one of the several types
+ *              of "listings" supported.
  *
  ******************************************************************************/
 
 static void
-LsFlushListingBuffer (
+LsGenerateListing (
     UINT32                  FileId)
 {
-    UINT32                  i;
-
-
-    if (Gbl_CurrentHexColumn == 0)
-    {
-        return;
-    }
-
-    /* Write the hex bytes */
-
-    switch (FileId)
-    {
-    case ASL_FILE_LISTING_OUTPUT:
-
-        for (i = 0; i < Gbl_CurrentHexColumn; i++)
-        {
-            FlPrintFile (FileId, "%2.2X ", Gbl_AmlBuffer[i]);
-        }
-
-        for (i = 0; i < ((HEX_LISTING_LINE_SIZE - Gbl_CurrentHexColumn) * 3); i++)
-        {
-            FlWriteFile (FileId, ".", 1);
-        }
-
-        /* Write the ASCII character associated with each of the bytes */
-
-        LsDumpAscii (FileId, Gbl_CurrentHexColumn, Gbl_AmlBuffer);
-        break;
-
-
-    case ASL_FILE_ASM_SOURCE_OUTPUT:
-
-        for (i = 0; i < Gbl_CurrentHexColumn; i++)
-        {
-            if (i > 0)
-            {
-                FlPrintFile (FileId, ",");
-            }
-            FlPrintFile (FileId, "0%2.2Xh", Gbl_AmlBuffer[i]);
-        }
-
-        for (i = 0; i < ((HEX_LISTING_LINE_SIZE - Gbl_CurrentHexColumn) * 5); i++)
-        {
-            FlWriteFile (FileId, " ", 1);
-        }
-
-        FlPrintFile (FileId, "  ;%8.8X",
-            Gbl_CurrentAmlOffset - HEX_LISTING_LINE_SIZE);
 
-        /* Write the ASCII character associated with each of the bytes */
-
-        LsDumpAscii (FileId, Gbl_CurrentHexColumn, Gbl_AmlBuffer);
-        break;
-
-
-    case ASL_FILE_C_SOURCE_OUTPUT:
-
-        for (i = 0; i < Gbl_CurrentHexColumn; i++)
-        {
-            FlPrintFile (FileId, "0x%2.2X,", Gbl_AmlBuffer[i]);
-        }
-
-        for (i = 0; i < ((HEX_LISTING_LINE_SIZE - Gbl_CurrentHexColumn) * 5); i++)
-        {
-            FlWriteFile (FileId, " ", 1);
-        }
-
-        FlPrintFile (FileId, "    /* %8.8X",
-            Gbl_CurrentAmlOffset - HEX_LISTING_LINE_SIZE);
-
-        /* Write the ASCII character associated with each of the bytes */
-
-        LsDumpAsciiInComment (FileId, Gbl_CurrentHexColumn, Gbl_AmlBuffer);
-        FlPrintFile (FileId, " */");
-        break;
-
-    default:
-        /* No other types supported */
-        return;
-    }
-
-    FlPrintFile (FileId, "\n");
+    /* Start at the beginning of both the source and AML files */
 
+    FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0);
+    FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
+    Gbl_SourceLine = 0;
     Gbl_CurrentHexColumn = 0;
-    Gbl_HexBytesWereWritten = TRUE;
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LsWriteListingHexBytes
- *
- * PARAMETERS:  Buffer          - AML code buffer
- *              Length          - Number of AML bytes to write
- *              FileId          - ID of current listing file.
- *
- * RETURN:      None
- *
- * DESCRIPTION: Write the contents of the AML buffer to the listing file via
- *              the listing buffer.  The listing buffer is flushed every 16
- *              AML bytes.
- *
- ******************************************************************************/
-
-static void
-LsWriteListingHexBytes (
-    UINT8                   *Buffer,
-    UINT32                  Length,
-    UINT32                  FileId)
-{
-    UINT32                  i;
-
-
-    /* Transfer all requested bytes */
-
-    for (i = 0; i < Length; i++)
-    {
-        /* Print line header when buffer is empty */
-
-        if (Gbl_CurrentHexColumn == 0)
-        {
-            if (Gbl_HasIncludeFiles)
-            {
-                FlPrintFile (FileId, "%*s", 10, " ");
-            }
-
-            switch (FileId)
-            {
-            case ASL_FILE_LISTING_OUTPUT:
-
-                FlPrintFile (FileId, "%8.8X....", Gbl_CurrentAmlOffset);
-                break;
-
-            case ASL_FILE_ASM_SOURCE_OUTPUT:
-
-                FlPrintFile (FileId, "    db ");
-                break;
-
-            case ASL_FILE_C_SOURCE_OUTPUT:
-
-                FlPrintFile (FileId, "        ");
-                break;
-
-            default:
-                /* No other types supported */
-                return;
-            }
-        }
-
-        /* Transfer AML byte and update counts */
-
-        Gbl_AmlBuffer[Gbl_CurrentHexColumn] = Buffer[i];
-
-        Gbl_CurrentHexColumn++;
-        Gbl_CurrentAmlOffset++;
-
-        /* Flush buffer when it is full */
-
-        if (Gbl_CurrentHexColumn >= HEX_LISTING_LINE_SIZE)
-        {
-            LsFlushListingBuffer (FileId);
-        }
-    }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LsWriteOneSourceLine
- *
- * PARAMETERS:  FileID          - ID of current listing file
- *
- * RETURN:      FALSE on EOF (input source file), TRUE otherwise
- *
- * DESCRIPTION: Read one line from the input source file and echo it to the
- *              listing file, prefixed with the line number, and if the source
- *              file contains include files, prefixed with the current filename
- *
- ******************************************************************************/
-
-static UINT32
-LsWriteOneSourceLine (
-    UINT32                  FileId)
-{
-    UINT8                   FileByte;
-
-
-    Gbl_SourceLine++;
-    Gbl_ListingNode->LineNumber++;
+    LsPushNode (Gbl_Files[ASL_FILE_INPUT].Filename);
 
-    if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
+    if (FileId == ASL_FILE_C_OFFSET_OUTPUT)
     {
-        FlPrintFile (FileId, "     *");
-    }
-    if (FileId == ASL_FILE_ASM_SOURCE_OUTPUT)
-    {
-        FlPrintFile (FileId, "; ");
-    }
+        /* Offset table file has a special header and footer */
 
-    if (Gbl_HasIncludeFiles)
-    {
-        /*
-         * This file contains "include" statements, print the current
-         * filename and line number within the current file
-         */
-        FlPrintFile (FileId, "%12s %5d....",
-                    Gbl_ListingNode->Filename, Gbl_ListingNode->LineNumber);
-    }
-    else
-    {
-        /* No include files, just print the line number */
+        LsDoOffsetTableHeader (FileId);
 
-        FlPrintFile (FileId, "%8d....", Gbl_SourceLine);
+        TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, LsAmlOffsetWalk,
+            NULL, (void *) ACPI_TO_POINTER (FileId));
+        LsDoOffsetTableFooter (FileId);
+        return;
     }
 
-    /* Read one line (up to a newline or EOF) */
-
-    while (FlReadFile (ASL_FILE_SOURCE_OUTPUT, &FileByte, 1) == AE_OK)
-    {
-        if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
-        {
-            if (FileByte == '/')
-            {
-                FileByte = '*';
-            }
-        }
+    /* Process all parse nodes */
 
-        FlWriteFile (FileId, &FileByte, 1);
-        if (FileByte == '\n')
-        {
-            /*
-             * Check if an error occurred on this source line during the compile.
-             * If so, we print the error message after the source line.
-             */
-            LsCheckException (Gbl_SourceLine, FileId);
-            return (1);
-        }
-    }
+    TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, LsAmlListingWalk,
+        NULL, (void *) ACPI_TO_POINTER (FileId));
 
-    /* EOF on the input file was reached */
+    /* Final processing */
 
-    return (0);
+    LsFinishSourceListing (FileId);
 }
 
 
 /*******************************************************************************
  *
- * FUNCTION:    LsFinishSourceListing
+ * FUNCTION:    LsAmlListingWalk
  *
- * PARAMETERS:  FileId          - ID of current listing file.
+ * PARAMETERS:  ASL_WALK_CALLBACK
  *
- * RETURN:      None
+ * RETURN:      Status
  *
- * DESCRIPTION: Cleanup routine for the listing file.  Flush the hex AML
- *              listing buffer, and flush out any remaining lines in the
- *              source input file.
+ * DESCRIPTION: Process one node during a listing file generation.
  *
  ******************************************************************************/
 
-static void
-LsFinishSourceListing (
-    UINT32                  FileId)
-{
-
-    if ((FileId == ASL_FILE_ASM_INCLUDE_OUTPUT) ||
-        (FileId == ASL_FILE_C_INCLUDE_OUTPUT))
-    {
-        return;
-    }
-
-    LsFlushListingBuffer (FileId);
-    Gbl_CurrentAmlOffset = 0;
-
-    /* Flush any remaining text in the source file */
+static ACPI_STATUS
+LsAmlListingWalk (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context)
+{
+    UINT8                   FileByte;
+    UINT32                  i;
+    UINT32                  FileId = (UINT32) ACPI_TO_INTEGER (Context);
 
-    if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
-    {
-        FlPrintFile (FileId, "    /*\n");
-    }
 
-    while (LsWriteOneSourceLine (FileId))
-    { ; }
+    LsWriteNodeToListing (Op, FileId);
 
-    if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
+    if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DATA)
     {
-        FlPrintFile (FileId, "\n     */\n    };\n");
+        /* Buffer is a resource template, don't dump the data all at once */
+
+        return (AE_OK);
     }
 
-    FlPrintFile (FileId, "\n");
+    /* Write the hex bytes to the listing file(s) (if requested) */
 
-    if (FileId == ASL_FILE_LISTING_OUTPUT)
+    for (i = 0; i < Op->Asl.FinalAmlLength; i++)
     {
-        /* Print a summary of the compile exceptions */
-
-        FlPrintFile (FileId, "\n\nSummary of errors and warnings\n\n");
-        AePrintErrorLog (FileId);
-        FlPrintFile (FileId, "\n");
-        UtDisplaySummary (FileId);
-        FlPrintFile (FileId, "\n");
+        if (ACPI_FAILURE (FlReadFile (ASL_FILE_AML_OUTPUT, &FileByte, 1)))
+        {
+            FlFileError (ASL_FILE_AML_OUTPUT, ASL_MSG_READ);
+            AslAbort ();
+        }
+        LsWriteListingHexBytes (&FileByte, 1, FileId);
     }
+
+    return (AE_OK);
 }
 
 
 /*******************************************************************************
  *
- * FUNCTION:    LsWriteSourceLines
+ * FUNCTION:    LsDumpParseTree, LsTreeWriteWalk
  *
- * PARAMETERS:  ToLineNumber            -
- *              ToLogicalLineNumber     - Write up to this source line number
- *              FileId                  - ID of current listing file
+ * PARAMETERS:  None
  *
  * RETURN:      None
  *
- * DESCRIPTION: Read then write source lines to the listing file until we have
- *              reached the specified logical (cumulative) line number.  This
- *              automatically echos out comment blocks and other non-AML
- *              generating text until we get to the actual AML-generating line
- *              of ASL code specified by the logical line number.
+ * DESCRIPTION: Dump entire parse tree, for compiler debug only
  *
  ******************************************************************************/
 
-static void
-LsWriteSourceLines (
-    UINT32                  ToLineNumber,
-    UINT32                  ToLogicalLineNumber,
-    UINT32                  FileId)
+void
+LsDumpParseTree (
+    void)
 {
 
-    if ((FileId == ASL_FILE_ASM_INCLUDE_OUTPUT) ||
-        (FileId == ASL_FILE_C_INCLUDE_OUTPUT))
+    if (!Gbl_DebugFlag)
     {
         return;
     }
 
-    Gbl_CurrentLine = ToLogicalLineNumber;
-
-    /* Flush any hex bytes remaining from the last opcode */
-
-    LsFlushListingBuffer (FileId);
-
-    /* Read lines and write them as long as we are not caught up */
+    DbgPrint (ASL_TREE_OUTPUT, "\nOriginal parse tree from parser:\n\n");
+    TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
+        LsTreeWriteWalk, NULL, NULL);
+}
 
-    if (Gbl_SourceLine < Gbl_CurrentLine)
-    {
-        /*
-         * If we just completed writing some AML hex bytes, output a linefeed
-         * to add some whitespace for readability.
-         */
-        if (Gbl_HexBytesWereWritten)
-        {
-            FlPrintFile (FileId, "\n");
-            Gbl_HexBytesWereWritten = FALSE;
-        }
 
-        if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
-        {
-            FlPrintFile (FileId, "    /*\n");
-        }
+static ACPI_STATUS
+LsTreeWriteWalk (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context)
+{
 
-        /* Write one line at a time until we have reached the target line # */
+    /* Debug output */
 
-        while ((Gbl_SourceLine < Gbl_CurrentLine) &&
-                LsWriteOneSourceLine (FileId))
-        { ; }
+    DbgPrint (ASL_TREE_OUTPUT,
+        "%5.5d [%2d]", Op->Asl.LogicalLineNumber, Level);
+    UtPrintFormattedName (Op->Asl.ParseOpcode, Level);
 
-        if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
-        {
-            FlPrintFile (FileId, "     */");
-        }
-        FlPrintFile (FileId, "\n");
-    }
+    DbgPrint (ASL_TREE_OUTPUT, "\n");
+    return (AE_OK);
 }
 
 
@@ -1004,12 +348,12 @@  LsWriteSourceLines (
  *
  * FUNCTION:    LsWriteNodeToListing
  *
- * PARAMETERS:  Op            - Parse node to write to the listing file.
+ * PARAMETERS:  Op              - Parse node to write to the listing file.
  *              FileId          - ID of current listing file
  *
  * RETURN:      None.
  *
- * DESCRIPTION: Write "a node" to the listing file.  This means to
+ * DESCRIPTION: Write "a node" to the listing file. This means to
  *              1) Write out all of the source text associated with the node
  *              2) Write out all of the AML bytes associated with the node
  *              3) Write any compiler exceptions associated with the node
@@ -1314,301 +658,57 @@  LsWriteNodeToListing (
 
 /*******************************************************************************
  *
- * FUNCTION:    LsDoHexOutput
+ * FUNCTION:    LsFinishSourceListing
  *
- * PARAMETERS:  None
+ * PARAMETERS:  FileId          - ID of current listing file.
  *
- * RETURN:      None.
+ * RETURN:      None
  *
- * DESCRIPTION: Create the hex output file.
+ * DESCRIPTION: Cleanup routine for the listing file. Flush the hex AML
+ *              listing buffer, and flush out any remaining lines in the
+ *              source input file.
  *
  ******************************************************************************/
 
-void
-LsDoHexOutput (
-    void)
+static void
+LsFinishSourceListing (
+    UINT32                  FileId)
 {
 
-    switch (Gbl_HexOutputFlag)
+    if ((FileId == ASL_FILE_ASM_INCLUDE_OUTPUT) ||
+        (FileId == ASL_FILE_C_INCLUDE_OUTPUT))
     {
-    case HEX_OUTPUT_C:
-
-        LsDoHexOutputC ();
-        break;
-
-    case HEX_OUTPUT_ASM:
-
-        LsDoHexOutputAsm ();
-        break;
-
-    case HEX_OUTPUT_ASL:
-
-        LsDoHexOutputAsl ();
-        break;
-
-    default:
-        /* No other output types supported */
-        break;
+        return;
     }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LsDoHexOutputC
- *
- * PARAMETERS:  None
- *
- * RETURN:      None.
- *
- * DESCRIPTION: Create the hex output file.  This is the same data as the AML
- *              output file, but formatted into hex/ascii bytes suitable for
- *              inclusion into a C source file.
- *
- ******************************************************************************/
-
-static void
-LsDoHexOutputC (
-    void)
-{
-    UINT8                   FileData[HEX_TABLE_LINE_SIZE];
-    UINT32                  LineLength;
-    UINT32                  Offset = 0;
-    UINT32                  AmlFileSize;
-    UINT32                  i;
-
-
-    /* Get AML size, seek back to start */
 
-    AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT);
-    FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
+    LsFlushListingBuffer (FileId);
+    Gbl_CurrentAmlOffset = 0;
 
-    FlPrintFile (ASL_FILE_HEX_OUTPUT, " * C source code output\n");
-    FlPrintFile (ASL_FILE_HEX_OUTPUT, " * AML code block contains 0x%X bytes\n *\n */\n",
-        AmlFileSize);
-    FlPrintFile (ASL_FILE_HEX_OUTPUT, "unsigned char AmlCode[] =\n{\n");
+    /* Flush any remaining text in the source file */
 
-    while (Offset < AmlFileSize)
+    if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
     {
-        /* Read enough bytes needed for one output line */
-
-        LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE,
-                        Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
-        if (!LineLength)
-        {
-            break;
-        }
-
-        FlPrintFile (ASL_FILE_HEX_OUTPUT, "    ");
-
-        for (i = 0; i < LineLength; i++)
-        {
-            /*
-             * Print each hex byte.
-             * Add a comma until the very last byte of the AML file
-             * (Some C compilers complain about a trailing comma)
-             */
-            FlPrintFile (ASL_FILE_HEX_OUTPUT, "0x%2.2X", FileData[i]);
-            if ((Offset + i + 1) < AmlFileSize)
-            {
-                FlPrintFile (ASL_FILE_HEX_OUTPUT, ",");
-            }
-            else
-            {
-                FlPrintFile (ASL_FILE_HEX_OUTPUT, " ");
-            }
-        }
-
-        /* Add fill spaces if needed for last line */
-
-        if (LineLength < HEX_TABLE_LINE_SIZE)
-        {
-            FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s",
-                5 * (HEX_TABLE_LINE_SIZE - LineLength), " ");
-        }
-
-        /* Emit the offset and ascii dump for the entire line */
-
-        FlPrintFile (ASL_FILE_HEX_OUTPUT, "  /* %8.8X", Offset);
-        LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData);
-        FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s*/\n",
-            HEX_TABLE_LINE_SIZE - LineLength + 1, " ");
-
-        Offset += LineLength;
+        FlPrintFile (FileId, "    /*\n");
     }
 
-    FlPrintFile (ASL_FILE_HEX_OUTPUT, "};\n");
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LsDoHexOutputAsl
- *
- * PARAMETERS:  None
- *
- * RETURN:      None.
- *
- * DESCRIPTION: Create the hex output file.  This is the same data as the AML
- *              output file, but formatted into hex/ascii bytes suitable for
- *              inclusion into a C source file.
- *
- ******************************************************************************/
-
-static void
-LsDoHexOutputAsl (
-    void)
-{
-    UINT8                   FileData[HEX_TABLE_LINE_SIZE];
-    UINT32                  LineLength;
-    UINT32                  Offset = 0;
-    UINT32                  AmlFileSize;
-    UINT32                  i;
-
-
-    /* Get AML size, seek back to start */
-
-    AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT);
-    FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
-
-    FlPrintFile (ASL_FILE_HEX_OUTPUT, " * ASL source code output\n");
-    FlPrintFile (ASL_FILE_HEX_OUTPUT, " * AML code block contains 0x%X bytes\n *\n */\n",
-        AmlFileSize);
-    FlPrintFile (ASL_FILE_HEX_OUTPUT, "    Name (BUF1, Buffer()\n    {\n");
+    while (LsWriteOneSourceLine (FileId))
+    { ; }
 
-    while (Offset < AmlFileSize)
+    if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
     {
-        /* Read enough bytes needed for one output line */
-
-        LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE,
-                        Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
-        if (!LineLength)
-        {
-            break;
-        }
-
-        FlPrintFile (ASL_FILE_HEX_OUTPUT, "        ");
-
-        for (i = 0; i < LineLength; i++)
-        {
-            /*
-             * Print each hex byte.
-             * Add a comma until the very last byte of the AML file
-             * (Some C compilers complain about a trailing comma)
-             */
-            FlPrintFile (ASL_FILE_HEX_OUTPUT, "0x%2.2X", FileData[i]);
-            if ((Offset + i + 1) < AmlFileSize)
-            {
-                FlPrintFile (ASL_FILE_HEX_OUTPUT, ",");
-            }
-            else
-            {
-                FlPrintFile (ASL_FILE_HEX_OUTPUT, " ");
-            }
-        }
-
-        /* Add fill spaces if needed for last line */
-
-        if (LineLength < HEX_TABLE_LINE_SIZE)
-        {
-            FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s",
-                5 * (HEX_TABLE_LINE_SIZE - LineLength), " ");
-        }
-
-        /* Emit the offset and ascii dump for the entire line */
-
-        FlPrintFile (ASL_FILE_HEX_OUTPUT, "  /* %8.8X", Offset);
-        LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData);
-        FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s*/\n",
-            HEX_TABLE_LINE_SIZE - LineLength + 1, " ");
-
-        Offset += LineLength;
+        FlPrintFile (FileId, "\n     */\n    };\n");
     }
 
-    FlPrintFile (ASL_FILE_HEX_OUTPUT, "    })\n");
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LsDoHexOutputAsm
- *
- * PARAMETERS:  None
- *
- * RETURN:      None.
- *
- * DESCRIPTION: Create the hex output file.  This is the same data as the AML
- *              output file, but formatted into hex/ascii bytes suitable for
- *              inclusion into a ASM source file.
- *
- ******************************************************************************/
-
-static void
-LsDoHexOutputAsm (
-    void)
-{
-    UINT8                   FileData[HEX_TABLE_LINE_SIZE];
-    UINT32                  LineLength;
-    UINT32                  Offset = 0;
-    UINT32                  AmlFileSize;
-    UINT32                  i;
-
-
-    /* Get AML size, seek back to start */
-
-    AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT);
-    FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
-
-    FlPrintFile (ASL_FILE_HEX_OUTPUT, "; Assembly code source output\n");
-    FlPrintFile (ASL_FILE_HEX_OUTPUT, "; AML code block contains 0x%X bytes\n;\n",
-        AmlFileSize);
+    FlPrintFile (FileId, "\n");
 
-    while (Offset < AmlFileSize)
+    if (FileId == ASL_FILE_LISTING_OUTPUT)
     {
-        /* Read enough bytes needed for one output line */
-
-        LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE,
-                        Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
-        if (!LineLength)
-        {
-            break;
-        }
-
-        FlPrintFile (ASL_FILE_HEX_OUTPUT, "  db  ");
-
-        for (i = 0; i < LineLength; i++)
-        {
-            /*
-             * Print each hex byte.
-             * Add a comma until the last byte of the line
-             */
-            FlPrintFile (ASL_FILE_HEX_OUTPUT, "0%2.2Xh", FileData[i]);
-            if ((i + 1) < LineLength)
-            {
-                FlPrintFile (ASL_FILE_HEX_OUTPUT, ",");
-            }
-        }
-
-        FlPrintFile (ASL_FILE_HEX_OUTPUT, " ");
-
-        /* Add fill spaces if needed for last line */
-
-        if (LineLength < HEX_TABLE_LINE_SIZE)
-        {
-            FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s",
-                5 * (HEX_TABLE_LINE_SIZE - LineLength), " ");
-        }
-
-        /* Emit the offset and ascii dump for the entire line */
-
-        FlPrintFile (ASL_FILE_HEX_OUTPUT, "  ; %8.8X", Offset);
-        LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData);
-        FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n");
+        /* Print a summary of the compile exceptions */
 
-        Offset += LineLength;
+        FlPrintFile (FileId, "\n\nSummary of errors and warnings\n\n");
+        AePrintErrorLog (FileId);
+        FlPrintFile (FileId, "\n");
+        UtDisplaySummary (FileId);
+        FlPrintFile (FileId, "\n");
     }
-
-    FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n");
 }
-
-
diff --git a/src/acpica/source/compiler/asllistsup.c b/src/acpica/source/compiler/asllistsup.c
new file mode 100644
index 0000000..a3dd3d0
--- /dev/null
+++ b/src/acpica/source/compiler/asllistsup.c
@@ -0,0 +1,778 @@ 
+/******************************************************************************
+ *
+ * Module Name: asllistsup - Listing file support utilities
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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 "aslcompiler.h"
+#include "aslcompiler.y.h"
+
+
+#define _COMPONENT          ACPI_COMPILER
+        ACPI_MODULE_NAME    ("aslistsup")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    LsDumpAscii
+ *
+ * PARAMETERS:  FileId          - ID of current listing file
+ *              Count           - Number of bytes to convert
+ *              Buffer          - Buffer of bytes to convert
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Convert hex bytes to ascii
+ *
+ ******************************************************************************/
+
+void
+LsDumpAscii (
+    UINT32                  FileId,
+    UINT32                  Count,
+    UINT8                   *Buffer)
+{
+    UINT8                   BufChar;
+    UINT32                  i;
+
+
+    FlPrintFile (FileId, "    \"");
+    for (i = 0; i < Count; i++)
+    {
+        BufChar = Buffer[i];
+        if (isprint (BufChar))
+        {
+            FlPrintFile (FileId, "%c", BufChar);
+        }
+        else
+        {
+            /* Not a printable character, just put out a dot */
+
+            FlPrintFile (FileId, ".");
+        }
+    }
+    FlPrintFile (FileId, "\"");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    LsDumpAsciiInComment
+ *
+ * PARAMETERS:  FileId          - ID of current listing file
+ *              Count           - Number of bytes to convert
+ *              Buffer          - Buffer of bytes to convert
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Convert hex bytes to ascii
+ *
+ ******************************************************************************/
+
+void
+LsDumpAsciiInComment (
+    UINT32                  FileId,
+    UINT32                  Count,
+    UINT8                   *Buffer)
+{
+    UINT8                   BufChar = 0;
+    UINT8                   LastChar;
+    UINT32                  i;
+
+
+    FlPrintFile (FileId, "    \"");
+    for (i = 0; i < Count; i++)
+    {
+        LastChar = BufChar;
+        BufChar = Buffer[i];
+
+        if (isprint (BufChar))
+        {
+            /* Handle embedded C comment sequences */
+
+            if (((LastChar == '*') && (BufChar == '/')) ||
+                ((LastChar == '/') && (BufChar == '*')))
+            {
+                /* Insert a space to break the sequence */
+
+                FlPrintFile (FileId, ".", BufChar);
+            }
+
+            FlPrintFile (FileId, "%c", BufChar);
+        }
+        else
+        {
+            /* Not a printable character, just put out a dot */
+
+            FlPrintFile (FileId, ".");
+        }
+    }
+
+    FlPrintFile (FileId, "\"");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    LsCheckException
+ *
+ * PARAMETERS:  LineNumber          - Current logical (cumulative) line #
+ *              FileId              - ID of output listing file
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Check if there is an exception for this line, and if there is,
+ *              put it in the listing immediately. Handles multiple errors
+ *              per line. Gbl_NextError points to the next error in the
+ *              sorted (by line #) list of compile errors/warnings.
+ *
+ ******************************************************************************/
+
+void
+LsCheckException (
+    UINT32                  LineNumber,
+    UINT32                  FileId)
+{
+
+    if ((!Gbl_NextError) ||
+        (LineNumber < Gbl_NextError->LogicalLineNumber ))
+    {
+        return;
+    }
+
+    /* Handle multiple errors per line */
+
+    if (FileId == ASL_FILE_LISTING_OUTPUT)
+    {
+        while (Gbl_NextError &&
+              (LineNumber >= Gbl_NextError->LogicalLineNumber))
+        {
+            AePrintException (FileId, Gbl_NextError, "\n[****iasl****]\n");
+
+            Gbl_NextError = Gbl_NextError->Next;
+        }
+
+        FlPrintFile (FileId, "\n");
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    LsWriteListingHexBytes
+ *
+ * PARAMETERS:  Buffer          - AML code buffer
+ *              Length          - Number of AML bytes to write
+ *              FileId          - ID of current listing file.
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Write the contents of the AML buffer to the listing file via
+ *              the listing buffer. The listing buffer is flushed every 16
+ *              AML bytes.
+ *
+ ******************************************************************************/
+
+void
+LsWriteListingHexBytes (
+    UINT8                   *Buffer,
+    UINT32                  Length,
+    UINT32                  FileId)
+{
+    UINT32                  i;
+
+
+    /* Transfer all requested bytes */
+
+    for (i = 0; i < Length; i++)
+    {
+        /* Print line header when buffer is empty */
+
+        if (Gbl_CurrentHexColumn == 0)
+        {
+            if (Gbl_HasIncludeFiles)
+            {
+                FlPrintFile (FileId, "%*s", 10, " ");
+            }
+
+            switch (FileId)
+            {
+            case ASL_FILE_LISTING_OUTPUT:
+
+                FlPrintFile (FileId, "%8.8X%s", Gbl_CurrentAmlOffset,
+                    ASL_LISTING_LINE_PREFIX);
+                break;
+
+            case ASL_FILE_ASM_SOURCE_OUTPUT:
+
+                FlPrintFile (FileId, "    db ");
+                break;
+
+            case ASL_FILE_C_SOURCE_OUTPUT:
+
+                FlPrintFile (FileId, "        ");
+                break;
+
+            default:
+                /* No other types supported */
+                return;
+            }
+        }
+
+        /* Transfer AML byte and update counts */
+
+        Gbl_AmlBuffer[Gbl_CurrentHexColumn] = Buffer[i];
+
+        Gbl_CurrentHexColumn++;
+        Gbl_CurrentAmlOffset++;
+
+        /* Flush buffer when it is full */
+
+        if (Gbl_CurrentHexColumn >= HEX_LISTING_LINE_SIZE)
+        {
+            LsFlushListingBuffer (FileId);
+        }
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    LsWriteSourceLines
+ *
+ * PARAMETERS:  ToLineNumber            -
+ *              ToLogicalLineNumber     - Write up to this source line number
+ *              FileId                  - ID of current listing file
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Read then write source lines to the listing file until we have
+ *              reached the specified logical (cumulative) line number. This
+ *              automatically echos out comment blocks and other non-AML
+ *              generating text until we get to the actual AML-generating line
+ *              of ASL code specified by the logical line number.
+ *
+ ******************************************************************************/
+
+void
+LsWriteSourceLines (
+    UINT32                  ToLineNumber,
+    UINT32                  ToLogicalLineNumber,
+    UINT32                  FileId)
+{
+
+    /* Nothing to do for these file types */
+
+    if ((FileId == ASL_FILE_ASM_INCLUDE_OUTPUT) ||
+        (FileId == ASL_FILE_C_INCLUDE_OUTPUT))
+    {
+        return;
+    }
+
+    Gbl_CurrentLine = ToLogicalLineNumber;
+
+    /* Flush any hex bytes remaining from the last opcode */
+
+    LsFlushListingBuffer (FileId);
+
+    /* Read lines and write them as long as we are not caught up */
+
+    if (Gbl_SourceLine < Gbl_CurrentLine)
+    {
+        /*
+         * If we just completed writing some AML hex bytes, output a linefeed
+         * to add some whitespace for readability.
+         */
+        if (Gbl_HexBytesWereWritten)
+        {
+            FlPrintFile (FileId, "\n");
+            Gbl_HexBytesWereWritten = FALSE;
+        }
+
+        if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
+        {
+            FlPrintFile (FileId, "    /*\n");
+        }
+
+        /* Write one line at a time until we have reached the target line # */
+
+        while ((Gbl_SourceLine < Gbl_CurrentLine) &&
+                LsWriteOneSourceLine (FileId))
+        { ; }
+
+        if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
+        {
+            FlPrintFile (FileId, "     */");
+        }
+
+        FlPrintFile (FileId, "\n");
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    LsWriteOneSourceLine
+ *
+ * PARAMETERS:  FileId          - ID of current listing file
+ *
+ * RETURN:      FALSE on EOF (input source file), TRUE otherwise
+ *
+ * DESCRIPTION: Read one line from the input source file and echo it to the
+ *              listing file, prefixed with the line number, and if the source
+ *              file contains include files, prefixed with the current filename
+ *
+ ******************************************************************************/
+
+UINT32
+LsWriteOneSourceLine (
+    UINT32                  FileId)
+{
+    UINT8                   FileByte;
+    UINT32                  Column = 0;
+    UINT32                  Index = 16;
+    BOOLEAN                 StartOfLine = FALSE;
+    BOOLEAN                 ProcessLongLine = FALSE;
+
+
+    Gbl_SourceLine++;
+    Gbl_ListingNode->LineNumber++;
+
+    /* Ignore lines that are completely blank (but count the line above) */
+
+    if (FlReadFile (ASL_FILE_SOURCE_OUTPUT, &FileByte, 1) != AE_OK)
+    {
+        return (0);
+    }
+    if (FileByte == '\n')
+    {
+        return (1);
+    }
+
+    /*
+     * This is a non-empty line, we will print the entire line with
+     * the line number and possibly other prefixes and transforms.
+     */
+
+    /* Line prefixes for special files, C and ASM output */
+
+    if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
+    {
+        FlPrintFile (FileId, "     *");
+    }
+    if (FileId == ASL_FILE_ASM_SOURCE_OUTPUT)
+    {
+        FlPrintFile (FileId, "; ");
+    }
+
+    if (Gbl_HasIncludeFiles)
+    {
+        /*
+         * This file contains "include" statements, print the current
+         * filename and line number within the current file
+         */
+        FlPrintFile (FileId, "%12s %5d%s",
+            Gbl_ListingNode->Filename, Gbl_ListingNode->LineNumber,
+            ASL_LISTING_LINE_PREFIX);
+    }
+    else
+    {
+        /* No include files, just print the line number */
+
+        FlPrintFile (FileId, "%8u%s", Gbl_SourceLine,
+            ASL_LISTING_LINE_PREFIX);
+    }
+
+    /* Read the rest of this line (up to a newline or EOF) */
+
+    do
+    {
+        if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
+        {
+            if (FileByte == '/')
+            {
+                FileByte = '*';
+            }
+        }
+
+        /* Split long input lines for readability in the listing */
+
+        Column++;
+        if (Column >= 128)
+        {
+            if (!ProcessLongLine)
+            {
+                if ((FileByte != '}') &&
+                    (FileByte != '{'))
+                {
+                    goto WriteByte;
+                }
+
+                ProcessLongLine = TRUE;
+            }
+
+            if (FileByte == '{')
+            {
+                FlPrintFile (FileId, "\n%*s{\n", Index, " ");
+                StartOfLine = TRUE;
+                Index += 4;
+                continue;
+            }
+
+            else if (FileByte == '}')
+            {
+                if (!StartOfLine)
+                {
+                    FlPrintFile (FileId, "\n");
+                }
+
+                StartOfLine = TRUE;
+                Index -= 4;
+                FlPrintFile (FileId, "%*s}\n", Index, " ");
+                continue;
+            }
+
+            /* Ignore spaces/tabs at the start of line */
+
+            else if ((FileByte == ' ') && StartOfLine)
+            {
+                continue;
+            }
+
+            else if (StartOfLine)
+            {
+                StartOfLine = FALSE;
+                FlPrintFile (FileId, "%*s", Index, " ");
+            }
+
+WriteByte:
+            FlWriteFile (FileId, &FileByte, 1);
+            if (FileByte == '\n')
+            {
+                /*
+                 * This line has been completed.
+                 * Check if an error occurred on this source line during the compile.
+                 * If so, we print the error message after the source line.
+                 */
+                LsCheckException (Gbl_SourceLine, FileId);
+                return (1);
+            }
+        }
+        else
+        {
+            FlWriteFile (FileId, &FileByte, 1);
+            if (FileByte == '\n')
+            {
+                /*
+                 * This line has been completed.
+                 * Check if an error occurred on this source line during the compile.
+                 * If so, we print the error message after the source line.
+                 */
+                LsCheckException (Gbl_SourceLine, FileId);
+                return (1);
+            }
+        }
+
+    } while (FlReadFile (ASL_FILE_SOURCE_OUTPUT, &FileByte, 1) == AE_OK);
+
+    /* EOF on the input file was reached */
+
+    return (0);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    LsFlushListingBuffer
+ *
+ * PARAMETERS:  FileId          - ID of the listing file
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Flush out the current contents of the 16-byte hex AML code
+ *              buffer. Usually called at the termination of a single line
+ *              of source code or when the buffer is full.
+ *
+ ******************************************************************************/
+
+void
+LsFlushListingBuffer (
+    UINT32                  FileId)
+{
+    UINT32                  i;
+
+
+    if (Gbl_CurrentHexColumn == 0)
+    {
+        return;
+    }
+
+    /* Write the hex bytes */
+
+    switch (FileId)
+    {
+    case ASL_FILE_LISTING_OUTPUT:
+
+        for (i = 0; i < Gbl_CurrentHexColumn; i++)
+        {
+            FlPrintFile (FileId, "%2.2X ", Gbl_AmlBuffer[i]);
+        }
+
+        for (i = 0; i < ((HEX_LISTING_LINE_SIZE - Gbl_CurrentHexColumn) * 3); i++)
+        {
+            FlWriteFile (FileId, ".", 1);
+        }
+
+        /* Write the ASCII character associated with each of the bytes */
+
+        LsDumpAscii (FileId, Gbl_CurrentHexColumn, Gbl_AmlBuffer);
+        break;
+
+
+    case ASL_FILE_ASM_SOURCE_OUTPUT:
+
+        for (i = 0; i < Gbl_CurrentHexColumn; i++)
+        {
+            if (i > 0)
+            {
+                FlPrintFile (FileId, ",");
+            }
+            FlPrintFile (FileId, "0%2.2Xh", Gbl_AmlBuffer[i]);
+        }
+
+        for (i = 0; i < ((HEX_LISTING_LINE_SIZE - Gbl_CurrentHexColumn) * 5); i++)
+        {
+            FlWriteFile (FileId, " ", 1);
+        }
+
+        FlPrintFile (FileId, "  ;%8.8X",
+            Gbl_CurrentAmlOffset - HEX_LISTING_LINE_SIZE);
+
+        /* Write the ASCII character associated with each of the bytes */
+
+        LsDumpAscii (FileId, Gbl_CurrentHexColumn, Gbl_AmlBuffer);
+        break;
+
+
+    case ASL_FILE_C_SOURCE_OUTPUT:
+
+        for (i = 0; i < Gbl_CurrentHexColumn; i++)
+        {
+            FlPrintFile (FileId, "0x%2.2X,", Gbl_AmlBuffer[i]);
+        }
+
+        /* Pad hex output with spaces if line is shorter than max line size */
+
+        for (i = 0; i < ((HEX_LISTING_LINE_SIZE - Gbl_CurrentHexColumn) * 5); i++)
+        {
+            FlWriteFile (FileId, " ", 1);
+        }
+
+        /* AML offset for the start of the line */
+
+        FlPrintFile (FileId, "    /* %8.8X",
+            Gbl_CurrentAmlOffset - Gbl_CurrentHexColumn);
+
+        /* Write the ASCII character associated with each of the bytes */
+
+        LsDumpAsciiInComment (FileId, Gbl_CurrentHexColumn, Gbl_AmlBuffer);
+        FlPrintFile (FileId, " */");
+        break;
+
+    default:
+        /* No other types supported */
+        return;
+    }
+
+    FlPrintFile (FileId, "\n");
+
+    Gbl_CurrentHexColumn = 0;
+    Gbl_HexBytesWereWritten = TRUE;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    LsPushNode
+ *
+ * PARAMETERS:  Filename        - Pointer to the include filename
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Push a listing node on the listing/include file stack. This
+ *              stack enables tracking of include files (infinitely nested)
+ *              and resumption of the listing of the parent file when the
+ *              include file is finished.
+ *
+ ******************************************************************************/
+
+void
+LsPushNode (
+    char                    *Filename)
+{
+    ASL_LISTING_NODE        *Lnode;
+
+
+    /* Create a new node */
+
+    Lnode = UtLocalCalloc (sizeof (ASL_LISTING_NODE));
+
+    /* Initialize */
+
+    Lnode->Filename = Filename;
+    Lnode->LineNumber = 0;
+
+    /* Link (push) */
+
+    Lnode->Next = Gbl_ListingNode;
+    Gbl_ListingNode = Lnode;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    LsPopNode
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      List head after current head is popped off
+ *
+ * DESCRIPTION: Pop the current head of the list, free it, and return the
+ *              next node on the stack (the new current node).
+ *
+ ******************************************************************************/
+
+ASL_LISTING_NODE *
+LsPopNode (
+    void)
+{
+    ASL_LISTING_NODE        *Lnode;
+
+
+    /* Just grab the node at the head of the list */
+
+    Lnode = Gbl_ListingNode;
+    if ((!Lnode) ||
+        (!Lnode->Next))
+    {
+        AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, NULL,
+            "Could not pop empty listing stack");
+        return (Gbl_ListingNode);
+    }
+
+    Gbl_ListingNode = Lnode->Next;
+    ACPI_FREE (Lnode);
+
+    /* New "Current" node is the new head */
+
+    return (Gbl_ListingNode);
+}
diff --git a/src/acpica/source/compiler/aslload.c b/src/acpica/source/compiler/aslload.c
index 8bac44a..01278de 100644
--- a/src/acpica/source/compiler/aslload.c
+++ b/src/acpica/source/compiler/aslload.c
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -185,7 +185,7 @@  LdLoadNamespace (
     WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
     if (!WalkState)
     {
-        return AE_NO_MEMORY;
+        return (AE_NO_MEMORY);
     }
 
     /* Walk the entire parse tree, first pass */
@@ -201,7 +201,7 @@  LdLoadNamespace (
     /* Dump the namespace if debug is enabled */
 
     AcpiNsDumpTables (ACPI_NS_ALL, ACPI_UINT32_MAX);
-    return AE_OK;
+    return (AE_OK);
 }
 
 
@@ -966,5 +966,3 @@  LdCommonNamespaceEnd (
 
     return (AE_OK);
 }
-
-
diff --git a/src/acpica/source/compiler/asllookup.c b/src/acpica/source/compiler/asllookup.c
index 8f8dc5d..9650bfe 100644
--- a/src/acpica/source/compiler/asllookup.c
+++ b/src/acpica/source/compiler/asllookup.c
@@ -1,6 +1,6 @@ 
 /******************************************************************************
  *
- * Module Name: asllookup- Namespace lookup
+ * Module Name: asllookup- Namespace lookup functions
  *
  *****************************************************************************/
 
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -116,7 +116,6 @@ 
 
 #include "aslcompiler.h"
 #include "aslcompiler.y.h"
-
 #include "acparser.h"
 #include "amlcode.h"
 #include "acnamesp.h"
@@ -129,57 +128,12 @@ 
 /* Local prototypes */
 
 static ACPI_STATUS
-LsCompareOneNamespaceObject (
-    ACPI_HANDLE             ObjHandle,
-    UINT32                  Level,
-    void                    *Context,
-    void                    **ReturnValue);
-
-static ACPI_STATUS
-LsDoOneNamespaceObject (
-    ACPI_HANDLE             ObjHandle,
-    UINT32                  Level,
-    void                    *Context,
-    void                    **ReturnValue);
-
-static BOOLEAN
-LkObjectExists (
-    char                    *Name);
-
-static void
-LkCheckFieldRange (
-    ACPI_PARSE_OBJECT       *Op,
-    UINT32                  RegionBitLength,
-    UINT32                  FieldBitOffset,
-    UINT32                  FieldBitLength,
-    UINT32                  AccessBitWidth);
-
-static ACPI_STATUS
-LkNamespaceLocateBegin (
-    ACPI_PARSE_OBJECT       *Op,
-    UINT32                  Level,
-    void                    *Context);
-
-static ACPI_STATUS
-LkNamespaceLocateEnd (
-    ACPI_PARSE_OBJECT       *Op,
-    UINT32                  Level,
-    void                    *Context);
-
-static ACPI_STATUS
 LkIsObjectUsed (
     ACPI_HANDLE             ObjHandle,
     UINT32                  Level,
     void                    *Context,
     void                    **ReturnValue);
 
-static ACPI_STATUS
-LsDoOnePathname (
-    ACPI_HANDLE             ObjHandle,
-    UINT32                  Level,
-    void                    *Context,
-    void                    **ReturnValue);
-
 static ACPI_PARSE_OBJECT *
 LkGetNameOp (
     ACPI_PARSE_OBJECT       *Op);
@@ -187,423 +141,94 @@  LkGetNameOp (
 
 /*******************************************************************************
  *
- * FUNCTION:    LsDoOneNamespaceObject
- *
- * PARAMETERS:  ACPI_WALK_CALLBACK
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Dump a namespace object to the namespace output file.
- *              Called during the walk of the namespace to dump all objects.
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-LsDoOneNamespaceObject (
-    ACPI_HANDLE             ObjHandle,
-    UINT32                  Level,
-    void                    *Context,
-    void                    **ReturnValue)
-{
-    ACPI_NAMESPACE_NODE     *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
-    ACPI_OPERAND_OBJECT     *ObjDesc;
-    ACPI_PARSE_OBJECT       *Op;
-
-
-    Gbl_NumNamespaceObjects++;
-
-    FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%5u  [%u]  %*s %4.4s - %s",
-        Gbl_NumNamespaceObjects, Level, (Level * 3), " ",
-        &Node->Name,
-        AcpiUtGetTypeName (Node->Type));
-
-    Op = Node->Op;
-    ObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node->Object);
-
-    if (!Op)
-    {
-        FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\n");
-        return (AE_OK);
-    }
-
-
-    if ((ObjDesc) &&
-        (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND))
-    {
-        switch (Node->Type)
-        {
-        case ACPI_TYPE_INTEGER:
-
-            FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
-                "       [Initial Value   0x%8.8X%8.8X]",
-                ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
-            break;
-
-
-        case ACPI_TYPE_STRING:
-
-            FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
-                "        [Initial Value   \"%s\"]",
-                ObjDesc->String.Pointer);
-            break;
-
-        default:
-            /* Nothing to do for other types */
-            break;
-        }
-
-    }
-    else
-    {
-        switch (Node->Type)
-        {
-        case ACPI_TYPE_INTEGER:
-
-            if (Op->Asl.ParseOpcode == PARSEOP_NAME)
-            {
-                Op = Op->Asl.Child;
-            }
-            if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG)  ||
-                (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING))
-            {
-                Op = Op->Asl.Next;
-            }
-            FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
-                "       [Initial Value   0x%8.8X%8.8X]",
-                ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));
-            break;
-
-
-        case ACPI_TYPE_STRING:
-
-            if (Op->Asl.ParseOpcode == PARSEOP_NAME)
-            {
-                Op = Op->Asl.Child;
-            }
-            if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG)  ||
-                (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING))
-            {
-                Op = Op->Asl.Next;
-            }
-            FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
-                "        [Initial Value   \"%s\"]",
-                Op->Asl.Value.String);
-            break;
-
-
-        case ACPI_TYPE_LOCAL_REGION_FIELD:
-
-            if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG)  ||
-                (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING))
-            {
-                Op = Op->Asl.Child;
-            }
-            FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
-                "   [Offset 0x%04X   Length 0x%04X bits]",
-                Op->Asl.Parent->Asl.ExtraValue, (UINT32) Op->Asl.Value.Integer);
-            break;
-
-
-        case ACPI_TYPE_BUFFER_FIELD:
-
-            switch (Op->Asl.ParseOpcode)
-            {
-            case PARSEOP_CREATEBYTEFIELD:
-                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "   [BYTE  ( 8 bit)]");
-                break;
-
-            case PARSEOP_CREATEDWORDFIELD:
-                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "   [DWORD (32 bit)]");
-                break;
-
-            case PARSEOP_CREATEQWORDFIELD:
-                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "   [QWORD (64 bit)]");
-                break;
-
-            case PARSEOP_CREATEWORDFIELD:
-                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "   [WORD  (16 bit)]");
-                break;
-
-            case PARSEOP_CREATEBITFIELD:
-                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "   [BIT   ( 1 bit)]");
-                break;
-
-            case PARSEOP_CREATEFIELD:
-                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "   [Arbitrary Bit Field]");
-                break;
-
-            default:
-                break;
-
-            }
-            break;
-
-
-        case ACPI_TYPE_PACKAGE:
-
-            if (Op->Asl.ParseOpcode == PARSEOP_NAME)
-            {
-                Op = Op->Asl.Child;
-            }
-            if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG)  ||
-                (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING))
-            {
-                Op = Op->Asl.Next;
-            }
-            Op = Op->Asl.Child;
-
-            if ((Op->Asl.ParseOpcode == PARSEOP_BYTECONST) ||
-                (Op->Asl.ParseOpcode == PARSEOP_RAW_DATA))
-            {
-                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
-                    "       [Initial Length  0x%.2X elements]",
-                    Op->Asl.Value.Integer);
-            }
-            break;
-
-
-        case ACPI_TYPE_BUFFER:
-
-            if (Op->Asl.ParseOpcode == PARSEOP_NAME)
-            {
-                Op = Op->Asl.Child;
-            }
-            if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG)  ||
-                (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING))
-            {
-                Op = Op->Asl.Next;
-            }
-            Op = Op->Asl.Child;
-
-            if (Op && (Op->Asl.ParseOpcode == PARSEOP_INTEGER))
-            {
-                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
-                    "        [Initial Length  0x%.2X bytes]",
-                    Op->Asl.Value.Integer);
-            }
-            break;
-
-
-        case ACPI_TYPE_METHOD:
-
-            FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
-                "        [Code Length     0x%.4X bytes]",
-                Op->Asl.AmlSubtreeLength);
-            break;
-
-
-        case ACPI_TYPE_LOCAL_RESOURCE:
-
-            FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
-                "  [Desc Offset     0x%.4X Bytes]", Node->Value);
-            break;
-
-
-        case ACPI_TYPE_LOCAL_RESOURCE_FIELD:
-
-            if (Node->Flags & 0x80)
-            {
-                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
-                    "   [Field Offset    0x%.4X Bits 0x%.4X Bytes]",
-                    Node->Value, Node->Value / 8);
-            }
-            else
-            {
-                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
-                    "   [Field Offset    0x%.4X Bytes]", Node->Value);
-            }
-            break;
-
-
-        default:
-            /* Nothing to do for other types */
-            break;
-        }
-    }
-
-    FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\n");
-    return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LsSetupNsList
+ * FUNCTION:    LkFindUnreferencedObjects
  *
- * PARAMETERS:  Handle          - local file handle
+ * PARAMETERS:  None
  *
  * RETURN:      None
  *
- * DESCRIPTION: Set the namespace output file to the input handle
+ * DESCRIPTION: Namespace walk to find objects that are not referenced in any
+ *              way. Must be called after the namespace has been cross
+ *              referenced.
  *
  ******************************************************************************/
 
 void
-LsSetupNsList (
-    void                    *Handle)
+LkFindUnreferencedObjects (
+    void)
 {
 
-    Gbl_NsOutputFlag = TRUE;
-    Gbl_Files[ASL_FILE_NAMESPACE_OUTPUT].Handle = Handle;
+    /* Walk entire namespace from the supplied root */
+
+    (void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+                ACPI_UINT32_MAX, FALSE, LkIsObjectUsed, NULL,
+                NULL, NULL);
 }
 
 
 /*******************************************************************************
  *
- * FUNCTION:    LsDoOnePathname
+ * FUNCTION:    LkIsObjectUsed
  *
  * PARAMETERS:  ACPI_WALK_CALLBACK
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Print the full pathname for a namespace node.
+ * DESCRIPTION: Check for an unreferenced namespace object and emit a warning.
+ *              We have to be careful, because some types and names are
+ *              typically or always unreferenced, we don't want to issue
+ *              excessive warnings.
  *
  ******************************************************************************/
 
 static ACPI_STATUS
-LsDoOnePathname (
+LkIsObjectUsed (
     ACPI_HANDLE             ObjHandle,
     UINT32                  Level,
     void                    *Context,
     void                    **ReturnValue)
 {
-    ACPI_NAMESPACE_NODE     *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
-    ACPI_STATUS             Status;
-    ACPI_BUFFER             TargetPath;
+    ACPI_NAMESPACE_NODE     *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
+
 
+    /* Referenced flag is set during the namespace xref */
 
-    TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
-    Status = AcpiNsHandleToPathname (Node, &TargetPath);
-    if (ACPI_FAILURE (Status))
+    if (Node->Flags & ANOBJ_IS_REFERENCED)
     {
-        return (Status);
+        return (AE_OK);
     }
 
-    FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%s\n", TargetPath.Pointer);
-    ACPI_FREE (TargetPath.Pointer);
-
-    return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LsDisplayNamespace
- *
- * PARAMETERS:  None
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Walk the namespace an display information about each node
- *              in the tree.  Information is written to the optional
- *              namespace output file.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-LsDisplayNamespace (
-    void)
-{
-    ACPI_STATUS             Status;
-
-
-    if (!Gbl_NsOutputFlag)
+    /*
+     * Ignore names that start with an underscore,
+     * these are the reserved ACPI names and are typically not referenced,
+     * they are called by the host OS.
+     */
+    if (Node->Name.Ascii[0] == '_')
     {
         return (AE_OK);
     }
 
-    Gbl_NumNamespaceObjects = 0;
-
-    /* File header */
-
-    FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "Contents of ACPI Namespace\n\n");
-    FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "Count  Depth    Name - Type\n\n");
-
-    /* Walk entire namespace from the root */
-
-    Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
-                ACPI_UINT32_MAX, FALSE, LsDoOneNamespaceObject, NULL,
-                NULL, NULL);
-
-    /* Print the full pathname for each namespace node */
-
-    FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\nNamespace pathnames\n\n");
-
-    Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
-                ACPI_UINT32_MAX, FALSE, LsDoOnePathname, NULL,
-                NULL, NULL);
-
-    return (Status);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LsCompareOneNamespaceObject
- *
- * PARAMETERS:  ACPI_WALK_CALLBACK
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Compare name of one object.
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-LsCompareOneNamespaceObject (
-    ACPI_HANDLE             ObjHandle,
-    UINT32                  Level,
-    void                    *Context,
-    void                    **ReturnValue)
-{
-    ACPI_NAMESPACE_NODE     *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
-
-
-    /* Simply check the name */
+    /* There are some types that are typically not referenced, ignore them */
 
-    if (*((UINT32 *) (Context)) == Node->Name.Integer)
+    switch (Node->Type)
     {
-        /* Abort walk if we found one instance */
+    case ACPI_TYPE_DEVICE:
+    case ACPI_TYPE_PROCESSOR:
+    case ACPI_TYPE_POWER:
+    case ACPI_TYPE_LOCAL_RESOURCE:
+        return (AE_OK);
 
-        return (AE_CTRL_TRUE);
+    default:
+        break;
     }
 
-    return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LkObjectExists
- *
- * PARAMETERS:  Name            - 4 char ACPI name
- *
- * RETURN:      TRUE if name exists in namespace
- *
- * DESCRIPTION: Walk the namespace to find an object
- *
- ******************************************************************************/
-
-static BOOLEAN
-LkObjectExists (
-    char                    *Name)
-{
-    ACPI_STATUS             Status;
-
-
-    /* Walk entire namespace from the supplied root */
+    /* All others are valid unreferenced namespace objects */
 
-    Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
-                ACPI_UINT32_MAX, FALSE, LsCompareOneNamespaceObject, NULL,
-                Name, NULL);
-    if (Status == AE_CTRL_TRUE)
+    if (Node->Op)
     {
-        /* At least one instance of the name was found */
-
-        return (TRUE);
+        AslError (ASL_WARNING2, ASL_MSG_NOT_REFERENCED, LkGetNameOp (Node->Op), NULL);
     }
-
-    return (FALSE);
+    return (AE_OK);
 }
 
 
@@ -659,815 +284,3 @@  LkGetNameOp (
 
     return (NameOp);
 }
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LkIsObjectUsed
- *
- * PARAMETERS:  ACPI_WALK_CALLBACK
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Check for an unreferenced namespace object and emit a warning.
- *              We have to be careful, because some types and names are
- *              typically or always unreferenced, we don't want to issue
- *              excessive warnings.
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-LkIsObjectUsed (
-    ACPI_HANDLE             ObjHandle,
-    UINT32                  Level,
-    void                    *Context,
-    void                    **ReturnValue)
-{
-    ACPI_NAMESPACE_NODE     *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
-
-
-    /* Referenced flag is set during the namespace xref */
-
-    if (Node->Flags & ANOBJ_IS_REFERENCED)
-    {
-        return (AE_OK);
-    }
-
-    /*
-     * Ignore names that start with an underscore,
-     * these are the reserved ACPI names and are typically not referenced,
-     * they are called by the host OS.
-     */
-    if (Node->Name.Ascii[0] == '_')
-    {
-        return (AE_OK);
-    }
-
-    /* There are some types that are typically not referenced, ignore them */
-
-    switch (Node->Type)
-    {
-    case ACPI_TYPE_DEVICE:
-    case ACPI_TYPE_PROCESSOR:
-    case ACPI_TYPE_POWER:
-    case ACPI_TYPE_LOCAL_RESOURCE:
-        return (AE_OK);
-
-    default:
-        break;
-    }
-
-    /* All others are valid unreferenced namespace objects */
-
-    if (Node->Op)
-    {
-        AslError (ASL_WARNING2, ASL_MSG_NOT_REFERENCED, LkGetNameOp (Node->Op), NULL);
-    }
-    return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LkFindUnreferencedObjects
- *
- * PARAMETERS:  None
- *
- * RETURN:      None
- *
- * DESCRIPTION: Namespace walk to find objects that are not referenced in any
- *              way. Must be called after the namespace has been cross
- *              referenced.
- *
- ******************************************************************************/
-
-void
-LkFindUnreferencedObjects (
-    void)
-{
-
-    /* Walk entire namespace from the supplied root */
-
-    (void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
-                ACPI_UINT32_MAX, FALSE, LkIsObjectUsed, NULL,
-                NULL, NULL);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LkCrossReferenceNamespace
- *
- * PARAMETERS:  None
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Perform a cross reference check of the parse tree against the
- *              namespace.  Every named referenced within the parse tree
- *              should be get resolved with a namespace lookup.  If not, the
- *              original reference in the ASL code is invalid -- i.e., refers
- *              to a non-existent object.
- *
- * NOTE:  The ASL "External" operator causes the name to be inserted into the
- *        namespace so that references to the external name will be resolved
- *        correctly here.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-LkCrossReferenceNamespace (
-    void)
-{
-    ACPI_WALK_STATE         *WalkState;
-
-
-    DbgPrint (ASL_DEBUG_OUTPUT, "\nCross referencing namespace\n\n");
-
-    /*
-     * Create a new walk state for use when looking up names
-     * within the namespace (Passed as context to the callbacks)
-     */
-    WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
-    if (!WalkState)
-    {
-        return AE_NO_MEMORY;
-    }
-
-    /* Walk the entire parse tree */
-
-    TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, LkNamespaceLocateBegin,
-                        LkNamespaceLocateEnd, WalkState);
-    return AE_OK;
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LkCheckFieldRange
- *
- * PARAMETERS:  RegionBitLength     - Length of entire parent region
- *              FieldBitOffset      - Start of the field unit (within region)
- *              FieldBitLength      - Entire length of field unit
- *              AccessBitWidth      - Access width of the field unit
- *
- * RETURN:      None
- *
- * DESCRIPTION: Check one field unit to make sure it fits in the parent
- *              op region.
- *
- * Note: AccessBitWidth must be either 8,16,32, or 64
- *
- ******************************************************************************/
-
-static void
-LkCheckFieldRange (
-    ACPI_PARSE_OBJECT       *Op,
-    UINT32                  RegionBitLength,
-    UINT32                  FieldBitOffset,
-    UINT32                  FieldBitLength,
-    UINT32                  AccessBitWidth)
-{
-    UINT32                  FieldEndBitOffset;
-
-
-    /*
-     * Check each field unit against the region size.  The entire
-     * field unit (start offset plus length) must fit within the
-     * region.
-     */
-    FieldEndBitOffset = FieldBitOffset + FieldBitLength;
-
-    if (FieldEndBitOffset > RegionBitLength)
-    {
-        /* Field definition itself is beyond the end-of-region */
-
-        AslError (ASL_ERROR, ASL_MSG_FIELD_UNIT_OFFSET, Op, NULL);
-        return;
-    }
-
-    /*
-     * Now check that the field plus AccessWidth doesn't go beyond
-     * the end-of-region.  Assumes AccessBitWidth is a power of 2
-     */
-    FieldEndBitOffset = ACPI_ROUND_UP (FieldEndBitOffset, AccessBitWidth);
-
-    if (FieldEndBitOffset > RegionBitLength)
-    {
-        /* Field definition combined with the access is beyond EOR */
-
-        AslError (ASL_ERROR, ASL_MSG_FIELD_UNIT_ACCESS_WIDTH, Op, NULL);
-    }
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    LkNamespaceLocateBegin
- *
- * PARAMETERS:  ASL_WALK_CALLBACK
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Descending callback used during cross-reference.  For named
- *              object references, attempt to locate the name in the
- *              namespace.
- *
- * NOTE: ASL references to named fields within resource descriptors are
- *       resolved to integer values here.  Therefore, this step is an
- *       important part of the code generation.  We don't know that the
- *       name refers to a resource descriptor until now.
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-LkNamespaceLocateBegin (
-    ACPI_PARSE_OBJECT       *Op,
-    UINT32                  Level,
-    void                    *Context)
-{
-    ACPI_WALK_STATE         *WalkState = (ACPI_WALK_STATE *) Context;
-    ACPI_NAMESPACE_NODE     *Node;
-    ACPI_STATUS             Status;
-    ACPI_OBJECT_TYPE        ObjectType;
-    char                    *Path;
-    UINT8                   PassedArgs;
-    ACPI_PARSE_OBJECT       *NextOp;
-    ACPI_PARSE_OBJECT       *OwningOp;
-    ACPI_PARSE_OBJECT       *SpaceIdOp;
-    UINT32                  MinimumLength;
-    UINT32                  Offset;
-    UINT32                  FieldBitLength;
-    UINT32                  TagBitLength;
-    UINT8                   Message = 0;
-    const ACPI_OPCODE_INFO  *OpInfo;
-    UINT32                  Flags;
-
-
-    ACPI_FUNCTION_TRACE_PTR (LkNamespaceLocateBegin, 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)) &&
-        (Op->Asl.ParseOpcode != PARSEOP_NAMESTRING) &&
-        (Op->Asl.ParseOpcode != PARSEOP_NAMESEG)    &&
-        (Op->Asl.ParseOpcode != PARSEOP_METHODCALL))
-    {
-        return (AE_OK);
-    }
-
-    /*
-     * One special case: CondRefOf operator - we don't care if the name exists
-     * or not at this point, just ignore it, the point of the operator is to
-     * determine if the name exists at runtime.
-     */
-    if ((Op->Asl.Parent) &&
-        (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF))
-    {
-        return (AE_OK);
-    }
-
-    /*
-     * We must enable the "search-to-root" for single NameSegs, but
-     * we have to be very careful about opening up scopes
-     */
-    Flags = ACPI_NS_SEARCH_PARENT;
-    if ((Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) ||
-        (Op->Asl.ParseOpcode == PARSEOP_NAMESEG)    ||
-        (Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
-    {
-        /*
-         * These are name references, do not push the scope stack
-         * for them.
-         */
-        Flags |= ACPI_NS_DONT_OPEN_SCOPE;
-    }
-
-    /* Get the NamePath from the appropriate place */
-
-    if (OpInfo->Flags & AML_NAMED)
-    {
-        /* For nearly all NAMED operators, the name reference is the first child */
-
-        Path = Op->Asl.Child->Asl.Value.String;
-        if (Op->Asl.AmlOpcode == AML_ALIAS_OP)
-        {
-            /*
-             * ALIAS is the only oddball opcode, the name declaration
-             * (alias name) is the second operand
-             */
-            Path = Op->Asl.Child->Asl.Next->Asl.Value.String;
-        }
-    }
-    else if (OpInfo->Flags & AML_CREATE)
-    {
-        /* Name must appear as the last parameter */
-
-        NextOp = Op->Asl.Child;
-        while (!(NextOp->Asl.CompileFlags & NODE_IS_NAME_DECLARATION))
-        {
-            NextOp = NextOp->Asl.Next;
-        }
-        Path = NextOp->Asl.Value.String;
-    }
-    else
-    {
-        Path = Op->Asl.Value.String;
-    }
-
-    ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
-    ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-        "Type=%s\n", AcpiUtGetTypeName (ObjectType)));
-
-    /*
-     * Lookup the name in the namespace.  Name must exist at this point, or it
-     * is an invalid reference.
-     *
-     * The namespace is also used as a lookup table for references to resource
-     * descriptors and the fields within them.
-     */
-    Gbl_NsLookupCount++;
-
-    Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
-                ACPI_IMODE_EXECUTE, Flags, WalkState, &(Node));
-    if (ACPI_FAILURE (Status))
-    {
-        if (Status == AE_NOT_FOUND)
-        {
-            /*
-             * We didn't find the name reference by path -- we can qualify this
-             * a little better before we print an error message
-             */
-            if (strlen (Path) == ACPI_NAME_SIZE)
-            {
-                /* A simple, one-segment ACPI name */
-
-                if (LkObjectExists (Path))
-                {
-                    /*
-                     * There exists such a name, but we couldn't get to it
-                     * from this scope
-                     */
-                    AslError (ASL_ERROR, ASL_MSG_NOT_REACHABLE, Op,
-                        Op->Asl.ExternalName);
-                }
-                else
-                {
-                    /* The name doesn't exist, period */
-
-                    AslError (ASL_ERROR, ASL_MSG_NOT_EXIST,
-                        Op, Op->Asl.ExternalName);
-                }
-            }
-            else
-            {
-                /* Check for a fully qualified path */
-
-                if (Path[0] == AML_ROOT_PREFIX)
-                {
-                    /* Gave full path, the object does not exist */
-
-                    AslError (ASL_ERROR, ASL_MSG_NOT_EXIST, Op,
-                        Op->Asl.ExternalName);
-                }
-                else
-                {
-                    /*
-                     * We can't tell whether it doesn't exist or just
-                     * can't be reached.
-                     */
-                    AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op,
-                        Op->Asl.ExternalName);
-                }
-            }
-
-            Status = AE_OK;
-        }
-        return (Status);
-    }
-
-    /* Check for a reference vs. name declaration */
-
-    if (!(OpInfo->Flags & AML_NAMED) &&
-        !(OpInfo->Flags & AML_CREATE))
-    {
-        /* This node has been referenced, mark it for reference check */
-
-        Node->Flags |= ANOBJ_IS_REFERENCED;
-    }
-
-    /* Attempt to optimize the NamePath */
-
-    OptOptimizeNamePath (Op, OpInfo->Flags, WalkState, Path, Node);
-
-    /*
-     * 1) Dereference an alias (A name reference that is an alias)
-     *    Aliases are not nested, the alias always points to the final object
-     */
-    if ((Op->Asl.ParseOpcode != PARSEOP_ALIAS) &&
-        (Node->Type == ACPI_TYPE_LOCAL_ALIAS))
-    {
-        /* This node points back to the original PARSEOP_ALIAS */
-
-        NextOp = Node->Op;
-
-        /* The first child is the alias target op */
-
-        NextOp = NextOp->Asl.Child;
-
-        /* That in turn points back to original target alias node */
-
-        if (NextOp->Asl.Node)
-        {
-            Node = NextOp->Asl.Node;
-        }
-
-        /* Else - forward reference to alias, will be resolved later */
-    }
-
-    /* 2) Check for a reference to a resource descriptor */
-
-    if ((Node->Type == ACPI_TYPE_LOCAL_RESOURCE_FIELD) ||
-        (Node->Type == ACPI_TYPE_LOCAL_RESOURCE))
-    {
-        /*
-         * This was a reference to a field within a resource descriptor.
-         * Extract the associated field offset (either a bit or byte
-         * offset depending on the field type) and change the named
-         * reference into an integer for AML code generation
-         */
-        Offset = Node->Value;
-        TagBitLength = Node->Length;
-
-        /*
-         * If a field is being created, generate the length (in bits) of
-         * the field. Note: Opcodes other than CreateXxxField and Index
-         * can come through here. For other opcodes, we just need to
-         * convert the resource tag reference to an integer offset.
-         */
-        switch (Op->Asl.Parent->Asl.AmlOpcode)
-        {
-        case AML_CREATE_FIELD_OP: /* Variable "Length" field, in bits */
-            /*
-             * We know the length operand is an integer constant because
-             * we know that it contains a reference to a resource
-             * descriptor tag.
-             */
-            FieldBitLength = (UINT32) Op->Asl.Next->Asl.Value.Integer;
-            break;
-
-        case AML_CREATE_BIT_FIELD_OP:
-            FieldBitLength = 1;
-            break;
-
-        case AML_CREATE_BYTE_FIELD_OP:
-        case AML_INDEX_OP:
-            FieldBitLength = 8;
-            break;
-
-        case AML_CREATE_WORD_FIELD_OP:
-            FieldBitLength = 16;
-            break;
-
-        case AML_CREATE_DWORD_FIELD_OP:
-            FieldBitLength = 32;
-            break;
-
-        case AML_CREATE_QWORD_FIELD_OP:
-            FieldBitLength = 64;
-            break;
-
-        default:
-            FieldBitLength = 0;
-            break;
-        }
-
-        /* Check the field length against the length of the resource tag */
-
-        if (FieldBitLength)
-        {
-            if (TagBitLength < FieldBitLength)
-            {
-                Message = ASL_MSG_TAG_SMALLER;
-            }
-            else if (TagBitLength > FieldBitLength)
-            {
-                Message = ASL_MSG_TAG_LARGER;
-            }
-
-            if (Message)
-            {
-                sprintf (MsgBuffer, "Size mismatch, Tag: %u bit%s, Field: %u bit%s",
-                    TagBitLength, (TagBitLength > 1) ? "s" : "",
-                    FieldBitLength, (FieldBitLength > 1) ? "s" : "");
-
-                AslError (ASL_WARNING, Message, Op, MsgBuffer);
-            }
-        }
-
-        /* Convert the BitOffset to a ByteOffset for certain opcodes */
-
-        switch (Op->Asl.Parent->Asl.AmlOpcode)
-        {
-        case AML_CREATE_BYTE_FIELD_OP:
-        case AML_CREATE_WORD_FIELD_OP:
-        case AML_CREATE_DWORD_FIELD_OP:
-        case AML_CREATE_QWORD_FIELD_OP:
-        case AML_INDEX_OP:
-
-            Offset = ACPI_DIV_8 (Offset);
-            break;
-
-        default:
-            break;
-        }
-
-        /* Now convert this node to an integer whose value is the field offset */
-
-        Op->Asl.AmlLength = 0;
-        Op->Asl.ParseOpcode = PARSEOP_INTEGER;
-        Op->Asl.Value.Integer = (UINT64) Offset;
-        Op->Asl.CompileFlags |= NODE_IS_RESOURCE_FIELD;
-
-        OpcGenerateAmlOpcode (Op);
-    }
-
-    /* 3) Check for a method invocation */
-
-    else if ((((Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) || (Op->Asl.ParseOpcode == PARSEOP_NAMESEG)) &&
-                (Node->Type == ACPI_TYPE_METHOD) &&
-                (Op->Asl.Parent) &&
-                (Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_METHOD))   ||
-
-                (Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
-    {
-
-        /*
-         * A reference to a method within one of these opcodes is not an
-         * invocation of the method, it is simply a reference to the method.
-         */
-        if ((Op->Asl.Parent) &&
-           ((Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_REFOF)      ||
-            (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_DEREFOF)    ||
-            (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_OBJECTTYPE)))
-        {
-            return (AE_OK);
-        }
-        /*
-         * There are two types of method invocation:
-         * 1) Invocation with arguments -- the parser recognizes this
-         *    as a METHODCALL.
-         * 2) Invocation with no arguments --the parser cannot determine that
-         *    this is a method invocation, therefore we have to figure it out
-         *    here.
-         */
-        if (Node->Type != ACPI_TYPE_METHOD)
-        {
-            sprintf (MsgBuffer, "%s is a %s",
-                    Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type));
-
-            AslError (ASL_ERROR, ASL_MSG_NOT_METHOD, Op, MsgBuffer);
-            return (AE_OK);
-        }
-
-        /* Save the method node in the caller's op */
-
-        Op->Asl.Node = Node;
-        if (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF)
-        {
-            return (AE_OK);
-        }
-
-        /*
-         * This is a method invocation, with or without arguments.
-         * Count the number of arguments, each appears as a child
-         * under the parent node
-         */
-        Op->Asl.ParseOpcode = PARSEOP_METHODCALL;
-        UtSetParseOpName (Op);
-
-        PassedArgs = 0;
-        NextOp     = Op->Asl.Child;
-
-        while (NextOp)
-        {
-            PassedArgs++;
-            NextOp = NextOp->Asl.Next;
-        }
-
-        if (Node->Value != ASL_EXTERNAL_METHOD)
-        {
-            /*
-             * Check the parsed arguments with the number expected by the
-             * method declaration itself
-             */
-            if (PassedArgs != Node->Value)
-            {
-                sprintf (MsgBuffer, "%s requires %u", Op->Asl.ExternalName,
-                            Node->Value);
-
-                if (PassedArgs < Node->Value)
-                {
-                    AslError (ASL_ERROR, ASL_MSG_ARG_COUNT_LO, Op, MsgBuffer);
-                }
-                else
-                {
-                    AslError (ASL_ERROR, ASL_MSG_ARG_COUNT_HI, Op, MsgBuffer);
-                }
-            }
-        }
-    }
-
-    /* 4) Check for an ASL Field definition */
-
-    else if ((Op->Asl.Parent) &&
-            ((Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_FIELD)     ||
-             (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_BANKFIELD)))
-    {
-        /*
-         * Offset checking for fields.  If the parent operation region has a
-         * constant length (known at compile time), we can check fields
-         * defined in that region against the region length.  This will catch
-         * fields and field units that cannot possibly fit within the region.
-         *
-         * Note: Index fields do not directly reference an operation region,
-         * thus they are not included in this check.
-         */
-        if (Op == Op->Asl.Parent->Asl.Child)
-        {
-            /*
-             * This is the first child of the field node, which is
-             * the name of the region.  Get the parse node for the
-             * region -- which contains the length of the region.
-             */
-            OwningOp = Node->Op;
-            Op->Asl.Parent->Asl.ExtraValue =
-                ACPI_MUL_8 ((UINT32) OwningOp->Asl.Value.Integer);
-
-            /* Examine the field access width */
-
-            switch ((UINT8) Op->Asl.Parent->Asl.Value.Integer)
-            {
-            case AML_FIELD_ACCESS_ANY:
-            case AML_FIELD_ACCESS_BYTE:
-            case AML_FIELD_ACCESS_BUFFER:
-            default:
-                MinimumLength = 1;
-                break;
-
-            case AML_FIELD_ACCESS_WORD:
-                MinimumLength = 2;
-                break;
-
-            case AML_FIELD_ACCESS_DWORD:
-                MinimumLength = 4;
-                break;
-
-            case AML_FIELD_ACCESS_QWORD:
-                MinimumLength = 8;
-                break;
-            }
-
-            /*
-             * Is the region at least as big as the access width?
-             * Note: DataTableRegions have 0 length
-             */
-            if (((UINT32) OwningOp->Asl.Value.Integer) &&
-                ((UINT32) OwningOp->Asl.Value.Integer < MinimumLength))
-            {
-                AslError (ASL_ERROR, ASL_MSG_FIELD_ACCESS_WIDTH, Op, NULL);
-            }
-
-            /*
-             * Check EC/CMOS/SMBUS fields to make sure that the correct
-             * access type is used (BYTE for EC/CMOS, BUFFER for SMBUS)
-             */
-            SpaceIdOp = OwningOp->Asl.Child->Asl.Next;
-            switch ((UINT32) SpaceIdOp->Asl.Value.Integer)
-            {
-            case ACPI_ADR_SPACE_EC:
-            case ACPI_ADR_SPACE_CMOS:
-            case ACPI_ADR_SPACE_GPIO:
-
-                if ((UINT8) Op->Asl.Parent->Asl.Value.Integer != AML_FIELD_ACCESS_BYTE)
-                {
-                    AslError (ASL_ERROR, ASL_MSG_REGION_BYTE_ACCESS, Op, NULL);
-                }
-                break;
-
-            case ACPI_ADR_SPACE_SMBUS:
-            case ACPI_ADR_SPACE_IPMI:
-            case ACPI_ADR_SPACE_GSBUS:
-
-                if ((UINT8) Op->Asl.Parent->Asl.Value.Integer != AML_FIELD_ACCESS_BUFFER)
-                {
-                    AslError (ASL_ERROR, ASL_MSG_REGION_BUFFER_ACCESS, Op, NULL);
-                }
-                break;
-
-            default:
-
-                /* Nothing to do for other address spaces */
-                break;
-            }
-        }
-        else
-        {
-            /*
-             * This is one element of the field list.  Check to make sure
-             * that it does not go beyond the end of the parent operation region.
-             *
-             * In the code below:
-             *    Op->Asl.Parent->Asl.ExtraValue      - Region Length (bits)
-             *    Op->Asl.ExtraValue                  - Field start offset (bits)
-             *    Op->Asl.Child->Asl.Value.Integer32  - Field length (bits)
-             *    Op->Asl.Child->Asl.ExtraValue       - Field access width (bits)
-             */
-            if (Op->Asl.Parent->Asl.ExtraValue && Op->Asl.Child)
-            {
-                LkCheckFieldRange (Op,
-                            Op->Asl.Parent->Asl.ExtraValue,
-                            Op->Asl.ExtraValue,
-                            (UINT32) Op->Asl.Child->Asl.Value.Integer,
-                            Op->Asl.Child->Asl.ExtraValue);
-            }
-        }
-    }
-
-    Op->Asl.Node = Node;
-    return (Status);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    LkNamespaceLocateEnd
- *
- * PARAMETERS:  ASL_WALK_CALLBACK
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Ascending callback used during cross reference.  We only
- *              need to worry about scope management here.
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-LkNamespaceLocateEnd (
-    ACPI_PARSE_OBJECT       *Op,
-    UINT32                  Level,
-    void                    *Context)
-{
-    ACPI_WALK_STATE         *WalkState = (ACPI_WALK_STATE *) Context;
-    const ACPI_OPCODE_INFO  *OpInfo;
-
-
-    ACPI_FUNCTION_TRACE (LkNamespaceLocateEnd);
-
-
-    /* We are only interested in opcodes that have an associated name */
-
-    OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
-    if (!(OpInfo->Flags & AML_NAMED))
-    {
-        return (AE_OK);
-    }
-
-    /* Not interested in name references, we did not open a scope for them */
-
-    if ((Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) ||
-        (Op->Asl.ParseOpcode == PARSEOP_NAMESEG)    ||
-        (Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
-    {
-        return (AE_OK);
-    }
-
-    /* Pop the scope stack if necessary */
-
-    if (AcpiNsOpensScope (AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode)))
-    {
-
-        ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-            "%s: Popping scope for Op %p\n",
-            AcpiUtGetTypeName (OpInfo->ObjectType), Op));
-
-        (void) AcpiDsScopeStackPop (WalkState);
-    }
-
-    return (AE_OK);
-}
-
-
diff --git a/src/acpica/source/compiler/aslmain.c b/src/acpica/source/compiler/aslmain.c
index efd5906..921da42 100644
--- a/src/acpica/source/compiler/aslmain.c
+++ b/src/acpica/source/compiler/aslmain.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslmain - compiler main and utilities
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -120,6 +119,7 @@ 
 #include "aslcompiler.h"
 #include "acapps.h"
 #include "acdisasm.h"
+#include <signal.h>
 
 #ifdef _DEBUG
 #include <crtdbg.h>
@@ -142,6 +142,10 @@  static void
 Usage (
     void);
 
+static void ACPI_SYSTEM_XFACE
+AslSignalHandler (
+    int                     Sig);
+
 static void
 AslInitialize (
     void);
@@ -168,7 +172,7 @@  AslDoResponseFile (
 
 
 #define ASL_TOKEN_SEPARATORS    " \t\n"
-#define ASL_SUPPORTED_OPTIONS   "@:2b|c|d^D:e:fgh^i|I:l^mno|p:P^r:s|t|T:G^v^w|x:z"
+#define ASL_SUPPORTED_OPTIONS   "@:b|c|d^D:e:fgh^i|I:l^m:no|p:P^r:s|t|T:G^v^w|x:z"
 
 
 /*******************************************************************************
@@ -179,7 +183,8 @@  AslDoResponseFile (
  *
  * RETURN:      None
  *
- * DESCRIPTION: Display option help message
+ * DESCRIPTION: Display option help message.
+ *              Optional items in square brackets.
  *
  ******************************************************************************/
 
@@ -191,6 +196,7 @@  Options (
     printf ("\nGlobal:\n");
     ACPI_OPTION ("-@ <file>",       "Specify command file");
     ACPI_OPTION ("-I <dir>",        "Specify additional include directory");
+    ACPI_OPTION ("-T <sig>|ALL|*",  "Create table template file for ACPI <Sig>");
     ACPI_OPTION ("-v",              "Display compiler version");
 
     printf ("\nPreprocessor:\n");
@@ -199,7 +205,7 @@  Options (
     ACPI_OPTION ("-P",              "Preprocess only and create preprocessor output file (*.i)");
     ACPI_OPTION ("-Pn",             "Disable preprocessor");
 
-    printf ("\nGeneral Output:\n");
+    printf ("\nGeneral Processing:\n");
     ACPI_OPTION ("-p <prefix>",     "Specify path/filename prefix for all output files");
     ACPI_OPTION ("-va",             "Disable all errors and warnings (summary only)");
     ACPI_OPTION ("-vi",             "Less verbose errors and warnings for use with IDEs");
@@ -209,38 +215,41 @@  Options (
     ACPI_OPTION ("-w1 -w2 -w3",     "Set warning reporting level");
     ACPI_OPTION ("-we",             "Report warnings as errors");
 
-    printf ("\nAML Output Files:\n");
-    ACPI_OPTION ("-sa -sc",         "Create AML in assembler or C source file (*.asm or *.c)");
-    ACPI_OPTION ("-ia -ic",         "Create assembler or C include file (*.inc or *.h)");
-    ACPI_OPTION ("-ta -tc -ts",     "Create AML in assembler, C, or ASL hex table (*.hex)");
-
-    printf ("\nAML Code Generation:\n");
+    printf ("\nAML Code Generation (*.aml):\n");
     ACPI_OPTION ("-oa",             "Disable all optimizations (compatibility mode)");
     ACPI_OPTION ("-of",             "Disable constant folding");
     ACPI_OPTION ("-oi",             "Disable integer optimization to Zero/One/Ones");
     ACPI_OPTION ("-on",             "Disable named reference string optimization");
     ACPI_OPTION ("-cr",             "Disable Resource Descriptor error checking");
+    ACPI_OPTION ("-in",             "Ignore NoOp operators");
     ACPI_OPTION ("-r <revision>",   "Override table header Revision (1-255)");
 
-    printf ("\nASL Listing Files:\n");
+    printf ("\nOptional Source Code Output Files:\n");
+    ACPI_OPTION ("-sc -sa",         "Create source file in C or assembler (*.c or *.asm)");
+    ACPI_OPTION ("-ic -ia",         "Create include file in C or assembler (*.h or *.inc)");
+    ACPI_OPTION ("-tc -ta -ts",     "Create hex AML table in C, assembler, or ASL (*.hex)");
+    ACPI_OPTION ("-so",             "Create offset table in C (*.offset.h)");
+
+    printf ("\nOptional Listing Files:\n");
     ACPI_OPTION ("-l",              "Create mixed listing file (ASL source and AML) (*.lst)");
     ACPI_OPTION ("-ln",             "Create namespace file (*.nsp)");
     ACPI_OPTION ("-ls",             "Create combined source file (expanded includes) (*.src)");
 
-    printf ("\nACPI Data Tables:\n");
-    ACPI_OPTION ("-G",              "Compile custom table containing generic operators");
-    ACPI_OPTION ("-T <sig>|ALL|*",  "Create table template file(s) for <Sig>");
-    ACPI_OPTION ("-vt",             "Create verbose templates (full disassembly)");
+    printf ("\nData Table Compiler:\n");
+    ACPI_OPTION ("-G",              "Compile custom table that contains generic operators");
+    ACPI_OPTION ("-vt",             "Create verbose template files (full disassembly)");
 
     printf ("\nAML Disassembler:\n");
-    ACPI_OPTION ("-d  [file]",      "Disassemble or decode binary ACPI table to file (*.dsl)");
-    ACPI_OPTION ("-da [f1,f2]",     "Disassemble multiple tables from single namespace");
-    ACPI_OPTION ("-dc [file]",      "Disassemble AML and immediately compile it");
-    ACPI_OPTION ("",                "(Obtain DSDT from current system if no input file)");
-    ACPI_OPTION ("-e  [f1,f2]",     "Include ACPI table(s) for external symbol resolution");
-    ACPI_OPTION ("-m",              "Do not translate Buffers to Resource Templates");
-    ACPI_OPTION ("-2",              "Emit ACPI 2.0 compatible ASL code");
+    ACPI_OPTION ("-d  <f1,f2>",     "Disassemble or decode binary ACPI tables to file (*.dsl)");
+    ACPI_OPTION ("",                "  (Optional, file type is automatically detected)");
+    ACPI_OPTION ("-da <f1,f2>",     "Disassemble multiple tables from single namespace");
+    ACPI_OPTION ("-db",             "Do not translate Buffers to Resource Templates");
+    ACPI_OPTION ("-dc <f1,f2>",     "Disassemble AML and immediately compile it");
+    ACPI_OPTION ("",                "  (Obtain DSDT from current system if no input file)");
+    ACPI_OPTION ("-e  <f1,f2>",     "Include ACPI table(s) for external symbol resolution");
     ACPI_OPTION ("-g",              "Get ACPI tables and write to files (*.dat)");
+    ACPI_OPTION ("-in",             "Ignore NoOp opcodes");
+    ACPI_OPTION ("-vt",             "Dump binary table data in hex format within output file");
 
     printf ("\nHelp:\n");
     ACPI_OPTION ("-h",              "This message");
@@ -252,6 +261,7 @@  Options (
     printf ("\nDebug Options:\n");
     ACPI_OPTION ("-bf -bt",         "Create debug file (full or parse tree only) (*.txt)");
     ACPI_OPTION ("-f",              "Ignore errors, force creation of AML output file(s)");
+    ACPI_OPTION ("-m <size>",       "Set internal line buffer size (in Kbytes)");
     ACPI_OPTION ("-n",              "Parse only, no output generation");
     ACPI_OPTION ("-ot",             "Display compile times and statistics");
     ACPI_OPTION ("-x <level>",      "Set debug level for trace output");
@@ -278,7 +288,7 @@  FilenameHelp (
 
     printf ("\nAML output filename generation:\n");
     printf ("  Output filenames are generated by appending an extension to a common\n");
-    printf ("  filename prefix.  The filename prefix is obtained via one of the\n");
+    printf ("  filename prefix. The filename prefix is obtained via one of the\n");
     printf ("  following methods (in priority order):\n");
     printf ("    1) The -p option specifies the prefix\n");
     printf ("    2) The prefix of the AMLFileName in the ASL Definition Block\n");
@@ -310,6 +320,49 @@  Usage (
 }
 
 
+/******************************************************************************
+ *
+ * FUNCTION:    AslSignalHandler
+ *
+ * PARAMETERS:  Sig                 - Signal that invoked this handler
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Control-C handler. Delete any intermediate files and any
+ *              output files that may be left in an indeterminate state.
+ *
+ *****************************************************************************/
+
+static void ACPI_SYSTEM_XFACE
+AslSignalHandler (
+    int                     Sig)
+{
+    UINT32                  i;
+
+
+    signal (Sig, SIG_IGN);
+    printf ("Aborting\n\n");
+
+    /* Close all open files */
+
+    Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */
+
+    for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++)
+    {
+        FlCloseFile (i);
+    }
+
+    /* Delete any output files */
+
+    for (i = ASL_FILE_AML_OUTPUT; i < ASL_MAX_FILE_TYPE; i++)
+    {
+        FlDeleteFile (i);
+    }
+
+    exit (0);
+}
+
+
 /*******************************************************************************
  *
  * FUNCTION:    AslInitialize
@@ -333,7 +386,6 @@  AslInitialize (
     _CrtSetDbgFlag (_CRTDBG_CHECK_ALWAYS_DF | _CrtSetDbgFlag(0));
 #endif
 
-    AcpiDbgLevel = 0;
 
     for (i = 0; i < ASL_NUM_FILES; i++)
     {
@@ -346,6 +398,11 @@  AslInitialize (
 
     Gbl_Files[ASL_FILE_STDERR].Handle   = stderr;
     Gbl_Files[ASL_FILE_STDERR].Filename = "STDERR";
+
+    /* Allocate the line buffer(s) */
+
+    Gbl_LineBufferSize /= 2;
+    UtExpandLineBuffers ();
 }
 
 
@@ -409,7 +466,7 @@  AslDoResponseFile (
     {
         printf ("Could not open command file %s, %s\n",
             Filename, strerror (errno));
-        return -1;
+        return (-1);
     }
 
     /* Must save the current GetOpt globals */
@@ -493,11 +550,6 @@  AslDoOptions (
         break;
 
 
-    case '2':   /* ACPI 2.0 compatibility mode */
-        Gbl_Acpi2 = TRUE;
-        break;
-
-
     case 'b':   /* Debug output options */
         switch (AcpiGbl_Optarg[0])
         {
@@ -547,6 +599,10 @@  AslDoOptions (
             Gbl_DisassembleAll = TRUE;
             break;
 
+        case 'b':   /* Do not convert buffers to resource descriptors */
+            AcpiGbl_NoResourceDisassembly = TRUE;
+            break;
+
         case 'c':
             break;
 
@@ -644,6 +700,13 @@  AslDoOptions (
             Gbl_C_IncludeOutputFlag = TRUE;
             break;
 
+        case 'n':
+
+            /* Compiler/Disassembler: Ignore the NOOP operator */
+
+            AcpiGbl_IgnoreNoopOperator = TRUE;
+            break;
+
         default:
             printf ("Unknown option: -i%s\n", AcpiGbl_Optarg);
             return (-1);
@@ -685,8 +748,13 @@  AslDoOptions (
         break;
 
 
-    case 'm':   /* Do not convert buffers to resource descriptors */
-        AcpiGbl_NoResourceDisassembly = TRUE;
+    case 'm':   /* Set line buffer size */
+        Gbl_LineBufferSize = (UINT32) strtoul (AcpiGbl_Optarg, NULL, 0) * 1024;
+        if (Gbl_LineBufferSize < ASL_DEFAULT_LINE_BUFFER_SIZE)
+        {
+            Gbl_LineBufferSize = ASL_DEFAULT_LINE_BUFFER_SIZE;
+        }
+        printf ("Line Buffer Size: %u\n", Gbl_LineBufferSize);
         break;
 
 
@@ -789,6 +857,13 @@  AslDoOptions (
             Gbl_C_OutputFlag = TRUE;
             break;
 
+        case 'o':
+
+            /* Produce AML offset table in C */
+
+            Gbl_C_OffsetTableFlag = TRUE;
+            break;
+
         default:
             printf ("Unknown option: -s%s\n", AcpiGbl_Optarg);
             return (-1);
@@ -1018,7 +1093,10 @@  main (
     int                     Index2;
 
 
+    signal (SIGINT, AslSignalHandler);
+
     AcpiGbl_ExternalFileList = NULL;
+    AcpiDbgLevel = 0;
 
 #ifdef _DEBUG
     _CrtSetDbgFlag (_CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_LEAK_CHECK_DF |
@@ -1027,9 +1105,10 @@  main (
 
     /* Init and command line */
 
+    Index1 = Index2 = AslCommandLine (argc, argv);
+
     AslInitialize ();
     PrInitializePreprocessor ();
-    Index1 = Index2 = AslCommandLine (argc, argv);
 
     /* Options that have no additional parameters or pathnames */
 
@@ -1077,5 +1156,3 @@  main (
 
     return (0);
 }
-
-
diff --git a/src/acpica/source/compiler/aslmap.c b/src/acpica/source/compiler/aslmap.c
index c276972..aec3a7b 100644
--- a/src/acpica/source/compiler/aslmap.c
+++ b/src/acpica/source/compiler/aslmap.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslmap - parser to AML opcode mapping table
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -172,7 +171,7 @@  AslMapNamedOpcodeToDataType (
  *
  * DATA STRUCTURE:  AslKeywordMapping
  *
- * DESCRIPTION:     Maps the ParseOpcode to the actual AML opcode.  The parse
+ * DESCRIPTION:     Maps the ParseOpcode to the actual AML opcode. The parse
  *                  opcodes are generated from Bison, and this table must
  *                  track any additions to them.
  *
@@ -523,5 +522,3 @@  const ASL_MAPPING_ENTRY     AslKeywordMapping [] =
 /*! [End] no source code translation !*/
 
 };
-
-
diff --git a/src/acpica/source/compiler/aslmessages.h b/src/acpica/source/compiler/aslmessages.h
index 56951bc..b5c4d12 100644
--- a/src/acpica/source/compiler/aslmessages.h
+++ b/src/acpica/source/compiler/aslmessages.h
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslmessages.h - Compiler error/warning messages
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -239,6 +238,7 @@  typedef enum
     ASL_MSG_RESERVED_METHOD,
     ASL_MSG_RESERVED_NO_RETURN_VAL,
     ASL_MSG_RESERVED_OPERAND_TYPE,
+    ASL_MSG_RESERVED_PACKAGE_LENGTH,
     ASL_MSG_RESERVED_RETURN_VALUE,
     ASL_MSG_RESERVED_USE,
     ASL_MSG_RESERVED_WORD,
@@ -263,12 +263,15 @@  typedef enum
     ASL_MSG_TAG_SMALLER,
     ASL_MSG_TIMEOUT,
     ASL_MSG_TOO_MANY_TEMPS,
+    ASL_MSG_TRUNCATION,
     ASL_MSG_UNKNOWN_RESERVED_NAME,
     ASL_MSG_UNREACHABLE_CODE,
     ASL_MSG_UNSUPPORTED,
     ASL_MSG_UPPER_CASE,
     ASL_MSG_VENDOR_LIST,
     ASL_MSG_WRITE,
+    ASL_MSG_RANGE,
+    ASL_MSG_BUFFER_ALLOCATION,
 
     /* These messages are used by the Preprocessor only */
 
@@ -345,7 +348,7 @@  char                        *AslMessages [] = {
 /*    ASL_MSG_HID_SUFFIX */                 "_HID suffix must be all hex digits",
 /*    ASL_MSG_INCLUDE_FILE_OPEN */          "Could not open include file",
 /*    ASL_MSG_INPUT_FILE_OPEN */            "Could not open input file",
-/*    ASL_MSG_INTEGER_LENGTH */             "64-bit integer in 32-bit table, truncating",
+/*    ASL_MSG_INTEGER_LENGTH */             "64-bit integer in 32-bit table, truncating (DSDT version < 2)",
 /*    ASL_MSG_INTEGER_OPTIMIZATION */       "Integer optimized to single-byte AML opcode",
 /*    ASL_MSG_INTERRUPT_LIST */             "Too many interrupts (16 max)",
 /*    ASL_MSG_INTERRUPT_NUMBER */           "Invalid interrupt number (must be 0-15)",
@@ -413,6 +416,7 @@  char                        *AslMessages [] = {
 /*    ASL_MSG_RESERVED_METHOD */            "Reserved name must be a control method",
 /*    ASL_MSG_RESERVED_NO_RETURN_VAL */     "Reserved method should not return a value",
 /*    ASL_MSG_RESERVED_OPERAND_TYPE */      "Invalid object type for reserved name",
+/*    ASL_MSG_RESERVED_PACKAGE_LENGTH */    "Invalid package length for reserved name",
 /*    ASL_MSG_RESERVED_RETURN_VALUE */      "Reserved method must return a value",
 /*    ASL_MSG_RESERVED_USE */               "Invalid use of reserved name",
 /*    ASL_MSG_RESERVED_WORD */              "Use of reserved name",
@@ -437,12 +441,15 @@  char                        *AslMessages [] = {
 /*    ASL_MSG_TAG_SMALLER */                "ResourceTag smaller than Field",
 /*    ASL_MSG_TIMEOUT */                    "Result is not used, possible operator timeout will be missed",
 /*    ASL_MSG_TOO_MANY_TEMPS */             "Method requires too many temporary variables (_T_x)",
+/*    ASL_MSG_TRUNCATION */                 "64-bit return value will be truncated to 32 bits (DSDT version < 2)",
 /*    ASL_MSG_UNKNOWN_RESERVED_NAME */      "Unknown reserved name",
 /*    ASL_MSG_UNREACHABLE_CODE */           "Statement is unreachable",
 /*    ASL_MSG_UNSUPPORTED */                "Unsupported feature",
 /*    ASL_MSG_UPPER_CASE */                 "Non-hex letters must be upper case",
 /*    ASL_MSG_VENDOR_LIST */                "Too many vendor data bytes (7 max)",
 /*    ASL_MSG_WRITE */                      "Could not write file",
+/*    ASL_MSG_RANGE */                      "Constant out of range",
+/*    ASL_MSG_BUFFER_ALLOCATION */          "Could not allocate line buffer",
 
 /* Preprocessor */
 
diff --git a/src/acpica/source/compiler/aslmethod.c b/src/acpica/source/compiler/aslmethod.c
new file mode 100644
index 0000000..3e0f757
--- /dev/null
+++ b/src/acpica/source/compiler/aslmethod.c
@@ -0,0 +1,691 @@ 
+/******************************************************************************
+ *
+ * Module Name: aslmethod.c - Control method analysis walk
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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 "aslcompiler.h"
+#include "aslcompiler.y.h"
+
+
+#define _COMPONENT          ACPI_COMPILER
+        ACPI_MODULE_NAME    ("aslmethod")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    MtMethodAnalysisWalkBegin
+ *
+ * PARAMETERS:  ASL_WALK_CALLBACK
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Descending callback for the analysis walk. Check methods for:
+ *              1) Initialized local variables
+ *              2) Valid arguments
+ *              3) Return types
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+MtMethodAnalysisWalkBegin (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context)
+{
+    ASL_ANALYSIS_WALK_INFO  *WalkInfo = (ASL_ANALYSIS_WALK_INFO *) Context;
+    ASL_METHOD_INFO         *MethodInfo = WalkInfo->MethodStack;
+    ACPI_PARSE_OBJECT       *Next;
+    UINT32                  RegisterNumber;
+    UINT32                  i;
+    char                    LocalName[] = "Local0";
+    char                    ArgName[] = "Arg0";
+    ACPI_PARSE_OBJECT       *ArgNode;
+    ACPI_PARSE_OBJECT       *NextType;
+    ACPI_PARSE_OBJECT       *NextParamType;
+    UINT8                   ActualArgs = 0;
+
+
+    switch (Op->Asl.ParseOpcode)
+    {
+    case PARSEOP_METHOD:
+
+        TotalMethods++;
+
+        /* Create and init method info */
+
+        MethodInfo       = UtLocalCalloc (sizeof (ASL_METHOD_INFO));
+        MethodInfo->Next = WalkInfo->MethodStack;
+        MethodInfo->Op = Op;
+
+        WalkInfo->MethodStack = MethodInfo;
+
+        /* Get the name node, ignored here */
+
+        Next = Op->Asl.Child;
+
+        /* Get the NumArguments node */
+
+        Next = Next->Asl.Next;
+        MethodInfo->NumArguments = (UINT8)
+            (((UINT8) Next->Asl.Value.Integer) & 0x07);
+
+        /* Get the SerializeRule and SyncLevel nodes, ignored here */
+
+        Next = Next->Asl.Next;
+        Next = Next->Asl.Next;
+        ArgNode = Next;
+
+        /* Get the ReturnType node */
+
+        Next = Next->Asl.Next;
+
+        NextType = Next->Asl.Child;
+        while (NextType)
+        {
+            /* Get and map each of the ReturnTypes */
+
+            MethodInfo->ValidReturnTypes |= AnMapObjTypeToBtype (NextType);
+            NextType->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
+            NextType = NextType->Asl.Next;
+        }
+
+        /* Get the ParameterType node */
+
+        Next = Next->Asl.Next;
+
+        NextType = Next->Asl.Child;
+        while (NextType)
+        {
+            if (NextType->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
+            {
+                NextParamType = NextType->Asl.Child;
+                while (NextParamType)
+                {
+                    MethodInfo->ValidArgTypes[ActualArgs] |= AnMapObjTypeToBtype (NextParamType);
+                    NextParamType->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
+                    NextParamType = NextParamType->Asl.Next;
+                }
+            }
+            else
+            {
+                MethodInfo->ValidArgTypes[ActualArgs] =
+                    AnMapObjTypeToBtype (NextType);
+                NextType->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
+                ActualArgs++;
+            }
+
+            NextType = NextType->Asl.Next;
+        }
+
+        if ((MethodInfo->NumArguments) &&
+            (MethodInfo->NumArguments != ActualArgs))
+        {
+            /* error: Param list did not match number of args */
+        }
+
+        /* Allow numarguments == 0 for Function() */
+
+        if ((!MethodInfo->NumArguments) && (ActualArgs))
+        {
+            MethodInfo->NumArguments = ActualArgs;
+            ArgNode->Asl.Value.Integer |= ActualArgs;
+        }
+
+        /*
+         * Actual arguments are initialized at method entry.
+         * All other ArgX "registers" can be used as locals, so we
+         * track their initialization.
+         */
+        for (i = 0; i < MethodInfo->NumArguments; i++)
+        {
+            MethodInfo->ArgInitialized[i] = TRUE;
+        }
+        break;
+
+
+    case PARSEOP_METHODCALL:
+
+        if (MethodInfo &&
+           (Op->Asl.Node == MethodInfo->Op->Asl.Node))
+        {
+            AslError (ASL_REMARK, ASL_MSG_RECURSION, Op, Op->Asl.ExternalName);
+        }
+        break;
+
+
+    case PARSEOP_LOCAL0:
+    case PARSEOP_LOCAL1:
+    case PARSEOP_LOCAL2:
+    case PARSEOP_LOCAL3:
+    case PARSEOP_LOCAL4:
+    case PARSEOP_LOCAL5:
+    case PARSEOP_LOCAL6:
+    case PARSEOP_LOCAL7:
+
+        if (!MethodInfo)
+        {
+            /*
+             * Local was used outside a control method, or there was an error
+             * in the method declaration.
+             */
+            AslError (ASL_REMARK, ASL_MSG_LOCAL_OUTSIDE_METHOD, Op, Op->Asl.ExternalName);
+            return (AE_ERROR);
+        }
+
+        RegisterNumber = (Op->Asl.AmlOpcode & 0x000F);
+
+        /*
+         * If the local is being used as a target, mark the local
+         * initialized
+         */
+        if (Op->Asl.CompileFlags & NODE_IS_TARGET)
+        {
+            MethodInfo->LocalInitialized[RegisterNumber] = TRUE;
+        }
+
+        /*
+         * Otherwise, this is a reference, check if the local
+         * has been previously initialized.
+         *
+         * The only operator that accepts an uninitialized value is ObjectType()
+         */
+        else if ((!MethodInfo->LocalInitialized[RegisterNumber]) &&
+                 (Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_OBJECTTYPE))
+        {
+            LocalName[strlen (LocalName) -1] = (char) (RegisterNumber + 0x30);
+            AslError (ASL_ERROR, ASL_MSG_LOCAL_INIT, Op, LocalName);
+        }
+        break;
+
+
+    case PARSEOP_ARG0:
+    case PARSEOP_ARG1:
+    case PARSEOP_ARG2:
+    case PARSEOP_ARG3:
+    case PARSEOP_ARG4:
+    case PARSEOP_ARG5:
+    case PARSEOP_ARG6:
+
+        if (!MethodInfo)
+        {
+            /*
+             * Arg was used outside a control method, or there was an error
+             * in the method declaration.
+             */
+            AslError (ASL_REMARK, ASL_MSG_LOCAL_OUTSIDE_METHOD, Op, Op->Asl.ExternalName);
+            return (AE_ERROR);
+        }
+
+        RegisterNumber = (Op->Asl.AmlOpcode & 0x000F) - 8;
+        ArgName[strlen (ArgName) -1] = (char) (RegisterNumber + 0x30);
+
+        /*
+         * If the Arg is being used as a target, mark the local
+         * initialized
+         */
+        if (Op->Asl.CompileFlags & NODE_IS_TARGET)
+        {
+            MethodInfo->ArgInitialized[RegisterNumber] = TRUE;
+        }
+
+        /*
+         * Otherwise, this is a reference, check if the Arg
+         * has been previously initialized.
+         *
+         * The only operator that accepts an uninitialized value is ObjectType()
+         */
+        else if ((!MethodInfo->ArgInitialized[RegisterNumber]) &&
+                 (Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_OBJECTTYPE))
+        {
+            AslError (ASL_ERROR, ASL_MSG_ARG_INIT, Op, ArgName);
+        }
+
+        /* Flag this arg if it is not a "real" argument to the method */
+
+        if (RegisterNumber >= MethodInfo->NumArguments)
+        {
+            AslError (ASL_REMARK, ASL_MSG_NOT_PARAMETER, Op, ArgName);
+        }
+        break;
+
+
+    case PARSEOP_RETURN:
+
+        if (!MethodInfo)
+        {
+            /*
+             * Probably was an error in the method declaration,
+             * no additional error here
+             */
+            ACPI_WARNING ((AE_INFO, "%p, No parent method", Op));
+            return (AE_ERROR);
+        }
+
+        /*
+         * A child indicates a possible return value. A simple Return or
+         * Return() is marked with NODE_IS_NULL_RETURN by the parser so
+         * that it is not counted as a "real" return-with-value, although
+         * the AML code that is actually emitted is Return(0). The AML
+         * definition of Return has a required parameter, so we are
+         * forced to convert a null return to Return(0).
+         */
+        if ((Op->Asl.Child) &&
+            (Op->Asl.Child->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
+            (!(Op->Asl.Child->Asl.CompileFlags & NODE_IS_NULL_RETURN)))
+        {
+            MethodInfo->NumReturnWithValue++;
+        }
+        else
+        {
+            MethodInfo->NumReturnNoValue++;
+        }
+        break;
+
+
+    case PARSEOP_BREAK:
+    case PARSEOP_CONTINUE:
+
+        Next = Op->Asl.Parent;
+        while (Next)
+        {
+            if (Next->Asl.ParseOpcode == PARSEOP_WHILE)
+            {
+                break;
+            }
+            Next = Next->Asl.Parent;
+        }
+
+        if (!Next)
+        {
+            AslError (ASL_ERROR, ASL_MSG_NO_WHILE, Op, NULL);
+        }
+        break;
+
+
+    case PARSEOP_STALL:
+
+        /* We can range check if the argument is an integer */
+
+        if ((Op->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER) &&
+            (Op->Asl.Child->Asl.Value.Integer > ACPI_UINT8_MAX))
+        {
+            AslError (ASL_ERROR, ASL_MSG_INVALID_TIME, Op, NULL);
+        }
+        break;
+
+
+    case PARSEOP_DEVICE:
+    case PARSEOP_EVENT:
+    case PARSEOP_MUTEX:
+    case PARSEOP_OPERATIONREGION:
+    case PARSEOP_POWERRESOURCE:
+    case PARSEOP_PROCESSOR:
+    case PARSEOP_THERMALZONE:
+
+        /*
+         * The first operand is a name to be created in the namespace.
+         * Check against the reserved list.
+         */
+        i = ApCheckForPredefinedName (Op, Op->Asl.NameSeg);
+        if (i < ACPI_VALID_RESERVED_NAME_MAX)
+        {
+            AslError (ASL_ERROR, ASL_MSG_RESERVED_USE, Op, Op->Asl.ExternalName);
+        }
+        break;
+
+
+    case PARSEOP_NAME:
+
+        /* Typecheck any predefined names statically defined with Name() */
+
+        ApCheckForPredefinedObject (Op, Op->Asl.NameSeg);
+
+        /* Special typechecking for _HID */
+
+        if (!ACPI_STRCMP (METHOD_NAME__HID, Op->Asl.NameSeg))
+        {
+            Next = Op->Asl.Child->Asl.Next;
+            AnCheckId (Next, ASL_TYPE_HID);
+        }
+
+        /* Special typechecking for _CID */
+
+        else if (!ACPI_STRCMP (METHOD_NAME__CID, Op->Asl.NameSeg))
+        {
+            Next = Op->Asl.Child->Asl.Next;
+
+            if ((Next->Asl.ParseOpcode == PARSEOP_PACKAGE) ||
+                (Next->Asl.ParseOpcode == PARSEOP_VAR_PACKAGE))
+            {
+                Next = Next->Asl.Child;
+                while (Next)
+                {
+                    AnCheckId (Next, ASL_TYPE_CID);
+                    Next = Next->Asl.Next;
+                }
+            }
+            else
+            {
+                AnCheckId (Next, ASL_TYPE_CID);
+            }
+        }
+        break;
+
+
+    default:
+        break;
+    }
+
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    MtMethodAnalysisWalkEnd
+ *
+ * PARAMETERS:  ASL_WALK_CALLBACK
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Ascending callback for analysis walk. Complete method
+ *              return analysis.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+MtMethodAnalysisWalkEnd (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context)
+{
+    ASL_ANALYSIS_WALK_INFO  *WalkInfo = (ASL_ANALYSIS_WALK_INFO *) Context;
+    ASL_METHOD_INFO         *MethodInfo = WalkInfo->MethodStack;
+
+
+    switch (Op->Asl.ParseOpcode)
+    {
+    case PARSEOP_METHOD:
+    case PARSEOP_RETURN:
+        if (!MethodInfo)
+        {
+            printf ("No method info for method! [%s]\n", Op->Asl.Namepath);
+            AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, Op,
+                "No method info for this method");
+
+            CmCleanupAndExit ();
+            return (AE_AML_INTERNAL);
+        }
+        break;
+
+    default:
+        break;
+    }
+
+    switch (Op->Asl.ParseOpcode)
+    {
+    case PARSEOP_METHOD:
+
+        WalkInfo->MethodStack = MethodInfo->Next;
+
+        /*
+         * Check if there is no return statement at the end of the
+         * method AND we can actually get there -- i.e., the execution
+         * of the method can possibly terminate without a return statement.
+         */
+        if ((!AnLastStatementIsReturn (Op)) &&
+            (!(Op->Asl.CompileFlags & NODE_HAS_NO_EXIT)))
+        {
+            /*
+             * No return statement, and execution can possibly exit
+             * via this path. This is equivalent to Return ()
+             */
+            MethodInfo->NumReturnNoValue++;
+        }
+
+        /*
+         * Check for case where some return statements have a return value
+         * and some do not. Exit without a return statement is a return with
+         * no value
+         */
+        if (MethodInfo->NumReturnNoValue &&
+            MethodInfo->NumReturnWithValue)
+        {
+            AslError (ASL_WARNING, ASL_MSG_RETURN_TYPES, Op,
+                Op->Asl.ExternalName);
+        }
+
+        /*
+         * If there are any RETURN() statements with no value, or there is a
+         * control path that allows the method to exit without a return value,
+         * we mark the method as a method that does not return a value. This
+         * knowledge can be used to check method invocations that expect a
+         * returned value.
+         */
+        if (MethodInfo->NumReturnNoValue)
+        {
+            if (MethodInfo->NumReturnWithValue)
+            {
+                Op->Asl.CompileFlags |= NODE_METHOD_SOME_NO_RETVAL;
+            }
+            else
+            {
+                Op->Asl.CompileFlags |= NODE_METHOD_NO_RETVAL;
+            }
+        }
+
+        /*
+         * Check predefined method names for correct return behavior
+         * and correct number of arguments. Also, some special checks
+         * For GPE and _REG methods.
+         */
+        if (ApCheckForPredefinedMethod (Op, MethodInfo))
+        {
+            /* Special check for two names like _L01 and _E01 in same scope */
+
+            ApCheckForGpeNameConflict (Op);
+
+            /*
+             * Special check for _REG: Must have an operation region definition
+             * within the same scope!
+             */
+            ApCheckRegMethod (Op);
+        }
+
+        ACPI_FREE (MethodInfo);
+        break;
+
+
+    case PARSEOP_NAME:
+
+         /* Special check for two names like _L01 and _E01 in same scope */
+
+        ApCheckForGpeNameConflict (Op);
+        break;
+
+
+    case PARSEOP_RETURN:
+
+        /*
+         * If the parent is a predefined method name, attempt to typecheck
+         * the return value. Only static types can be validated.
+         */
+        ApCheckPredefinedReturnValue (Op, MethodInfo);
+
+        /*
+         * The parent block does not "exit" and continue execution -- the
+         * method is terminated here with the Return() statement.
+         */
+        Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT;
+
+        /* Used in the "typing" pass later */
+
+        Op->Asl.ParentMethod = MethodInfo->Op;
+
+        /*
+         * If there is a peer node after the return statement, then this
+         * node is unreachable code -- i.e., it won't be executed because of
+         * the preceding Return() statement.
+         */
+        if (Op->Asl.Next)
+        {
+            AslError (ASL_WARNING, ASL_MSG_UNREACHABLE_CODE, Op->Asl.Next, NULL);
+        }
+        break;
+
+
+    case PARSEOP_IF:
+
+        if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) &&
+            (Op->Asl.Next) &&
+            (Op->Asl.Next->Asl.ParseOpcode == PARSEOP_ELSE))
+        {
+            /*
+             * This IF has a corresponding ELSE. The IF block has no exit,
+             * (it contains an unconditional Return)
+             * mark the ELSE block to remember this fact.
+             */
+            Op->Asl.Next->Asl.CompileFlags |= NODE_IF_HAS_NO_EXIT;
+        }
+        break;
+
+
+    case PARSEOP_ELSE:
+
+        if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) &&
+            (Op->Asl.CompileFlags & NODE_IF_HAS_NO_EXIT))
+        {
+            /*
+             * This ELSE block has no exit and the corresponding IF block
+             * has no exit either. Therefore, the parent node has no exit.
+             */
+            Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT;
+        }
+        break;
+
+
+    default:
+
+        if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) &&
+            (Op->Asl.Parent))
+        {
+            /* If this node has no exit, then the parent has no exit either */
+
+            Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT;
+        }
+        break;
+    }
+
+    return (AE_OK);
+}
diff --git a/src/acpica/source/compiler/aslnamesp.c b/src/acpica/source/compiler/aslnamesp.c
new file mode 100644
index 0000000..0902c4b
--- /dev/null
+++ b/src/acpica/source/compiler/aslnamesp.c
@@ -0,0 +1,494 @@ 
+/******************************************************************************
+ *
+ * Module Name: aslnamesp - Namespace output file generation
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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 "aslcompiler.h"
+#include "aslcompiler.y.h"
+#include "acnamesp.h"
+
+
+#define _COMPONENT          ACPI_COMPILER
+        ACPI_MODULE_NAME    ("aslnamesp")
+
+/* Local prototypes */
+
+static ACPI_STATUS
+NsDoOneNamespaceObject (
+    ACPI_HANDLE             ObjHandle,
+    UINT32                  Level,
+    void                    *Context,
+    void                    **ReturnValue);
+
+static ACPI_STATUS
+NsDoOnePathname (
+    ACPI_HANDLE             ObjHandle,
+    UINT32                  Level,
+    void                    *Context,
+    void                    **ReturnValue);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    NsSetupNamespaceListing
+ *
+ * PARAMETERS:  Handle          - local file handle
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Set the namespace output file to the input handle
+ *
+ ******************************************************************************/
+
+void
+NsSetupNamespaceListing (
+    void                    *Handle)
+{
+
+    Gbl_NsOutputFlag = TRUE;
+    Gbl_Files[ASL_FILE_NAMESPACE_OUTPUT].Handle = Handle;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    NsDisplayNamespace
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Walk the namespace an display information about each node
+ *              in the tree. Information is written to the optional
+ *              namespace output file.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+NsDisplayNamespace (
+    void)
+{
+    ACPI_STATUS             Status;
+
+
+    if (!Gbl_NsOutputFlag)
+    {
+        return (AE_OK);
+    }
+
+    Gbl_NumNamespaceObjects = 0;
+
+    /* File header */
+
+    FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "Contents of ACPI Namespace\n\n");
+    FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "Count  Depth    Name - Type\n\n");
+
+    /* Walk entire namespace from the root */
+
+    Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+                ACPI_UINT32_MAX, FALSE, NsDoOneNamespaceObject, NULL,
+                NULL, NULL);
+
+    /* Print the full pathname for each namespace node */
+
+    FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\nNamespace pathnames\n\n");
+
+    Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+                ACPI_UINT32_MAX, FALSE, NsDoOnePathname, NULL,
+                NULL, NULL);
+
+    return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    NsDoOneNamespaceObject
+ *
+ * PARAMETERS:  ACPI_WALK_CALLBACK
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Dump a namespace object to the namespace output file.
+ *              Called during the walk of the namespace to dump all objects.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+NsDoOneNamespaceObject (
+    ACPI_HANDLE             ObjHandle,
+    UINT32                  Level,
+    void                    *Context,
+    void                    **ReturnValue)
+{
+    ACPI_NAMESPACE_NODE     *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
+    ACPI_OPERAND_OBJECT     *ObjDesc;
+    ACPI_PARSE_OBJECT       *Op;
+
+
+    Gbl_NumNamespaceObjects++;
+
+    FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%5u  [%u]  %*s %4.4s - %s",
+        Gbl_NumNamespaceObjects, Level, (Level * 3), " ",
+        &Node->Name,
+        AcpiUtGetTypeName (Node->Type));
+
+    Op = Node->Op;
+    ObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node->Object);
+
+    if (!Op)
+    {
+        FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\n");
+        return (AE_OK);
+    }
+
+
+    if ((ObjDesc) &&
+        (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND))
+    {
+        switch (Node->Type)
+        {
+        case ACPI_TYPE_INTEGER:
+
+            FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
+                "       [Initial Value   0x%8.8X%8.8X]",
+                ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
+            break;
+
+
+        case ACPI_TYPE_STRING:
+
+            FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
+                "        [Initial Value   \"%s\"]",
+                ObjDesc->String.Pointer);
+            break;
+
+        default:
+            /* Nothing to do for other types */
+            break;
+        }
+
+    }
+    else
+    {
+        switch (Node->Type)
+        {
+        case ACPI_TYPE_INTEGER:
+
+            if (Op->Asl.ParseOpcode == PARSEOP_NAME)
+            {
+                Op = Op->Asl.Child;
+            }
+            if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG)  ||
+                (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING))
+            {
+                Op = Op->Asl.Next;
+            }
+            FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
+                "       [Initial Value   0x%8.8X%8.8X]",
+                ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));
+            break;
+
+
+        case ACPI_TYPE_STRING:
+
+            if (Op->Asl.ParseOpcode == PARSEOP_NAME)
+            {
+                Op = Op->Asl.Child;
+            }
+            if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG)  ||
+                (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING))
+            {
+                Op = Op->Asl.Next;
+            }
+            FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
+                "        [Initial Value   \"%s\"]",
+                Op->Asl.Value.String);
+            break;
+
+
+        case ACPI_TYPE_LOCAL_REGION_FIELD:
+
+            if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG)  ||
+                (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING))
+            {
+                Op = Op->Asl.Child;
+            }
+            FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
+                "   [Offset 0x%04X   Length 0x%04X bits]",
+                Op->Asl.Parent->Asl.ExtraValue, (UINT32) Op->Asl.Value.Integer);
+            break;
+
+
+        case ACPI_TYPE_BUFFER_FIELD:
+
+            switch (Op->Asl.ParseOpcode)
+            {
+            case PARSEOP_CREATEBYTEFIELD:
+                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "   [BYTE  ( 8 bit)]");
+                break;
+
+            case PARSEOP_CREATEDWORDFIELD:
+                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "   [DWORD (32 bit)]");
+                break;
+
+            case PARSEOP_CREATEQWORDFIELD:
+                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "   [QWORD (64 bit)]");
+                break;
+
+            case PARSEOP_CREATEWORDFIELD:
+                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "   [WORD  (16 bit)]");
+                break;
+
+            case PARSEOP_CREATEBITFIELD:
+                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "   [BIT   ( 1 bit)]");
+                break;
+
+            case PARSEOP_CREATEFIELD:
+                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "   [Arbitrary Bit Field]");
+                break;
+
+            default:
+                break;
+
+            }
+            break;
+
+
+        case ACPI_TYPE_PACKAGE:
+
+            if (Op->Asl.ParseOpcode == PARSEOP_NAME)
+            {
+                Op = Op->Asl.Child;
+            }
+            if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG)  ||
+                (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING))
+            {
+                Op = Op->Asl.Next;
+            }
+            Op = Op->Asl.Child;
+
+            if ((Op->Asl.ParseOpcode == PARSEOP_BYTECONST) ||
+                (Op->Asl.ParseOpcode == PARSEOP_RAW_DATA))
+            {
+                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
+                    "       [Initial Length  0x%.2X elements]",
+                    Op->Asl.Value.Integer);
+            }
+            break;
+
+
+        case ACPI_TYPE_BUFFER:
+
+            if (Op->Asl.ParseOpcode == PARSEOP_NAME)
+            {
+                Op = Op->Asl.Child;
+            }
+            if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG)  ||
+                (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING))
+            {
+                Op = Op->Asl.Next;
+            }
+            Op = Op->Asl.Child;
+
+            if (Op && (Op->Asl.ParseOpcode == PARSEOP_INTEGER))
+            {
+                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
+                    "        [Initial Length  0x%.2X bytes]",
+                    Op->Asl.Value.Integer);
+            }
+            break;
+
+
+        case ACPI_TYPE_METHOD:
+
+            FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
+                "        [Code Length     0x%.4X bytes]",
+                Op->Asl.AmlSubtreeLength);
+            break;
+
+
+        case ACPI_TYPE_LOCAL_RESOURCE:
+
+            FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
+                "  [Desc Offset     0x%.4X Bytes]", Node->Value);
+            break;
+
+
+        case ACPI_TYPE_LOCAL_RESOURCE_FIELD:
+
+            FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
+                "   [Field Offset    0x%.4X Bits 0x%.4X Bytes] ",
+                Node->Value, Node->Value / 8);
+
+            if (Node->Flags & ANOBJ_IS_REFERENCED)
+            {
+                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
+                    "Referenced");
+            }
+            else
+            {
+                FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
+                    "Name not referenced");
+            }
+            break;
+
+
+        default:
+            /* Nothing to do for other types */
+            break;
+        }
+    }
+
+    FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\n");
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    NsDoOnePathname
+ *
+ * PARAMETERS:  ACPI_WALK_CALLBACK
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Print the full pathname for a namespace node.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+NsDoOnePathname (
+    ACPI_HANDLE             ObjHandle,
+    UINT32                  Level,
+    void                    *Context,
+    void                    **ReturnValue)
+{
+    ACPI_NAMESPACE_NODE     *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
+    ACPI_STATUS             Status;
+    ACPI_BUFFER             TargetPath;
+
+
+    TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
+    Status = AcpiNsHandleToPathname (Node, &TargetPath);
+    if (ACPI_FAILURE (Status))
+    {
+        return (Status);
+    }
+
+    FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%s\n", TargetPath.Pointer);
+    ACPI_FREE (TargetPath.Pointer);
+
+    return (AE_OK);
+}
diff --git a/src/acpica/source/compiler/asloffset.c b/src/acpica/source/compiler/asloffset.c
new file mode 100644
index 0000000..22c9ff0
--- /dev/null
+++ b/src/acpica/source/compiler/asloffset.c
@@ -0,0 +1,398 @@ 
+/******************************************************************************
+ *
+ * Module Name: asloffset - Generate a C "offset table" for BIOS use.
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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 "aslcompiler.h"
+#include "aslcompiler.y.h"
+#include "amlcode.h"
+#include "acnamesp.h"
+
+
+#define _COMPONENT          ACPI_COMPILER
+        ACPI_MODULE_NAME    ("asloffset")
+
+
+/* Local prototypes */
+
+static void
+LsEmitOffsetTableEntry (
+    UINT32                  FileId,
+    ACPI_NAMESPACE_NODE     *Node,
+    UINT32                  Offset,
+    UINT32                  Length,
+    char                    *OpName,
+    UINT64                  Value,
+    UINT8                   AmlOpcode);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    LsAmlOffsetWalk
+ *
+ * PARAMETERS:  ASL_WALK_CALLBACK
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Process one node during a offset table file generation.
+ *
+ * Three types of objects are currently emitted to the offset table:
+ *   1) Tagged (named) resource descriptors
+ *   2) Named integer objects with constant integer values
+ *   3) Operation Regions that have constant Offset (address) parameters
+ *
+ * The offset table allows the BIOS to dynamically update the values of these
+ * objects at boot time.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+LsAmlOffsetWalk (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Level,
+    void                    *Context)
+{
+    UINT32                  FileId = (UINT32) ACPI_TO_INTEGER (Context);
+    ACPI_NAMESPACE_NODE     *Node;
+    UINT32                  Length;
+    UINT32                  OffsetOfOpcode;
+    ACPI_PARSE_OBJECT       *AddressOp;
+
+
+    /* Ignore actual data blocks for resource descriptors */
+
+    if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DATA)
+    {
+        return (AE_OK); /* Do NOT update the global AML offset */
+    }
+
+    /* We are only interested in named objects (have a namespace node) */
+
+    Node = Op->Asl.Node;
+    if (!Node)
+    {
+        Gbl_CurrentAmlOffset += Op->Asl.FinalAmlLength;
+        return (AE_OK);
+    }
+
+    /* Named resource descriptor (has a descriptor tag) */
+
+    if ((Node->Type == ACPI_TYPE_LOCAL_RESOURCE) &&
+        (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC))
+    {
+        LsEmitOffsetTableEntry (FileId, Node, Gbl_CurrentAmlOffset,
+            Op->Asl.FinalAmlLength, Op->Asl.ParseOpName, 0, Op->Asl.Extra);
+    }
+
+    /* Named object -- Name (NameString, DataRefObject) */
+
+    else if (Op->Asl.AmlOpcode == AML_NAME_OP)
+    {
+        if (!Op->Asl.Child)
+        {
+            FlPrintFile (FileId, "%s NO CHILD!\n", MsgBuffer);
+            return (AE_OK);
+        }
+
+        Length = Op->Asl.FinalAmlLength;
+
+        /* Get to the NameSeg/NamePath Op (and length of the name) */
+
+        Op = Op->Asl.Child;
+        OffsetOfOpcode = Length + Op->Asl.FinalAmlLength;
+
+        /* Get actual value associated with the name */
+
+        Op = Op->Asl.Next;
+        switch (Op->Asl.AmlOpcode)
+        {
+        /*
+         * We are only interested in integer constants that can be changed
+         * at boot time. Note, the One/Ones/Zero opcodes are considered
+         * non-changeable, so we ignore them here.
+         */
+        case AML_BYTE_OP:
+        case AML_WORD_OP:
+        case AML_DWORD_OP:
+        case AML_QWORD_OP:
+
+            /* The +1/-1 is to handle the integer size prefix (opcode) */
+
+            LsEmitOffsetTableEntry (FileId, Node,
+                (Gbl_CurrentAmlOffset + OffsetOfOpcode + 1),
+                (Op->Asl.FinalAmlLength - 1), Op->Asl.ParseOpName,
+                Op->Asl.Value.Integer, (UINT8) Op->Asl.AmlOpcode);
+            break;
+
+        default:
+            break;
+        }
+
+        Gbl_CurrentAmlOffset += Length;
+        return (AE_OK);
+    }
+
+    /* OperationRegion (NameString, RegionSpace, RegionOffset, RegionLength) */
+
+    else if (Op->Asl.AmlOpcode == AML_REGION_OP)
+    {
+        Length = Op->Asl.FinalAmlLength;
+
+        /* Get the name/namepath node */
+
+        AddressOp = Op->Asl.Child;
+        OffsetOfOpcode = Length + AddressOp->Asl.FinalAmlLength + 1;
+
+        /* Get the SpaceId node, then the Offset (address) node */
+
+        AddressOp = AddressOp->Asl.Next;
+        AddressOp = AddressOp->Asl.Next;
+
+        switch (AddressOp->Asl.AmlOpcode)
+        {
+        /*
+         * We are only interested in integer constants that can be changed
+         * at boot time. Note, the One/Ones/Zero opcodes are considered
+         * non-changeable, so we ignore them here.
+         */
+        case AML_BYTE_OP:
+        case AML_WORD_OP:
+        case AML_DWORD_OP:
+        case AML_QWORD_OP:
+
+            /* The +1/-1 is to handle the integer size prefix (opcode) */
+
+            LsEmitOffsetTableEntry (FileId, Node,
+                (Gbl_CurrentAmlOffset + OffsetOfOpcode + 1),
+                (AddressOp->Asl.FinalAmlLength - 1), Op->Asl.ParseOpName,
+                AddressOp->Asl.Value.Integer, (UINT8) AddressOp->Asl.AmlOpcode);
+
+            Gbl_CurrentAmlOffset += Length;
+            return (AE_OK);
+
+        default:
+            break;
+        }
+    }
+
+    Gbl_CurrentAmlOffset += Op->Asl.FinalAmlLength;
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    LsEmitOffsetTableEntry
+ *
+ * PARAMETERS:  FileId          - ID of current listing file
+ *              Node            - Namespace node associated with the name
+ *              Offset          - Offset of the value within the AML table
+ *              Length          - Length in bytes of the value
+ *              OpName          - Name of the AML opcode
+ *              Value           - Current value of the AML field
+ *              AmlOpcode       - Opcode associated with the field
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Emit a line of the offset table (-so option)
+ *
+ ******************************************************************************/
+
+static void
+LsEmitOffsetTableEntry (
+    UINT32                  FileId,
+    ACPI_NAMESPACE_NODE     *Node,
+    UINT32                  Offset,
+    UINT32                  Length,
+    char                    *OpName,
+    UINT64                  Value,
+    UINT8                   AmlOpcode)
+{
+    ACPI_BUFFER             TargetPath;
+    ACPI_STATUS             Status;
+
+
+    /* Get the full pathname to the namespace node */
+
+    TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
+    Status = AcpiNsHandleToPathname (Node, &TargetPath);
+    if (ACPI_FAILURE (Status))
+    {
+        return;
+    }
+
+    /* [1] - Skip the opening backslash for the path */
+
+    strcpy (MsgBuffer, "\"");
+    strcat (MsgBuffer, &((char *) TargetPath.Pointer)[1]);
+    strcat (MsgBuffer, "\",");
+    ACPI_FREE (TargetPath.Pointer);
+
+    /*
+     * Max offset is 4G, constrained by 32-bit ACPI table length.
+     * Max Length for Integers is 8 bytes.
+     */
+    FlPrintFile (FileId,
+        "    {%-29s 0x%8.8X, 0x%2.2X, 0x%8.8X%8.8X}, /* %s */\n",
+        MsgBuffer, Offset, AmlOpcode, ACPI_FORMAT_UINT64 (Value), OpName);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    LsDoOffsetTableHeader, LsDoOffsetTableFooter
+ *
+ * PARAMETERS:  FileId          - ID of current listing file
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Header and footer for the offset table file.
+ *
+ ******************************************************************************/
+
+void
+LsDoOffsetTableHeader (
+    UINT32                  FileId)
+{
+
+    Gbl_CurrentAmlOffset = 0;
+
+    FlPrintFile (FileId,
+        "#ifndef __AML_OFFSET_TABLE_H\n"
+        "#define __AML_OFFSET_TABLE_H\n\n");
+
+    FlPrintFile (FileId, "typedef struct {\n"
+        "    char                   *Pathname;\n"
+        "    unsigned long          Offset;\n"
+        "    unsigned char          AmlOpcode;\n"
+        "    unsigned long long     AmlValue;\n"
+        "} AML_OFFSET_TABLE_ENTRY;\n\n");
+
+    FlPrintFile (FileId,
+        "#endif /* __AML_OFFSET_TABLE_H */\n\n");
+
+    FlPrintFile (FileId,
+        "AML_OFFSET_TABLE_ENTRY   %s_%s_OffsetTable[] =\n{\n",
+        Gbl_TableSignature, Gbl_TableId);
+}
+
+
+void
+LsDoOffsetTableFooter (
+    UINT32                  FileId)
+{
+
+    FlPrintFile (FileId,
+        "    {0,0,0,0} /* Table terminator */\n};\n\n");
+    Gbl_CurrentAmlOffset = 0;
+}
diff --git a/src/acpica/source/compiler/aslopcodes.c b/src/acpica/source/compiler/aslopcodes.c
index cddc945..2075037 100644
--- a/src/acpica/source/compiler/aslopcodes.c
+++ b/src/acpica/source/compiler/aslopcodes.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslopcode - AML opcode generation
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -260,10 +259,10 @@  OpcGetIntegerWidth (
  *
  * PARAMETERS:  Op        - A parse tree node
  *
- * RETURN:      Integer width, in bytes.  Also sets the node AML opcode to the
+ * RETURN:      Integer width, in bytes. Also sets the node AML opcode to the
  *              optimal integer AML prefix opcode.
  *
- * DESCRIPTION: Determine the optimal AML encoding of an integer.  All leading
+ * DESCRIPTION: Determine the optimal AML encoding of an integer. All leading
  *              zeros can be truncated to squeeze the integer into the
  *              minimal number of AML bytes.
  *
@@ -283,7 +282,7 @@  OpcSetOptimalIntegerSize (
         Op->Asl.Parent->Asl.Parent &&
        (Op->Asl.Parent->Asl.Parent->Asl.ParseOpcode == PARSEOP_DEFINITIONBLOCK))
     {
-        return 0;
+        return (0);
     }
 #endif
 
@@ -303,14 +302,14 @@  OpcSetOptimalIntegerSize (
             Op->Asl.AmlOpcode = AML_ZERO_OP;
             AslError (ASL_OPTIMIZATION, ASL_MSG_INTEGER_OPTIMIZATION,
                 Op, "Zero");
-            return 1;
+            return (1);
 
         case 1:
 
             Op->Asl.AmlOpcode = AML_ONE_OP;
             AslError (ASL_OPTIMIZATION, ASL_MSG_INTEGER_OPTIMIZATION,
                 Op, "One");
-            return 1;
+            return (1);
 
         case ACPI_UINT32_MAX:
 
@@ -321,7 +320,7 @@  OpcSetOptimalIntegerSize (
                 Op->Asl.AmlOpcode = AML_ONES_OP;
                 AslError (ASL_OPTIMIZATION, ASL_MSG_INTEGER_OPTIMIZATION,
                     Op, "Ones");
-                return 1;
+                return (1);
             }
             break;
 
@@ -334,7 +333,7 @@  OpcSetOptimalIntegerSize (
                 Op->Asl.AmlOpcode = AML_ONES_OP;
                 AslError (ASL_OPTIMIZATION, ASL_MSG_INTEGER_OPTIMIZATION,
                     Op, "Ones");
-                return 1;
+                return (1);
             }
             break;
 
@@ -348,17 +347,17 @@  OpcSetOptimalIntegerSize (
     if (Op->Asl.Value.Integer <= ACPI_UINT8_MAX)
     {
         Op->Asl.AmlOpcode = AML_BYTE_OP;
-        return 1;
+        return (1);
     }
     if (Op->Asl.Value.Integer <= ACPI_UINT16_MAX)
     {
         Op->Asl.AmlOpcode = AML_WORD_OP;
-        return 2;
+        return (2);
     }
     if (Op->Asl.Value.Integer <= ACPI_UINT32_MAX)
     {
         Op->Asl.AmlOpcode = AML_DWORD_OP;
-        return 4;
+        return (4);
     }
     else
     {
@@ -371,12 +370,12 @@  OpcSetOptimalIntegerSize (
             {
                 /* Truncate the integer to 32-bit */
                 Op->Asl.AmlOpcode = AML_DWORD_OP;
-                return 4;
+                return (4);
             }
         }
 
         Op->Asl.AmlOpcode = AML_QWORD_OP;
-        return 8;
+        return (8);
     }
 }
 
@@ -531,7 +530,7 @@  OpcDoConnection (
  * RETURN:      None
  *
  * DESCRIPTION: Implement the UNICODE ASL "macro".  Convert the input string
- *              to a unicode buffer.  There is no Unicode AML opcode.
+ *              to a unicode buffer. There is no Unicode AML opcode.
  *
  * Note:  The Unicode string is 16 bits per character, no leading signature,
  *        with a 16-bit terminating NULL.
@@ -607,19 +606,19 @@  OpcDoUnicode (
  *
  * RETURN:      None
  *
- * DESCRIPTION: Convert a string EISA ID to numeric representation.  See the
- *              Pnp BIOS Specification for details.  Here is an excerpt:
+ * DESCRIPTION: Convert a string EISA ID to numeric representation. See the
+ *              Pnp BIOS Specification for details. Here is an excerpt:
  *
  *              A seven character ASCII representation of the product
- *              identifier compressed into a 32-bit identifier.  The seven
+ *              identifier compressed into a 32-bit identifier. The seven
  *              character ID consists of a three character manufacturer code,
  *              a three character hexadecimal product identifier, and a one
- *              character hexadecimal revision number.  The manufacturer code
+ *              character hexadecimal revision number. The manufacturer code
  *              is a 3 uppercase character code that is compressed into 3 5-bit
  *              values as follows:
  *                  1) Find hex ASCII value for each letter
  *                  2) Subtract 40h from each ASCII value
- *                  3) Retain 5 least signficant bits for each letter by
+ *                  3) Retain 5 least significant bits for each letter by
  *                     discarding upper 3 bits because they are always 0.
  *                  4) Compressed code = concatenate 0 and the 3 5-bit values
  *
@@ -798,7 +797,7 @@  OpcDoUuId (
  * RETURN:      None
  *
  * DESCRIPTION: Generate the AML opcode associated with the node and its
- *              parse (lex/flex) keyword opcode.  Essentially implements
+ *              parse (lex/flex) keyword opcode. Essentially implements
  *              a mapping between the parse opcodes and the actual AML opcodes.
  *
  ******************************************************************************/
@@ -875,6 +874,14 @@  OpcGenerateAmlOpcode (
         Op->Asl.Child->Asl.Next->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
         break;
 
+    case PARSEOP_TIMER:
+
+        if (AcpiGbl_IntegerBitWidth == 32)
+        {
+            AslError (ASL_REMARK, ASL_MSG_TRUNCATION, Op, NULL);
+        }
+        break;
+
     default:
         /* Nothing to do for other opcodes */
         break;
@@ -882,5 +889,3 @@  OpcGenerateAmlOpcode (
 
     return;
 }
-
-
diff --git a/src/acpica/source/compiler/asloperands.c b/src/acpica/source/compiler/asloperands.c
index cc65d24..8f26559 100644
--- a/src/acpica/source/compiler/asloperands.c
+++ b/src/acpica/source/compiler/asloperands.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: asloperands - AML operand processing
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -254,6 +253,10 @@  OpnDoMethod (
     Next = Next->Asl.Next;
     if (Next->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
     {
+        /* This is a ByteConstExpr, so eval the constant now */
+
+        OpcAmlConstantWalk (Next, 0, NULL);
+
         if (Next->Asl.Value.Integer > 15)
         {
             AslError (ASL_ERROR, ASL_MSG_SYNC_LEVEL, Next, NULL);
@@ -331,7 +334,7 @@  OpnDoFieldCommon (
     UpdateRule = (UINT8) Next->Asl.Value.Integer;
 
     /*
-     * Generate the flags byte.  The various fields are already
+     * Generate the flags byte. The various fields are already
      * in the right bit position via translation from the
      * keywords by the parser.
      */
@@ -394,7 +397,7 @@  OpnDoFieldCommon (
             {
                 /*
                  * Offset is redundant; we don't need to output an
-                 * offset opcode.  Just set these nodes to default
+                 * offset opcode. Just set these nodes to default
                  */
                 Next->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
                 PkgLengthNode->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
@@ -570,7 +573,7 @@  OpnDoBankField (
  *
  * RETURN:      None
  *
- * DESCRIPTION: Tries to get the length of the region.  Can only do this at
+ * DESCRIPTION: Tries to get the length of the region. Can only do this at
  *              compile time if the length is a constant.
  *
  ******************************************************************************/
@@ -617,7 +620,7 @@  OpnDoRegion (
  *
  * RETURN:      None
  *
- * DESCRIPTION: Construct the AML operands for the BUFFER ASL keyword.  We
+ * DESCRIPTION: Construct the AML operands for the BUFFER ASL keyword. We
  *              build a single raw byte buffer from the initialization nodes,
  *              each parse node contains a buffer byte.
  *
@@ -683,7 +686,7 @@  OpnDoBuffer (
     case PARSEOP_STRING_LITERAL:
 
         /*
-         * Only one initializer, the string.  Buffer must be big enough to hold
+         * Only one initializer, the string. Buffer must be big enough to hold
          * the string plus the null termination byte
          */
         BufferLength = strlen (InitializerOp->Asl.Value.String) + 1;
@@ -750,7 +753,7 @@  OpnDoBuffer (
  *
  * RETURN:      None
  *
- * DESCRIPTION: Construct the AML operands for the PACKAGE ASL keyword.  NOTE:
+ * DESCRIPTION: Construct the AML operands for the PACKAGE ASL keyword. NOTE:
  *              can only be called after constants have been folded, to ensure
  *              that the PackageLength operand has been fully reduced.
  *
@@ -966,7 +969,7 @@  OpnDoDefinitionBlock (
 
 
     /*
-     * These nodes get stuffed into the table header.  They are special
+     * These nodes get stuffed into the table header. They are special
      * cased when the table is written to the output file.
      *
      * Mark all of these nodes as non-usable so they won't get output
@@ -1066,7 +1069,7 @@  OpnDoDefinitionBlock (
  * PARAMETERS:  Op              - Get an argument for this op
  *              Argn            - Nth argument to get
  *
- * RETURN:      The argument (as an Op object).  NULL if argument does not exist
+ * RETURN:      The argument (as an Op object). NULL if argument does not exist
  *
  * DESCRIPTION: Get the specified op's argument (peer)
  *
@@ -1179,7 +1182,7 @@  OpnAttachNameToNode (
  *
  * RETURN:      None
  *
- * DESCRIPTION: Prepare nodes to be output as AML data and operands.  The more
+ * DESCRIPTION: Prepare nodes to be output as AML data and operands. The more
  *              complex AML opcodes require processing of the child nodes
  *              (arguments/operands).
  *
@@ -1252,5 +1255,3 @@  OpnGenerateAmlOperands (
 
     OpnAttachNameToNode (Op);
 }
-
-
diff --git a/src/acpica/source/compiler/aslopt.c b/src/acpica/source/compiler/aslopt.c
index 8080a70..535d7b0 100644
--- a/src/acpica/source/compiler/aslopt.c
+++ b/src/acpica/source/compiler/aslopt.c
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -199,9 +199,9 @@  OptSearchToRoot (
 
 
     /*
-     * Check if search-to-root can be utilized.  Use the last NameSeg of
+     * Check if search-to-root can be utilized. Use the last NameSeg of
      * the NamePath and 1) See if can be found and 2) If found, make
-     * sure that it is the same node that we want.  If there is another
+     * sure that it is the same node that we want. If there is another
      * name in the search path before the one we want, the nodes will
      * not match, and we cannot use this optimization.
      */
@@ -221,7 +221,7 @@  OptSearchToRoot (
 
     /*
      * We found the name, but we must check to make sure that the node
-     * matches.  Otherwise, there is another identical name in the search
+     * matches. Otherwise, there is another identical name in the search
      * path that precludes the use of this optimization.
      */
     if (Node != TargetNode)
@@ -305,7 +305,7 @@  OptBuildShortestPath (
 
     /*
      * Determine the maximum number of NameSegs that the Target and Current paths
-     * can possibly have in common.  (To optimize, we have to have at least 1)
+     * can possibly have in common. (To optimize, we have to have at least 1)
      *
      * Note: The external NamePath string lengths are always a multiple of 5
      * (ACPI_NAME_SIZE + separator)
@@ -326,12 +326,11 @@  OptBuildShortestPath (
     {
         /* Compare two single NameSegs */
 
-        if (ACPI_STRNCMP (
-            &((char *) TargetPath->Pointer)[(NumCommonSegments *
-                                             ACPI_PATH_SEGMENT_LENGTH) + 1],
-            &((char *) CurrentPath->Pointer)[(NumCommonSegments *
-                                              ACPI_PATH_SEGMENT_LENGTH) + 1],
-            ACPI_NAME_SIZE))
+        if (!ACPI_COMPARE_NAME (
+            &((char *) TargetPath->Pointer)[
+                (NumCommonSegments * ACPI_PATH_SEGMENT_LENGTH) + 1],
+            &((char *) CurrentPath->Pointer)[
+                (NumCommonSegments * ACPI_PATH_SEGMENT_LENGTH) + 1]))
         {
             /* Mismatch */
 
@@ -378,7 +377,7 @@  OptBuildShortestPath (
 
     for (i = 0; i < NumCarats; i++)
     {
-        NewPathExternal[i] = '^';
+        NewPathExternal[i] = AML_PARENT_PREFIX;
     }
 
     /*
@@ -402,7 +401,7 @@  OptBuildShortestPath (
 
         if (Op->Asl.AmlOpcode == AML_SCOPE_OP)
         {
-            NewPathExternal[i] = '^';
+            NewPathExternal[i] = AML_PARENT_PREFIX;
             i++;
             ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "(EXTRA ^)"));
         }
@@ -443,7 +442,7 @@  OptBuildShortestPath (
 
     /*
      * Check to make sure that the optimization finds the node we are
-     * looking for.  This is simply a sanity check on the new
+     * looking for. This is simply a sanity check on the new
      * path that has been created.
      */
     Status = AcpiNsLookup (&ScopeInfo,  NewPath,
@@ -513,7 +512,6 @@  OptOptimizeNameDeclaration (
 {
     ACPI_STATUS             Status;
     char                    *NewPathExternal;
-    ACPI_GENERIC_STATE      ScopeInfo;
     ACPI_NAMESPACE_NODE     *Node;
 
 
@@ -522,11 +520,11 @@  OptOptimizeNameDeclaration (
 
     if (((CurrentNode == AcpiGbl_RootNode) ||
         (Op->Common.Parent->Asl.ParseOpcode == PARSEOP_DEFINITIONBLOCK)) &&
-            (AmlNameString[0] == '\\'))
+            (ACPI_IS_ROOT_PREFIX (AmlNameString[0])))
     {
         /*
          * The current scope is the root, and the namepath has a root prefix
-         * that is therefore extraneous.  Remove it.
+         * that is therefore extraneous. Remove it.
          */
         *NewPath = &AmlNameString[1];
 
@@ -543,11 +541,12 @@  OptOptimizeNameDeclaration (
 
         /*
          * Check to make sure that the optimization finds the node we are
-         * looking for.  This is simply a sanity check on the new
+         * looking for. This is simply a sanity check on the new
          * path that has been created.
+         *
+         * We know that we are at the root, so NULL is used for the scope.
          */
-        ScopeInfo.Scope.Node = CurrentNode;
-        Status = AcpiNsLookup (&ScopeInfo, *NewPath,
+        Status = AcpiNsLookup (NULL, *NewPath,
                         ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
                         ACPI_NS_DONT_OPEN_SCOPE, WalkState, &(Node));
         if (ACPI_SUCCESS (Status))
@@ -605,7 +604,7 @@  OptOptimizeNameDeclaration (
  *              AmlNameString       - Unoptimized namepath
  *              TargetNode          - Node to which AmlNameString refers
  *
- * RETURN:      None.  If path is optimized, the Op is updated with new path
+ * RETURN:      None. If path is optimized, the Op is updated with new path
  *
  * DESCRIPTION: Optimize a Named Declaration or Reference to the minimal length.
  *              Must take into account both the current location in the
@@ -680,7 +679,7 @@  OptOptimizeNamePath (
 
     /*
      * We need to obtain the node that represents the current scope -- where
-     * we are right now in the namespace.  We will compare this path
+     * we are right now in the namespace. We will compare this path
      * against the Namepath, looking for commonality.
      */
     CurrentNode = AcpiGbl_RootNode;
@@ -696,11 +695,21 @@  OptOptimizeNamePath (
         ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "NAME"));
 
         /*
-         * The node of interest is the parent of this node
-         * (the containing scope)
+         * The node of interest is the parent of this node (the containing
+         * scope). The actual namespace node may be up more than one level
+         * of parse op or it may not exist at all (if we traverse back
+         * up to the root.)
          */
-        CurrentNode = Op->Asl.Parent->Asl.Node;
-        if (!CurrentNode)
+        NextOp = Op->Asl.Parent;
+        while (NextOp && (!NextOp->Asl.Node))
+        {
+            NextOp = NextOp->Asl.Parent;
+        }
+        if (NextOp && NextOp->Asl.Node)
+        {
+            CurrentNode = NextOp->Asl.Node;
+        }
+        else
         {
             CurrentNode = AcpiGbl_RootNode;
         }
@@ -803,7 +812,7 @@  OptOptimizeNamePath (
 
     /*
      * Success from above indicates that the NamePath was successfully
-     * optimized.  We need to update the parse op with the new name
+     * optimized. We need to update the parse op with the new name
      */
     if (ACPI_SUCCESS (Status))
     {
@@ -865,4 +874,3 @@  OptOptimizeNamePath (
     ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "\n"));
     return_VOID;
 }
-
diff --git a/src/acpica/source/compiler/aslpredef.c b/src/acpica/source/compiler/aslpredef.c
index 01c8eac..6d28bbf 100644
--- a/src/acpica/source/compiler/aslpredef.c
+++ b/src/acpica/source/compiler/aslpredef.c
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -114,10 +114,12 @@ 
  *****************************************************************************/
 
 #define ACPI_CREATE_PREDEFINED_TABLE
+#define ACPI_CREATE_RESOURCE_TABLE
 
 #include "aslcompiler.h"
 #include "aslcompiler.y.h"
 #include "acpredef.h"
+#include "acnamesp.h"
 
 
 #define _COMPONENT          ACPI_COMPILER
@@ -136,95 +138,6 @@  ApCheckForSpecialName (
     ACPI_PARSE_OBJECT       *Op,
     char                    *Name);
 
-static void
-ApCheckObjectType (
-    ACPI_PARSE_OBJECT       *Op,
-    UINT32                  ExpectedBtypes);
-
-static void
-ApGetExpectedTypes (
-    char                    *Buffer,
-    UINT32                  ExpectedBtypes);
-
-
-/*
- * Names for the types that can be returned by the predefined objects.
- * Used for warning messages. Must be in the same order as the ACPI_RTYPEs
- */
-static const char   *AcpiRtypeNames[] =
-{
-    "/Integer",
-    "/String",
-    "/Buffer",
-    "/Package",
-    "/Reference",
-};
-
-/*
- * Predefined names for use in Resource Descriptors. These names do not
- * appear in the global Predefined Name table (since these names never
- * appear in actual AML byte code, only in the original ASL)
- */
-static const ACPI_PREDEFINED_INFO      ResourceNames[] = {
-    {{"_ALN",     0,      0}},
-    {{"_ASI",     0,      0}},
-    {{"_ASZ",     0,      0}},
-    {{"_ATT",     0,      0}},
-    {{"_BAS",     0,      0}},
-    {{"_BM_",     0,      0}},
-    {{"_DBT",     0,      0}},  /* Acpi 5.0 */
-    {{"_DEC",     0,      0}},
-    {{"_DPL",     0,      0}},  /* Acpi 5.0 */
-    {{"_DRS",     0,      0}},  /* Acpi 5.0 */
-    {{"_END",     0,      0}},  /* Acpi 5.0 */
-    {{"_FLC",     0,      0}},  /* Acpi 5.0 */
-    {{"_GRA",     0,      0}},
-    {{"_HE_",     0,      0}},
-    {{"_INT",     0,      0}},
-    {{"_IOR",     0,      0}},  /* Acpi 5.0 */
-    {{"_LEN",     0,      0}},
-    {{"_LIN",     0,      0}},  /* Acpi 5.0 */
-    {{"_LL_",     0,      0}},
-    {{"_MAF",     0,      0}},
-    {{"_MAX",     0,      0}},
-    {{"_MEM",     0,      0}},
-    {{"_MIF",     0,      0}},
-    {{"_MIN",     0,      0}},
-    {{"_MOD",     0,      0}},  /* Acpi 5.0 */
-    {{"_MTP",     0,      0}},
-    {{"_PAR",     0,      0}},  /* Acpi 5.0 */
-    {{"_PHA",     0,      0}},  /* Acpi 5.0 */
-    {{"_PIN",     0,      0}},  /* Acpi 5.0 */
-    {{"_PPI",     0,      0}},  /* Acpi 5.0 */
-    {{"_POL",     0,      0}},  /* Acpi 5.0 */
-    {{"_RBO",     0,      0}},
-    {{"_RBW",     0,      0}},
-    {{"_RNG",     0,      0}},
-    {{"_RT_",     0,      0}},  /* Acpi 3.0 */
-    {{"_RW_",     0,      0}},
-    {{"_RXL",     0,      0}},  /* Acpi 5.0 */
-    {{"_SHR",     0,      0}},
-    {{"_SIZ",     0,      0}},
-    {{"_SLV",     0,      0}},  /* Acpi 5.0 */
-    {{"_SPE",     0,      0}},  /* Acpi 5.0 */
-    {{"_STB",     0,      0}},  /* Acpi 5.0 */
-    {{"_TRA",     0,      0}},
-    {{"_TRS",     0,      0}},
-    {{"_TSF",     0,      0}},  /* Acpi 3.0 */
-    {{"_TTP",     0,      0}},
-    {{"_TXL",     0,      0}},  /* Acpi 5.0 */
-    {{"_TYP",     0,      0}},
-    {{"_VEN",     0,      0}},  /* Acpi 5.0 */
-    {{{0,0,0,0},  0,      0}}   /* Table terminator */
-};
-
-static const ACPI_PREDEFINED_INFO      ScopeNames[] = {
-    {{"_SB_",     0,      0}},
-    {{"_SI_",     0,      0}},
-    {{"_TZ_",     0,      0}},
-    {{{0,0,0,0},  0,      0}}   /* Table terminator */
-};
-
 
 /*******************************************************************************
  *
@@ -246,9 +159,9 @@  ApCheckForPredefinedMethod (
     ACPI_PARSE_OBJECT       *Op,
     ASL_METHOD_INFO         *MethodInfo)
 {
-    UINT32                  Index;
-    UINT32                  RequiredArgsCurrent;
-    UINT32                  RequiredArgsOld;
+    UINT32                      Index;
+    UINT32                      RequiredArgCount;
+    const ACPI_PREDEFINED_INFO  *ThisName;
 
 
     /* Check for a match against the predefined name list */
@@ -283,30 +196,30 @@  ApCheckForPredefinedMethod (
 
     default:
         /*
-         * Matched a predefined method name
+         * Matched a predefined method name - validate the ASL-defined
+         * argument count against the ACPI specification.
          *
-         * Validate the ASL-defined argument count. Allow two different legal
-         * arg counts.
+         * Some methods are allowed to have a "minimum" number of args
+         * (_SCP) because their definition in ACPI has changed over time.
          */
         Gbl_ReservedMethods++;
+        ThisName = &AcpiGbl_PredefinedMethods[Index];
+        RequiredArgCount = METHOD_GET_ARG_COUNT (ThisName->Info.ArgumentList);
 
-        RequiredArgsCurrent = PredefinedNames[Index].Info.ParamCount & 0x0F;
-        RequiredArgsOld = PredefinedNames[Index].Info.ParamCount >> 4;
-
-        if ((MethodInfo->NumArguments != RequiredArgsCurrent) &&
-            (MethodInfo->NumArguments != RequiredArgsOld))
+        if (MethodInfo->NumArguments != RequiredArgCount)
         {
             sprintf (MsgBuffer, "%4.4s requires %u",
-                PredefinedNames[Index].Info.Name, RequiredArgsCurrent);
+                ThisName->Info.Name, RequiredArgCount);
 
-            if (MethodInfo->NumArguments > RequiredArgsCurrent)
+            if (MethodInfo->NumArguments < RequiredArgCount)
             {
-                AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op,
+                AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_LO, Op,
                     MsgBuffer);
             }
-            else
+            else if ((MethodInfo->NumArguments > RequiredArgCount) &&
+                !(ThisName->Info.ArgumentList & ARG_COUNT_IS_MINIMUM))
             {
-                AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_LO, Op,
+                AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op,
                     MsgBuffer);
             }
         }
@@ -316,13 +229,13 @@  ApCheckForPredefinedMethod (
          * required to return a value
          */
         if (MethodInfo->NumReturnNoValue &&
-            PredefinedNames[Index].Info.ExpectedBtypes)
+            ThisName->Info.ExpectedBtypes)
         {
-            ApGetExpectedTypes (StringBuffer,
-                PredefinedNames[Index].Info.ExpectedBtypes);
+            AcpiUtGetExpectedReturnTypes (StringBuffer,
+                ThisName->Info.ExpectedBtypes);
 
             sprintf (MsgBuffer, "%s required for %4.4s",
-                StringBuffer, PredefinedNames[Index].Info.Name);
+                StringBuffer, ThisName->Info.Name);
 
             AslError (ASL_WARNING, ASL_MSG_RESERVED_RETURN_VALUE, Op,
                 MsgBuffer);
@@ -405,8 +318,9 @@  ApCheckPredefinedReturnValue (
     ACPI_PARSE_OBJECT       *Op,
     ASL_METHOD_INFO         *MethodInfo)
 {
-    UINT32                  Index;
-    ACPI_PARSE_OBJECT       *ReturnValueOp;
+    UINT32                      Index;
+    ACPI_PARSE_OBJECT           *ReturnValueOp;
+    const ACPI_PREDEFINED_INFO  *ThisName;
 
 
     /* Check parent method for a match against the predefined name list */
@@ -432,7 +346,8 @@  ApCheckPredefinedReturnValue (
 
     default: /* A standard predefined ACPI name */
 
-        if (!PredefinedNames[Index].Info.ExpectedBtypes)
+        ThisName = &AcpiGbl_PredefinedMethods[Index];
+        if (!ThisName->Info.ExpectedBtypes)
         {
             /* No return value expected, warn if there is one */
 
@@ -455,8 +370,15 @@  ApCheckPredefinedReturnValue (
 
             /* Static data return object - check against expected type */
 
-            ApCheckObjectType (ReturnValueOp,
-                PredefinedNames[Index].Info.ExpectedBtypes);
+            ApCheckObjectType (ThisName->Info.Name, ReturnValueOp,
+                ThisName->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT);
+
+            /* For packages, check the individual package elements */
+
+            if (ReturnValueOp->Asl.ParseOpcode == PARSEOP_PACKAGE)
+            {
+                ApCheckPackage (ReturnValueOp, ThisName);
+            }
             break;
 
         default:
@@ -497,7 +419,9 @@  ApCheckForPredefinedObject (
     ACPI_PARSE_OBJECT       *Op,
     char                    *Name)
 {
-    UINT32                  Index;
+    UINT32                      Index;
+    ACPI_PARSE_OBJECT           *ObjectOp;
+    const ACPI_PREDEFINED_INFO  *ThisName;
 
 
     /*
@@ -526,38 +450,49 @@  ApCheckForPredefinedObject (
             "with zero arguments");
         return;
 
-    default: /* A standard predefined ACPI name */
-
-        /*
-         * If this predefined name requires input arguments, then
-         * it must be implemented as a control method
-         */
-        if (PredefinedNames[Index].Info.ParamCount > 0)
-        {
-            AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
-                "with arguments");
-            return;
-        }
+    default:
+        break;
+    }
 
-        /*
-         * If no return value is expected from this predefined name, then
-         * it follows that it must be implemented as a control method
-         * (with zero args, because the args > 0 case was handled above)
-         * Examples are: _DIS, _INI, _IRC, _OFF, _ON, _PSx
-         */
-        if (!PredefinedNames[Index].Info.ExpectedBtypes)
-        {
-            AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
-                "with zero arguments");
-            return;
-        }
+    /* A standard predefined ACPI name */
 
-        /* Typecheck the actual object, it is the next argument */
+    /*
+     * If this predefined name requires input arguments, then
+     * it must be implemented as a control method
+     */
+    ThisName = &AcpiGbl_PredefinedMethods[Index];
+    if (METHOD_GET_ARG_COUNT (ThisName->Info.ArgumentList) > 0)
+    {
+        AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
+            "with arguments");
+        return;
+    }
 
-        ApCheckObjectType (Op->Asl.Child->Asl.Next,
-            PredefinedNames[Index].Info.ExpectedBtypes);
+    /*
+     * If no return value is expected from this predefined name, then
+     * it follows that it must be implemented as a control method
+     * (with zero args, because the args > 0 case was handled above)
+     * Examples are: _DIS, _INI, _IRC, _OFF, _ON, _PSx
+     */
+    if (!ThisName->Info.ExpectedBtypes)
+    {
+        AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
+            "with zero arguments");
         return;
     }
+
+    /* Typecheck the actual object, it is the next argument */
+
+    ObjectOp = Op->Asl.Child->Asl.Next;
+    ApCheckObjectType (ThisName->Info.Name, Op->Asl.Child->Asl.Next,
+        ThisName->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT);
+
+    /* For packages, check the individual package elements */
+
+    if (ObjectOp->Asl.ParseOpcode == PARSEOP_PACKAGE)
+    {
+        ApCheckPackage (ObjectOp, ThisName);
+    }
 }
 
 
@@ -579,7 +514,8 @@  ApCheckForPredefinedName (
     ACPI_PARSE_OBJECT       *Op,
     char                    *Name)
 {
-    UINT32                  i;
+    UINT32                      i;
+    const ACPI_PREDEFINED_INFO  *ThisName;
 
 
     if (Name[0] == 0)
@@ -597,31 +533,40 @@  ApCheckForPredefinedName (
 
     /* Check for a standard predefined method name */
 
-    for (i = 0; PredefinedNames[i].Info.Name[0]; i++)
+    ThisName = AcpiGbl_PredefinedMethods;
+    for (i = 0; ThisName->Info.Name[0]; i++)
     {
-        if (ACPI_COMPARE_NAME (Name, PredefinedNames[i].Info.Name))
+        if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
         {
             /* Return index into predefined array */
             return (i);
         }
+
+        ThisName++; /* Does not account for extra package data, but is OK */
     }
 
     /* Check for resource names and predefined scope names */
 
-    for (i = 0; ResourceNames[i].Info.Name[0]; i++)
+    ThisName = AcpiGbl_ResourceNames;
+    while (ThisName->Info.Name[0])
     {
-        if (ACPI_COMPARE_NAME (Name, ResourceNames[i].Info.Name))
+        if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
         {
             return (ACPI_PREDEFINED_NAME);
         }
+
+        ThisName++;
     }
 
-    for (i = 0; ScopeNames[i].Info.Name[0]; i++)
+    ThisName = AcpiGbl_ScopeNames;
+    while (ThisName->Info.Name[0])
     {
-        if (ACPI_COMPARE_NAME (Name, ScopeNames[i].Info.Name))
+        if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
         {
             return (ACPI_PREDEFINED_NAME);
         }
+
+        ThisName++;
     }
 
     /* Check for _Lxx/_Exx/_Wxx/_Qxx/_T_x. Warning if unknown predefined name */
@@ -712,8 +657,12 @@  ApCheckForSpecialName (
  *
  * FUNCTION:    ApCheckObjectType
  *
- * PARAMETERS:  Op              - Current parse node
+ * PARAMETERS:  PredefinedName  - Name of the predefined object we are checking
+ *              Op              - Current parse node
  *              ExpectedBtypes  - Bitmap of expected return type(s)
+ *              PackageIndex    - Index of object within parent package (if
+ *                                applicable - ACPI_NOT_PACKAGE_ELEMENT
+ *                                otherwise)
  *
  * RETURN:      None
  *
@@ -723,13 +672,23 @@  ApCheckForSpecialName (
  *
  ******************************************************************************/
 
-static void
+ACPI_STATUS
 ApCheckObjectType (
+    const char              *PredefinedName,
     ACPI_PARSE_OBJECT       *Op,
-    UINT32                  ExpectedBtypes)
+    UINT32                  ExpectedBtypes,
+    UINT32                  PackageIndex)
 {
     UINT32                  ReturnBtype;
+    char                    *TypeName;
+
+
+    if (!Op)
+    {
+        return (AE_TYPE);
+    }
 
+    /* Map the parse opcode to a bitmapped return type (RTYPE) */
 
     switch (Op->Asl.ParseOpcode)
     {
@@ -738,24 +697,35 @@  ApCheckObjectType (
     case PARSEOP_ONES:
     case PARSEOP_INTEGER:
         ReturnBtype = ACPI_RTYPE_INTEGER;
-        break;
-
-    case PARSEOP_BUFFER:
-        ReturnBtype = ACPI_RTYPE_BUFFER;
+        TypeName = "Integer";
         break;
 
     case PARSEOP_STRING_LITERAL:
         ReturnBtype = ACPI_RTYPE_STRING;
+        TypeName = "String";
+        break;
+
+    case PARSEOP_BUFFER:
+        ReturnBtype = ACPI_RTYPE_BUFFER;
+        TypeName = "Buffer";
         break;
 
     case PARSEOP_PACKAGE:
     case PARSEOP_VAR_PACKAGE:
         ReturnBtype = ACPI_RTYPE_PACKAGE;
+        TypeName = "Package";
+        break;
+
+    case PARSEOP_NAMESEG:
+    case PARSEOP_NAMESTRING:
+        ReturnBtype = ACPI_RTYPE_REFERENCE;
+        TypeName = "Reference";
         break;
 
     default:
         /* Not one of the supported object types */
 
+        TypeName = UtGetOpName (Op->Asl.ParseOpcode);
         goto TypeErrorExit;
     }
 
@@ -763,7 +733,7 @@  ApCheckObjectType (
 
     if (ReturnBtype & ExpectedBtypes)
     {
-        return;
+        return (AE_OK);
     }
 
 
@@ -771,13 +741,21 @@  TypeErrorExit:
 
     /* Format the expected types and emit an error message */
 
-    ApGetExpectedTypes (StringBuffer, ExpectedBtypes);
+    AcpiUtGetExpectedReturnTypes (StringBuffer, ExpectedBtypes);
 
-    sprintf (MsgBuffer, "found %s, requires %s",
-        UtGetOpName (Op->Asl.ParseOpcode), StringBuffer);
+    if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
+    {
+        sprintf (MsgBuffer, "%4.4s: found %s, %s required",
+            PredefinedName, TypeName, StringBuffer);
+    }
+    else
+    {
+        sprintf (MsgBuffer, "%4.4s: found %s at index %u, %s required",
+            PredefinedName, TypeName, PackageIndex, StringBuffer);
+    }
 
-    AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op,
-        MsgBuffer);
+    AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op, MsgBuffer);
+    return (AE_TYPE);
 }
 
 
@@ -799,8 +777,8 @@  ApDisplayReservedNames (
     void)
 {
     const ACPI_PREDEFINED_INFO  *ThisName;
-    char                        TypeBuffer[48]; /* Room for 5 types */
     UINT32                      Count;
+    UINT32                      NumTypes;
 
 
     /*
@@ -809,33 +787,12 @@  ApDisplayReservedNames (
     printf ("\nPredefined Name Information\n\n");
 
     Count = 0;
-    ThisName = PredefinedNames;
+    ThisName = AcpiGbl_PredefinedMethods;
     while (ThisName->Info.Name[0])
     {
-        printf ("%4.4s    Requires %u arguments, ",
-            ThisName->Info.Name, ThisName->Info.ParamCount & 0x0F);
-
-        if (ThisName->Info.ExpectedBtypes)
-        {
-            ApGetExpectedTypes (TypeBuffer, ThisName->Info.ExpectedBtypes);
-            printf ("Must return: %s\n", TypeBuffer);
-        }
-        else
-        {
-            printf ("No return value\n");
-        }
-
-        /*
-         * Skip next entry in the table if this name returns a Package
-         * (next entry contains the package info)
-         */
-        if (ThisName->Info.ExpectedBtypes & ACPI_RTYPE_PACKAGE)
-        {
-            ThisName++;
-        }
-
+        AcpiUtDisplayPredefinedMethod (MsgBuffer, ThisName, FALSE);
         Count++;
-        ThisName++;
+        ThisName = AcpiUtGetNextPredefinedMethod (ThisName);
     }
 
     printf ("%u Predefined Names are recognized\n", Count);
@@ -843,69 +800,34 @@  ApDisplayReservedNames (
     /*
      * Resource Descriptor names
      */
-    printf ("\nResource Descriptor Predefined Names\n\n");
+    printf ("\nPredefined Names for Resource Descriptor Fields\n\n");
 
     Count = 0;
-    ThisName = ResourceNames;
+    ThisName = AcpiGbl_ResourceNames;
     while (ThisName->Info.Name[0])
     {
-        printf ("%4.4s    Resource Descriptor\n", ThisName->Info.Name);
+        NumTypes = AcpiUtGetResourceBitWidth (MsgBuffer,
+            ThisName->Info.ArgumentList);
+
+        printf ("%4.4s    Field is %s bits wide%s\n",
+            ThisName->Info.Name, MsgBuffer,
+            (NumTypes > 1) ? " (depending on descriptor type)" : "");
+
         Count++;
         ThisName++;
     }
 
-    printf ("%u Resource Descriptor Names are recognized\n", Count);
+    printf ("%u Resource Descriptor Field Names are recognized\n", Count);
 
     /*
      * Predefined scope names
      */
-    printf ("\nPredefined Scope Names\n\n");
+    printf ("\nPredefined Scope/Device Names (automatically created at root)\n\n");
 
-    ThisName = ScopeNames;
+    ThisName = AcpiGbl_ScopeNames;
     while (ThisName->Info.Name[0])
     {
-        printf ("%4.4s    Scope\n", ThisName->Info.Name);
+        printf ("%4.4s    Scope/Device\n", ThisName->Info.Name);
         ThisName++;
     }
 }
-
-
-/*******************************************************************************
- *
- * FUNCTION:    ApGetExpectedTypes
- *
- * PARAMETERS:  Buffer              - Where the formatted string is returned
- *              ExpectedBTypes      - Bitfield of expected data types
- *
- * RETURN:      None, formatted string
- *
- * DESCRIPTION: Format the expected object types into a printable string.
- *
- ******************************************************************************/
-
-static void
-ApGetExpectedTypes (
-    char                        *Buffer,
-    UINT32                      ExpectedBtypes)
-{
-    UINT32                      ThisRtype;
-    UINT32                      i;
-    UINT32                      j;
-
-
-    j = 1;
-    Buffer[0] = 0;
-    ThisRtype = ACPI_RTYPE_INTEGER;
-
-    for (i = 0; i < ACPI_NUM_RTYPES; i++)
-    {
-        /* If one of the expected types, concatenate the name of this type */
-
-        if (ExpectedBtypes & ThisRtype)
-        {
-            ACPI_STRCAT (Buffer, &AcpiRtypeNames[i][j]);
-            j = 0;              /* Use name separator from now on */
-        }
-        ThisRtype <<= 1;    /* Next Rtype */
-    }
-}
diff --git a/src/acpica/source/compiler/aslprepkg.c b/src/acpica/source/compiler/aslprepkg.c
new file mode 100644
index 0000000..9957328
--- /dev/null
+++ b/src/acpica/source/compiler/aslprepkg.c
@@ -0,0 +1,754 @@ 
+/******************************************************************************
+ *
+ * Module Name: aslprepkg - support for ACPI predefined name package objects
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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 "aslcompiler.h"
+#include "aslcompiler.y.h"
+#include "acpredef.h"
+
+
+#define _COMPONENT          ACPI_COMPILER
+        ACPI_MODULE_NAME    ("aslprepkg")
+
+
+/* Local prototypes */
+
+static void
+ApCheckPackageElements (
+    const char                  *PredefinedName,
+    ACPI_PARSE_OBJECT           *Op,
+    UINT8                       Type1,
+    UINT32                      Count1,
+    UINT8                       Type2,
+    UINT32                      Count2);
+
+static void
+ApCheckPackageList (
+    const char                  *PredefinedName,
+    ACPI_PARSE_OBJECT           *ParentOp,
+    const ACPI_PREDEFINED_INFO  *Package,
+    UINT32                      StartIndex,
+    UINT32                      Count);
+
+static void
+ApPackageTooSmall (
+    const char                  *PredefinedName,
+    ACPI_PARSE_OBJECT           *Op,
+    UINT32                      Count,
+    UINT32                      ExpectedCount);
+
+static void
+ApZeroLengthPackage (
+    const char                  *PredefinedName,
+    ACPI_PARSE_OBJECT           *Op);
+
+static void
+ApPackageTooLarge (
+    const char                  *PredefinedName,
+    ACPI_PARSE_OBJECT           *Op,
+    UINT32                      Count,
+    UINT32                      ExpectedCount);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    ApCheckPackage
+ *
+ * PARAMETERS:  ParentOp            - Parser op for the package
+ *              Predefined          - Pointer to package-specific info for
+ *                                    the method
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Top-level validation for predefined name return package
+ *              objects.
+ *
+ ******************************************************************************/
+
+void
+ApCheckPackage (
+    ACPI_PARSE_OBJECT           *ParentOp,
+    const ACPI_PREDEFINED_INFO  *Predefined)
+{
+    ACPI_PARSE_OBJECT           *Op;
+    const ACPI_PREDEFINED_INFO  *Package;
+    ACPI_STATUS                 Status;
+    UINT32                      ExpectedCount;
+    UINT32                      Count;
+    UINT32                      i;
+
+
+    /* The package info for this name is in the next table entry */
+
+    Package = Predefined + 1;
+
+    /* First child is the package length */
+
+    Op = ParentOp->Asl.Child;
+    Count = (UINT32) Op->Asl.Value.Integer;
+
+    /*
+     * Many of the variable-length top-level packages are allowed to simply
+     * have zero elements. This allows the BIOS to tell the host that even
+     * though the predefined name/method exists, the feature is not supported.
+     * Other package types require one or more elements. In any case, there
+     * is no need to continue validation.
+     */
+    if (!Count)
+    {
+        switch (Package->RetInfo.Type)
+        {
+        case ACPI_PTYPE1_FIXED:
+        case ACPI_PTYPE1_OPTION:
+        case ACPI_PTYPE2_PKG_COUNT:
+        case ACPI_PTYPE2_REV_FIXED:
+
+            ApZeroLengthPackage (Predefined->Info.Name, ParentOp);
+            break;
+
+        case ACPI_PTYPE1_VAR:
+        case ACPI_PTYPE2:
+        case ACPI_PTYPE2_COUNT:
+        case ACPI_PTYPE2_FIXED:
+        case ACPI_PTYPE2_MIN:
+        case ACPI_PTYPE2_FIX_VAR:
+        default:
+
+            break;
+        }
+
+        return;
+    }
+
+    /* Get the first element of the package */
+
+    Op = Op->Asl.Next;
+
+    /* Decode the package type */
+
+    switch (Package->RetInfo.Type)
+    {
+    case ACPI_PTYPE1_FIXED:
+        /*
+         * The package count is fixed and there are no sub-packages
+         *
+         * If package is too small, exit.
+         * If package is larger than expected, issue warning but continue
+         */
+        ExpectedCount = Package->RetInfo.Count1 + Package->RetInfo.Count2;
+        if (Count < ExpectedCount)
+        {
+            goto PackageTooSmall;
+        }
+        else if (Count > ExpectedCount)
+        {
+            ApPackageTooLarge (Predefined->Info.Name, ParentOp,
+                Count, ExpectedCount);
+        }
+
+        /* Validate all elements of the package */
+
+        ApCheckPackageElements (Predefined->Info.Name, Op,
+            Package->RetInfo.ObjectType1, Package->RetInfo.Count1,
+            Package->RetInfo.ObjectType2, Package->RetInfo.Count2);
+        break;
+
+    case ACPI_PTYPE1_VAR:
+        /*
+         * The package count is variable, there are no sub-packages,
+         * and all elements must be of the same type
+         */
+        for (i = 0; i < Count; i++)
+        {
+            ApCheckObjectType (Predefined->Info.Name, Op,
+                Package->RetInfo.ObjectType1, i);
+            Op = Op->Asl.Next;
+        }
+        break;
+
+    case ACPI_PTYPE1_OPTION:
+        /*
+         * The package count is variable, there are no sub-packages.
+         * There are a fixed number of required elements, and a variable
+         * number of optional elements.
+         *
+         * Check if package is at least as large as the minimum required
+         */
+        ExpectedCount = Package->RetInfo3.Count;
+        if (Count < ExpectedCount)
+        {
+            goto PackageTooSmall;
+        }
+
+        /* Variable number of sub-objects */
+
+        for (i = 0; i < Count; i++)
+        {
+            if (i < Package->RetInfo3.Count)
+            {
+                /* These are the required package elements (0, 1, or 2) */
+
+                ApCheckObjectType (Predefined->Info.Name, Op,
+                    Package->RetInfo3.ObjectType[i], i);
+            }
+            else
+            {
+                /* These are the optional package elements */
+
+                ApCheckObjectType (Predefined->Info.Name, Op,
+                    Package->RetInfo3.TailObjectType, i);
+            }
+            Op = Op->Asl.Next;
+        }
+        break;
+
+    case ACPI_PTYPE2_REV_FIXED:
+
+        /* First element is the (Integer) revision */
+
+        ApCheckObjectType (Predefined->Info.Name, Op,
+            ACPI_RTYPE_INTEGER, 0);
+
+        Op = Op->Asl.Next;
+        Count--;
+
+        /* Examine the sub-packages */
+
+        ApCheckPackageList (Predefined->Info.Name, Op,
+            Package, 1, Count);
+        break;
+
+    case ACPI_PTYPE2_PKG_COUNT:
+
+        /* First element is the (Integer) count of sub-packages to follow */
+
+        Status = ApCheckObjectType (Predefined->Info.Name, Op,
+            ACPI_RTYPE_INTEGER, 0);
+
+        /* We must have an integer count from above (otherwise, use Count) */
+
+        if (ACPI_SUCCESS (Status))
+        {
+            /*
+             * Count cannot be larger than the parent package length, but
+             * allow it to be smaller. The >= accounts for the Integer above.
+             */
+            ExpectedCount = (UINT32) Op->Asl.Value.Integer;
+            if (ExpectedCount >= Count)
+            {
+                goto PackageTooSmall;
+            }
+
+            Count = ExpectedCount;
+        }
+
+        Op = Op->Asl.Next;
+
+        /* Examine the sub-packages */
+
+        ApCheckPackageList (Predefined->Info.Name, Op,
+            Package, 1, Count);
+        break;
+
+    case ACPI_PTYPE2:
+    case ACPI_PTYPE2_FIXED:
+    case ACPI_PTYPE2_MIN:
+    case ACPI_PTYPE2_COUNT:
+    case ACPI_PTYPE2_FIX_VAR:
+        /*
+         * These types all return a single Package that consists of a
+         * variable number of sub-Packages.
+         */
+
+        /* Examine the sub-packages */
+
+        ApCheckPackageList (Predefined->Info.Name, Op,
+            Package, 0, Count);
+        break;
+
+    default:
+        return;
+    }
+
+    return;
+
+PackageTooSmall:
+    ApPackageTooSmall (Predefined->Info.Name, ParentOp,
+        Count, ExpectedCount);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    ApCheckPackageElements
+ *
+ * PARAMETERS:  PredefinedName      - Name of the predefined object
+ *              Op                  - Parser op for the package
+ *              Type1               - Object type for first group
+ *              Count1              - Count for first group
+ *              Type2               - Object type for second group
+ *              Count2              - Count for second group
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Validate all elements of a package. Works with packages that
+ *              are defined to contain up to two groups of different object
+ *              types.
+ *
+ ******************************************************************************/
+
+static void
+ApCheckPackageElements (
+    const char              *PredefinedName,
+    ACPI_PARSE_OBJECT       *Op,
+    UINT8                   Type1,
+    UINT32                  Count1,
+    UINT8                   Type2,
+    UINT32                  Count2)
+{
+    UINT32                  i;
+
+
+    /*
+     * Up to two groups of package elements are supported by the data
+     * structure. All elements in each group must be of the same type.
+     * The second group can have a count of zero.
+     *
+     * Aborts check upon a NULL package element, as this means (at compile
+     * time) that the remainder of the package elements are also NULL
+     * (This is the only way to create NULL package elements.)
+     */
+    for (i = 0; (i < Count1) && Op; i++)
+    {
+        ApCheckObjectType (PredefinedName, Op, Type1, i);
+        Op = Op->Asl.Next;
+    }
+
+    for (i = 0; (i < Count2) && Op; i++)
+    {
+        ApCheckObjectType (PredefinedName, Op, Type2, (i + Count1));
+        Op = Op->Asl.Next;
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    ApCheckPackageList
+ *
+ * PARAMETERS:  PredefinedName      - Name of the predefined object
+ *              ParentOp            - Parser op of the parent package
+ *              Package             - Package info for this predefined name
+ *              StartIndex          - Index in parent package where list begins
+ *              ParentCount         - Element count of parent package
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Validate the individual package elements for a predefined name.
+ *              Handles the cases where the predefined name is defined as a
+ *              Package of Packages (subpackages). These are the types:
+ *
+ *              ACPI_PTYPE2
+ *              ACPI_PTYPE2_FIXED
+ *              ACPI_PTYPE2_MIN
+ *              ACPI_PTYPE2_COUNT
+ *              ACPI_PTYPE2_FIX_VAR
+ *
+ ******************************************************************************/
+
+static void
+ApCheckPackageList (
+    const char                  *PredefinedName,
+    ACPI_PARSE_OBJECT           *ParentOp,
+    const ACPI_PREDEFINED_INFO  *Package,
+    UINT32                      StartIndex,
+    UINT32                      ParentCount)
+{
+    ACPI_PARSE_OBJECT           *SubPackageOp = ParentOp;
+    ACPI_PARSE_OBJECT           *Op;
+    ACPI_STATUS                 Status;
+    UINT32                      Count;
+    UINT32                      ExpectedCount;
+    UINT32                      i;
+    UINT32                      j;
+
+
+    /*
+     * Validate each subpackage in the parent Package
+     *
+     * Note: We ignore NULL package elements on the assumption that
+     * they will be initialized by the BIOS or other ASL code.
+     */
+    for (i = 0; (i < ParentCount) && SubPackageOp; i++)
+    {
+        /* Each object in the list must be of type Package */
+
+        Status = ApCheckObjectType (PredefinedName, SubPackageOp,
+            ACPI_RTYPE_PACKAGE, i + StartIndex);
+        if (ACPI_FAILURE (Status))
+        {
+            goto NextSubpackage;
+        }
+
+        /* Examine the different types of expected subpackages */
+
+        Op = SubPackageOp->Asl.Child;
+
+        /* First child is the package length */
+
+        Count = (UINT32) Op->Asl.Value.Integer;
+        Op = Op->Asl.Next;
+
+        /* The subpackage must have at least one element */
+
+        if (!Count)
+        {
+            ApZeroLengthPackage (PredefinedName, SubPackageOp);
+            goto NextSubpackage;
+        }
+
+        /*
+         * Decode the package type.
+         * PTYPE2 indicates that a "package of packages" is expected for
+         * this name. The various flavors of PTYPE2 indicate the number
+         * and format of the subpackages.
+         */
+        switch (Package->RetInfo.Type)
+        {
+        case ACPI_PTYPE2:
+        case ACPI_PTYPE2_PKG_COUNT:
+        case ACPI_PTYPE2_REV_FIXED:
+
+            /* Each subpackage has a fixed number of elements */
+
+            ExpectedCount = Package->RetInfo.Count1 + Package->RetInfo.Count2;
+            if (Count < ExpectedCount)
+            {
+                ApPackageTooSmall (PredefinedName, SubPackageOp,
+                    Count, ExpectedCount);
+                break;
+            }
+
+            ApCheckPackageElements (PredefinedName, Op,
+                Package->RetInfo.ObjectType1, Package->RetInfo.Count1,
+                Package->RetInfo.ObjectType2, Package->RetInfo.Count2);
+            break;
+
+        case ACPI_PTYPE2_FIX_VAR:
+            /*
+             * Each subpackage has a fixed number of elements and an
+             * optional element
+             */
+            ExpectedCount = Package->RetInfo.Count1 + Package->RetInfo.Count2;
+            if (Count < ExpectedCount)
+            {
+                ApPackageTooSmall (PredefinedName, SubPackageOp,
+                    Count, ExpectedCount);
+                break;
+            }
+
+            ApCheckPackageElements (PredefinedName, Op,
+                Package->RetInfo.ObjectType1, Package->RetInfo.Count1,
+                Package->RetInfo.ObjectType2,
+                Count - Package->RetInfo.Count1);
+            break;
+
+        case ACPI_PTYPE2_FIXED:
+
+            /* Each sub-package has a fixed length */
+
+            ExpectedCount = Package->RetInfo2.Count;
+            if (Count < ExpectedCount)
+            {
+                ApPackageTooSmall (PredefinedName, SubPackageOp,
+                    Count, ExpectedCount);
+                break;
+            }
+
+            /* Check each object/type combination */
+
+            for (j = 0; j < ExpectedCount; j++)
+            {
+                ApCheckObjectType (PredefinedName, Op,
+                    Package->RetInfo2.ObjectType[j], j);
+
+                Op = Op->Asl.Next;
+            }
+            break;
+
+        case ACPI_PTYPE2_MIN:
+
+            /* Each sub-package has a variable but minimum length */
+
+            ExpectedCount = Package->RetInfo.Count1;
+            if (Count < ExpectedCount)
+            {
+                ApPackageTooSmall (PredefinedName, SubPackageOp,
+                    Count, ExpectedCount);
+                break;
+            }
+
+            /* Check the type of each sub-package element */
+
+            ApCheckPackageElements (PredefinedName, Op,
+                Package->RetInfo.ObjectType1, Count, 0, 0);
+            break;
+
+        case ACPI_PTYPE2_COUNT:
+            /*
+             * First element is the (Integer) count of elements, including
+             * the count field (the ACPI name is NumElements)
+             */
+            Status = ApCheckObjectType (PredefinedName, Op,
+                ACPI_RTYPE_INTEGER, 0);
+
+            /* We must have an integer count from above (otherwise, use Count) */
+
+            if (ACPI_SUCCESS (Status))
+            {
+                /*
+                 * Make sure package is large enough for the Count and is
+                 * is as large as the minimum size
+                 */
+                ExpectedCount = (UINT32) Op->Asl.Value.Integer;
+
+                if (Count < ExpectedCount)
+                {
+                    ApPackageTooSmall (PredefinedName, SubPackageOp,
+                        Count, ExpectedCount);
+                    break;
+                }
+                else if (Count > ExpectedCount)
+                {
+                    ApPackageTooLarge (PredefinedName, SubPackageOp,
+                        Count, ExpectedCount);
+                }
+
+                /* Some names of this type have a minimum length */
+
+                if (Count < Package->RetInfo.Count1)
+                {
+                    ExpectedCount = Package->RetInfo.Count1;
+                    ApPackageTooSmall (PredefinedName, SubPackageOp,
+                        Count, ExpectedCount);
+                    break;
+                }
+
+                Count = ExpectedCount;
+            }
+
+            /* Check the type of each sub-package element */
+
+            Op = Op->Asl.Next;
+            ApCheckPackageElements (PredefinedName, Op,
+                Package->RetInfo.ObjectType1, (Count - 1), 0, 0);
+            break;
+
+        default:
+            break;
+        }
+
+NextSubpackage:
+        SubPackageOp = SubPackageOp->Asl.Next;
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    ApPackageTooSmall
+ *
+ * PARAMETERS:  PredefinedName      - Name of the predefined object
+ *              Op                  - Current parser op
+ *              Count               - Actual package element count
+ *              ExpectedCount       - Expected package element count
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Issue error message for a package that is smaller than
+ *              required.
+ *
+ ******************************************************************************/
+
+static void
+ApPackageTooSmall (
+    const char                  *PredefinedName,
+    ACPI_PARSE_OBJECT           *Op,
+    UINT32                      Count,
+    UINT32                      ExpectedCount)
+{
+
+    sprintf (MsgBuffer, "%s: length %u, required minimum is %u",
+        PredefinedName, Count, ExpectedCount);
+
+    AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, MsgBuffer);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    ApZeroLengthPackage
+ *
+ * PARAMETERS:  PredefinedName      - Name of the predefined object
+ *              Op                  - Current parser op
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Issue error message for a zero-length package (a package that
+ *              is required to have a non-zero length). Variable length
+ *              packages seem to be allowed to have zero length, however.
+ *              Even if not allowed, BIOS code does it.
+ *
+ ******************************************************************************/
+
+static void
+ApZeroLengthPackage (
+    const char                  *PredefinedName,
+    ACPI_PARSE_OBJECT           *Op)
+{
+
+    sprintf (MsgBuffer, "%s: length is zero", PredefinedName);
+
+    AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, MsgBuffer);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    ApPackageTooLarge
+ *
+ * PARAMETERS:  PredefinedName      - Name of the predefined object
+ *              Op                  - Current parser op
+ *              Count               - Actual package element count
+ *              ExpectedCount       - Expected package element count
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Issue a remark for a package that is larger than expected.
+ *
+ ******************************************************************************/
+
+static void
+ApPackageTooLarge (
+    const char                  *PredefinedName,
+    ACPI_PARSE_OBJECT           *Op,
+    UINT32                      Count,
+    UINT32                      ExpectedCount)
+{
+
+    sprintf (MsgBuffer, "%s: length is %u, only %u required",
+        PredefinedName, Count, ExpectedCount);
+
+    AslError (ASL_REMARK, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, MsgBuffer);
+}
diff --git a/src/acpica/source/compiler/aslresource.c b/src/acpica/source/compiler/aslresource.c
index 9eb8baf..9e919e7 100644
--- a/src/acpica/source/compiler/aslresource.c
+++ b/src/acpica/source/compiler/aslresource.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslresource - Resource template/descriptor utilities
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -470,7 +469,7 @@  RsGetStringDataLength (
         InitializerOp = ASL_GET_PEER_NODE (InitializerOp);
     }
 
-    return 0;
+    return (0);
 }
 
 
@@ -521,7 +520,7 @@  RsAllocateResourceNode (
  * RETURN:      None, sets fields within the input node
  *
  * DESCRIPTION: Utility function to generate a named bit field within a
- *              resource descriptor.  Mark a node as 1) a field in a resource
+ *              resource descriptor. Mark a node as 1) a field in a resource
  *              descriptor, and 2) set the value to be a BIT offset
  *
  ******************************************************************************/
@@ -556,8 +555,8 @@  RsCreateResourceField (
  * RETURN:      Sets bits within the *Flags output byte.
  *
  * DESCRIPTION: Set a bit in a cumulative flags word from an initialization
- *              node.  Will use a default value if the node is DEFAULT, meaning
- *              that no value was specified in the ASL.  Used to merge multiple
+ *              node. Will use a default value if the node is DEFAULT, meaning
+ *              that no value was specified in the ASL. Used to merge multiple
  *              keywords into a single flags byte.
  *
  ******************************************************************************/
@@ -967,6 +966,7 @@  RsDoOneResourceDescriptor (
     if (Rnode)
     {
         DescriptorTypeOp->Asl.FinalAmlLength = Rnode->BufferLength;
+        DescriptorTypeOp->Asl.Extra = ((AML_RESOURCE *) Rnode->Buffer)->DescriptorType;
     }
 
     return (Rnode);
@@ -1001,7 +1001,7 @@  RsLinkDescriptorChain (
 
     if (!Rnode)
     {
-        return 0;
+        return (0);
     }
 
     /* Point the previous node to the new node */
@@ -1021,7 +1021,7 @@  RsLinkDescriptorChain (
     /* Previous node becomes the last node in the chain */
 
     *PreviousRnode = LastRnode;
-    return CurrentByteOffset;
+    return (CurrentByteOffset);
 }
 
 
@@ -1031,7 +1031,7 @@  RsLinkDescriptorChain (
  *
  * PARAMETERS:  Op        - Parent of a resource template list
  *
- * RETURN:      None.  Sets input node to point to a list of AML code
+ * RETURN:      None. Sets input node to point to a list of AML code
  *
  * DESCRIPTION: Merge a list of resource descriptors into a single AML buffer,
  *              in preparation for output to the AML output file.
@@ -1088,7 +1088,7 @@  RsDoResourceTemplate (
 
         /*
          * Update current byte offset to indicate the number of bytes from the
-         * start of the buffer.  Buffer can include multiple descriptors, we
+         * start of the buffer. Buffer can include multiple descriptors, we
          * must keep track of the offset of not only each descriptor, but each
          * element (field) within each descriptor as well.
          */
diff --git a/src/acpica/source/compiler/aslrestype1.c b/src/acpica/source/compiler/aslrestype1.c
index 5b92151..072af81 100644
--- a/src/acpica/source/compiler/aslrestype1.c
+++ b/src/acpica/source/compiler/aslrestype1.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslrestype1 - Miscellaneous small resource descriptors
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -570,7 +569,7 @@  RsDoStartDependentDescriptor (
 
             /*
              * Update current byte offset to indicate the number of bytes from the
-             * start of the buffer.  Buffer can include multiple descriptors, we
+             * start of the buffer. Buffer can include multiple descriptors, we
              * must keep track of the offset of not only each descriptor, but each
              * element (field) within each descriptor as well.
              */
@@ -635,7 +634,7 @@  RsDoStartDependentNoPriDescriptor (
 
         /*
          * Update current byte offset to indicate the number of bytes from the
-         * start of the buffer.  Buffer can include multiple descriptors, we
+         * start of the buffer. Buffer can include multiple descriptors, we
          * must keep track of the offset of not only each descriptor, but each
          * element (field) within each descriptor as well.
          */
@@ -722,4 +721,3 @@  RsDoVendorSmallDescriptor (
     Descriptor->VendorSmall.DescriptorType |= (UINT8) i;
     return (Rnode);
 }
-
diff --git a/src/acpica/source/compiler/aslrestype1i.c b/src/acpica/source/compiler/aslrestype1i.c
index 8335e8f..68bf756 100644
--- a/src/acpica/source/compiler/aslrestype1i.c
+++ b/src/acpica/source/compiler/aslrestype1i.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslrestype1i - Small I/O-related resource descriptors
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
diff --git a/src/acpica/source/compiler/aslrestype2.c b/src/acpica/source/compiler/aslrestype2.c
index f0de854..aba1feb 100644
--- a/src/acpica/source/compiler/aslrestype2.c
+++ b/src/acpica/source/compiler/aslrestype2.c
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
diff --git a/src/acpica/source/compiler/aslrestype2d.c b/src/acpica/source/compiler/aslrestype2d.c
index 1ca0f2d..cb10a84 100644
--- a/src/acpica/source/compiler/aslrestype2d.c
+++ b/src/acpica/source/compiler/aslrestype2d.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslrestype2d - Large DWord address resource descriptors
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
diff --git a/src/acpica/source/compiler/aslrestype2e.c b/src/acpica/source/compiler/aslrestype2e.c
index e5fff47..a027714 100644
--- a/src/acpica/source/compiler/aslrestype2e.c
+++ b/src/acpica/source/compiler/aslrestype2e.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslrestype2e - Large Extended address resource descriptors
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
diff --git a/src/acpica/source/compiler/aslrestype2q.c b/src/acpica/source/compiler/aslrestype2q.c
index 65c242a..e7fffb8 100644
--- a/src/acpica/source/compiler/aslrestype2q.c
+++ b/src/acpica/source/compiler/aslrestype2q.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslrestype2q - Large QWord address resource descriptors
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
diff --git a/src/acpica/source/compiler/aslrestype2s.c b/src/acpica/source/compiler/aslrestype2s.c
index a9d24cd..4380829 100644
--- a/src/acpica/source/compiler/aslrestype2s.c
+++ b/src/acpica/source/compiler/aslrestype2s.c
@@ -8,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -31,7 +31,7 @@ 
  * 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
+ * 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
@@ -43,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -55,7 +55,7 @@ 
  * 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
+ * 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
@@ -80,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -92,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
diff --git a/src/acpica/source/compiler/aslrestype2w.c b/src/acpica/source/compiler/aslrestype2w.c
index 79d7bcc..726fb17 100644
--- a/src/acpica/source/compiler/aslrestype2w.c
+++ b/src/acpica/source/compiler/aslrestype2w.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslrestype2w - Large Word address resource descriptors
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
diff --git a/src/acpica/source/compiler/aslstartup.c b/src/acpica/source/compiler/aslstartup.c
index 2fbe0d3..f00d64e 100644
--- a/src/acpica/source/compiler/aslstartup.c
+++ b/src/acpica/source/compiler/aslstartup.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslstartup - Compiler startup routines, called from main
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -117,6 +116,7 @@ 
 
 #include "aslcompiler.h"
 #include "actables.h"
+#include "acdisasm.h"
 #include "acapps.h"
 
 #define _COMPONENT          ACPI_COMPILER
@@ -139,6 +139,10 @@  static UINT8
 AslDetectSourceFileType (
     ASL_FILE_INFO           *Info);
 
+static ACPI_STATUS
+AslDoDisassembly (
+    void);
+
 
 /*******************************************************************************
  *
@@ -297,21 +301,34 @@  AslDetectSourceFileType (
     ACPI_STATUS             Status;
 
 
+    /* Check for a valid binary ACPI table */
+
+    Status = FlCheckForAcpiTable (Info->Handle);
+    if (ACPI_SUCCESS (Status))
+    {
+        Type = ASL_INPUT_TYPE_ACPI_TABLE;
+        goto Cleanup;
+    }
+
     /* Check for 100% ASCII source file (comments are ignored) */
 
     Status = FlCheckForAscii (Info->Handle, Info->Filename, TRUE);
     if (ACPI_FAILURE (Status))
     {
         printf ("Non-ascii input file - %s\n", Info->Filename);
-        Type = ASL_INPUT_TYPE_BINARY;
-        goto Cleanup;
+
+        if (!Gbl_IgnoreErrors)
+        {
+            Type = ASL_INPUT_TYPE_BINARY;
+            goto Cleanup;
+        }
     }
 
     /*
      * File is ASCII. Determine if this is an ASL file or an ACPI data
      * table file.
      */
-    while (fgets (Gbl_CurrentLineBuffer, ASL_LINE_BUFFER_SIZE, Info->Handle))
+    while (fgets (Gbl_CurrentLineBuffer, Gbl_LineBufferSize, Info->Handle))
     {
         /* Uppercase the buffer for caseless compare */
 
@@ -348,6 +365,86 @@  Cleanup:
 
 /*******************************************************************************
  *
+ * FUNCTION:    AslDoDisassembly
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Initiate AML file disassembly. Uses ACPICA subsystem to build
+ *              namespace.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AslDoDisassembly (
+    void)
+{
+    ACPI_STATUS             Status;
+
+
+    /* ACPICA subsystem initialization */
+
+    Status = AdInitialize ();
+    if (ACPI_FAILURE (Status))
+    {
+        return (Status);
+    }
+
+    Status = AcpiAllocateRootTable (4);
+    if (ACPI_FAILURE (Status))
+    {
+        AcpiOsPrintf ("Could not initialize ACPI Table Manager, %s\n",
+            AcpiFormatException (Status));
+        return (Status);
+    }
+
+    /* This is where the disassembly happens */
+
+    AcpiGbl_DbOpt_disasm = TRUE;
+    Status = AdAmlDisassemble (AslToFile,
+        Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_OutputFilenamePrefix,
+        &Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_GetAllTables);
+    if (ACPI_FAILURE (Status))
+    {
+        return (Status);
+    }
+
+    /* Check if any control methods were unresolved */
+
+    AcpiDmUnresolvedWarning (0);
+
+#if 0
+    /* TBD: Handle additional output files for disassembler */
+
+    Status = FlOpenMiscOutputFiles (Gbl_OutputFilenamePrefix);
+    NsDisplayNamespace ();
+#endif
+
+    /* Shutdown compiler and ACPICA subsystem */
+
+    AeClearErrorLog ();
+    (void) AcpiTerminate ();
+
+    /*
+     * Gbl_Files[ASL_FILE_INPUT].Filename was replaced with the
+     * .DSL disassembly file, which can now be compiled if requested
+     */
+    if (Gbl_DoCompile)
+    {
+        AcpiOsPrintf ("\nCompiling \"%s\"\n",
+            Gbl_Files[ASL_FILE_INPUT].Filename);
+        return (AE_CTRL_CONTINUE);
+    }
+
+    ACPI_FREE (Gbl_Files[ASL_FILE_INPUT].Filename);
+    Gbl_Files[ASL_FILE_INPUT].Filename = NULL;
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    AslDoOneFile
  *
  * PARAMETERS:  Filename        - Name of the file
@@ -377,54 +474,11 @@  AslDoOneFile (
      */
     if (Gbl_DisasmFlag || Gbl_GetAllTables)
     {
-        /* ACPICA subsystem initialization */
-
-        Status = AdInitialize ();
-        if (ACPI_FAILURE (Status))
+        Status = AslDoDisassembly ();
+        if (Status != AE_CTRL_CONTINUE)
         {
             return (Status);
         }
-
-        Status = AcpiAllocateRootTable (4);
-        if (ACPI_FAILURE (Status))
-        {
-            AcpiOsPrintf ("Could not initialize ACPI Table Manager, %s\n",
-                AcpiFormatException (Status));
-            return (Status);
-        }
-
-        /* This is where the disassembly happens */
-
-        AcpiGbl_DbOpt_disasm = TRUE;
-        Status = AdAmlDisassemble (AslToFile,
-                    Gbl_Files[ASL_FILE_INPUT].Filename,
-                    Gbl_OutputFilenamePrefix,
-                    &Gbl_Files[ASL_FILE_INPUT].Filename,
-                    Gbl_GetAllTables);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
-        /* Shutdown compiler and ACPICA subsystem */
-
-        AeClearErrorLog ();
-        (void) AcpiTerminate ();
-
-        /*
-         * Gbl_Files[ASL_FILE_INPUT].Filename was replaced with the
-         * .DSL disassembly file, which can now be compiled if requested
-         */
-        if (Gbl_DoCompile)
-        {
-            AcpiOsPrintf ("\nCompiling \"%s\"\n",
-                Gbl_Files[ASL_FILE_INPUT].Filename);
-        }
-        else
-        {
-            Gbl_Files[ASL_FILE_INPUT].Filename = NULL;
-            return (AE_OK);
-        }
     }
 
     /*
@@ -531,6 +585,21 @@  AslDoOneFile (
         PrTerminatePreprocessor ();
         return (AE_OK);
 
+    /*
+     * Binary ACPI table was auto-detected, disassemble it
+     */
+    case ASL_INPUT_TYPE_ACPI_TABLE:
+
+        /* We have what appears to be an ACPI table, disassemble it */
+
+        FlCloseFile (ASL_FILE_INPUT);
+        Gbl_DoCompile = FALSE;
+        Gbl_DisasmFlag = TRUE;
+        Status = AslDoDisassembly ();
+        return (Status);
+
+    /* Unknown binary table */
+
     case ASL_INPUT_TYPE_BINARY:
 
         AePrintErrorLog (ASL_FILE_STDERR);
diff --git a/src/acpica/source/compiler/aslstubs.c b/src/acpica/source/compiler/aslstubs.c
index bc8703c..4cf1d42 100644
--- a/src/acpica/source/compiler/aslstubs.c
+++ b/src/acpica/source/compiler/aslstubs.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslstubs - Stubs used to link to Aml interpreter
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -134,7 +133,7 @@  ACPI_PHYSICAL_ADDRESS
 AeLocalGetRootPointer (
     void)
 {
-    return 0;
+    return (0);
 }
 
 void
diff --git a/src/acpica/source/compiler/aslsupport.l b/src/acpica/source/compiler/aslsupport.l
index 0ce5a20..afc95fd 100644
--- a/src/acpica/source/compiler/aslsupport.l
+++ b/src/acpica/source/compiler/aslsupport.l
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: aslsupport.l - Flex/lex scanner C support routines.
@@ -10,13 +9,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -33,7 +32,7 @@ 
  * 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
+ * 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
@@ -45,11 +44,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -57,7 +56,7 @@ 
  * 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
+ * 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
@@ -82,10 +81,10 @@ 
  * 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
+ * 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.
  *
@@ -94,14 +93,14 @@ 
  * 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
+ * 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
+ * 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
@@ -239,8 +238,8 @@  ResetAndExit:
  * RETURN:      0 if a node was popped, -1 otherwise
  *
  * DESCRIPTION: Pop the top of the input file stack and point the parser to
- *              the saved parse buffer contained in the fnode.  Also, set the
- *              global line counters to the saved values.  This function is
+ *              the saved parse buffer contained in the fnode. Also, set the
+ *              global line counters to the saved values. This function is
  *              called when an include file reaches EOF.
  *
  ******************************************************************************/
@@ -295,7 +294,7 @@  AslPopInputFileStack (
  * RETURN:      None
  *
  * DESCRIPTION: Push the InputFile onto the file stack, and point the parser
- *              to this file.  Called when an include file is successfully
+ *              to this file. Called when an include file is successfully
  *              opened.
  *
  ******************************************************************************/
@@ -397,7 +396,7 @@  AslInsertLineBuffer (
 
     Gbl_InputByteCount++;
 
-    /* Handle tabs.  Convert to spaces */
+    /* Handle tabs. Convert to spaces */
 
     if (SourceChar == '\t')
     {
@@ -415,14 +414,14 @@  AslInsertLineBuffer (
         *Gbl_LineBufPtr = (UINT8) SourceChar;
         Gbl_LineBufPtr++;
 
-        if (Gbl_LineBufPtr > (Gbl_CurrentLineBuffer + (ASL_LINE_BUFFER_SIZE - 1)))
+        if (Gbl_LineBufPtr > (Gbl_CurrentLineBuffer + (Gbl_LineBufferSize - 1)))
         {
 #if 0
             /*
              * Warning if we have split a long source line.
              * <Probably overkill>
              */
-            sprintf (MsgBuffer, "Max %u", ASL_LINE_BUFFER_SIZE);
+            sprintf (MsgBuffer, "Max %u", Gbl_LineBufferSize);
             AslCommonError (ASL_WARNING, ASL_MSG_LONG_LINE,
                             Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
                             Gbl_CurrentLineOffset, Gbl_CurrentColumn,
@@ -476,6 +475,9 @@  count (
         TotalKeywords++;
         TotalExecutableOpcodes++;
         break;
+
+    default:
+        break;
     }
 
     for (i = 0; (yytext[i] != 0) && (yytext[i] != EOF); i++)
@@ -643,7 +645,6 @@  AslDoStringLiteral (
         AslInsertLineBuffer (StringChar);
 
 DoCharacter:
-
         switch (State)
         {
         case ASL_NORMAL_CHAR:
@@ -652,7 +653,7 @@  DoCharacter:
             {
             case '\\':
                 /*
-                 * Special handling for backslash-escape sequence.  We will
+                 * Special handling for backslash-escape sequence. We will
                  * toss the backslash and translate the escape char(s).
                  */
                 State = ASL_ESCAPE_SEQUENCE;
@@ -663,6 +664,9 @@  DoCharacter:
                 /* String terminator */
 
                 goto CompletedString;
+
+            default:
+                break;
             }
             break;
 
@@ -741,7 +745,7 @@  DoCharacter:
                 (i > 2))
             {
                 /*
-                 * Reached end of the constant.  Convert the assembled ASCII
+                 * Reached end of the constant. Convert the assembled ASCII
                  * string and resume processing of the next character
                  */
                 ConvertBuffer[i] = 0;
@@ -786,7 +790,7 @@  DoCharacter:
                 (i > 1))
             {
                 /*
-                 * Reached end of the constant.  Convert the assembled ASCII
+                 * Reached end of the constant. Convert the assembled ASCII
                  * string and resume processing of the next character
                  */
                 ConvertBuffer[i] = 0;
@@ -821,6 +825,9 @@  DoCharacter:
             ConvertBuffer[i] = StringChar;
             i++;
             continue;
+
+        default:
+            break;
         }
 
         /* Save the finished character */
diff --git a/src/acpica/source/compiler/asltransform.c b/src/acpica/source/compiler/asltransform.c
index 0710b40..fd50aff 100644
--- a/src/acpica/source/compiler/asltransform.c
+++ b/src/acpica/source/compiler/asltransform.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: asltransform - Parse tree transforms
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * 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.
  *
@@ -93,14 +92,14 @@ 
  * 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
+ * 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
+ * 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
@@ -172,7 +171,7 @@  TrDoSwitch (
  *
  * RETURN:      A pointer to name (allocated here).
  *
- * DESCRIPTION: Generate an ACPI name of the form _T_x.  These names are
+ * DESCRIPTION: Generate an ACPI name of the form _T_x. These names are
  *              reserved for use by the ASL compiler. (_T_0 through _T_Z)
  *
  ******************************************************************************/
@@ -353,7 +352,7 @@  TrAmlTransformWalk (
  *
  * RETURN:      None
  *
- * DESCRIPTION: Prepare nodes to be output as AML data and operands.  The more
+ * DESCRIPTION: Prepare nodes to be output as AML data and operands. The more
  *              complex AML opcodes require processing of the child nodes
  *              (arguments/operands).
  *
@@ -404,7 +403,7 @@  TrTransformSubtree (
  * RETURN:      None
  *
  * DESCRIPTION: Find the end of the definition block and set a global to this
- *              node.  It is used by the compiler to insert compiler-generated
+ *              node. It is used by the compiler to insert compiler-generated
  *              names at the root level of the namespace.
  *
  ******************************************************************************/
@@ -448,7 +447,7 @@  TrDoDefinitionBlock (
  * RETURN:      None
  *
  *
- * DESCRIPTION: Translate ASL SWITCH statement to if/else pairs.  There is
+ * DESCRIPTION: Translate ASL SWITCH statement to if/else pairs. There is
  *              no actual AML opcode for SWITCH -- it must be simulated.
  *
  ******************************************************************************/
@@ -646,7 +645,7 @@  TrDoSwitch (
             else
             {
                 /*
-                 * The IF is a child of previous IF/ELSE.  It
+                 * The IF is a child of previous IF/ELSE. It
                  * is therefore without peer.
                  */
                 CurrentParentNode->Asl.Child = Conditional;
@@ -809,7 +808,7 @@  TrDoSwitch (
     /*
      * Transform the Switch() into a While(One)-Break node.
      * And create a Store() node which will be used to save the
-     * Switch() value.  The store is of the form: Store (Value, _T_x)
+     * Switch() value. The store is of the form: Store (Value, _T_x)
      * where _T_x is the temp variable.
      */
     TrAmlInitNode (StartNode, PARSEOP_WHILE);
@@ -850,5 +849,3 @@  TrDoSwitch (
     BreakOp->Asl.Parent = StartNode;
     TrAmlInsertPeer (Conditional, BreakOp);
 }
-
-
diff --git a/src/acpica/source/compiler/asltree.c b/src/acpica/source/compiler/asltree.c
index f7a5fd7..1f9e907 100644
--- a/src/acpica/source/compiler/asltree.c
+++ b/src/acpica/source/compiler/asltree.c
@@ -1,4 +1,3 @@ 
-
 /******************************************************************************
  *
  * Module Name: asltree - parse tree management
@@ -9,13 +8,13 @@ 
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2013, 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
+ * 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.
  *
@@ -32,7 +31,7 @@ 
  * 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
+ * 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
@@ -44,11 +43,11 @@ 
  * 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,
+ * 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
+ * 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.
  *
@@ -56,7 +55,7 @@ 
  * 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
+ * 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
@@ -81,10 +80,10 @@ 
  * 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
+ * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
+ * IS PROVIDED "AS IS," AN