830 Commits

Author SHA1 Message Date
Robert Moore
ff4feb1e91 iASL: Add support for Printf and Fprintf macros.
Printf stores to the debug object.
Fprintf stores to any named object.
%o is the main format specifier since only very limited typechecking
can be performed at compile time.
2014-10-24 14:05:58 -07:00
Robert Moore
c2bd90bd3b Disassembler: Add support for C-style operators and expressions.
Now emit ASL+ code which includes C-style operators.
Optionally, legacy text ASL operators can still be emitted.
2014-10-24 13:07:24 -07:00
Robert Moore
468a8d5b86 AcpiExec: Add option to specify an object initialization file.
This option (-fi) allows the specification of a file that is used
to specify initialization values for individual namespace objects.
Each line in the file is in the format:

<ACPI pathname> <Integer Value>
2014-10-08 13:44:39 -07:00
Robert Moore
26b2408ab6 iASL: Add option to "prune" parse tree for debug only.
Allows devices, methods, or if/else blocks to be removed from
the parse tree in order to attempt to isolate a block of ASL
code that is causing a problem. Debug enhancement.
David E. Box.
2014-10-08 09:06:48 -07:00
Robert Moore
3513dd60e0 iASL: Update MSVC project file.
Correct some issues with the debug generation of the
main parser file.
2014-10-08 07:25:00 -07:00
Robert Moore
f3b516dfd5 iASL/Disassembler: Add support for hardware summary mapfiles.
Adds support for both iASL and the disassembler to create a hardware
and connection summary mapfile (via the -lm option.)
2014-09-19 10:03:56 -07:00
Robert Moore
08b1a9ef1e iASL/Makefile/ProjectFile: Update dependencies.
Update .y file dependencies to correctly build iASL for any .y
file changes.
2014-09-17 10:13:10 -07:00
Robert Moore
f79e3a14c5 acpiexamples: Makefile fix for incorrect CFLAGS.
Was using "EXAMPLES" instead of "ACPIEXAMPLES". Dean Nelson,
dnelson@redhat.com. ACPICA BZ 1105.
2014-09-09 08:24:45 -07:00
Robert Moore
eaf23b74bd acpiexec: Update makefiles and project files for new file.
aeregion.c
2014-09-02 12:56:08 -07:00
Robert Moore
f159658034 iASL: Improve cacheing, reduce memory leaks.
Ensure that the parse tree is deleted for each compile.
Fix other miscellaneous memory leaks per-compile.
Consistently deploy the use of the string cache.
Add tracking for multiple buffers within caches.
Ensure the cache buffers are always deleted.
2014-08-13 13:03:09 -07:00
Robert Moore
d8450d1043 iASL: Split huge parser file into multiple subfiles. Uses M4.
Split the main aslcompiler.y file into a master file and 4 included
subfiles, using the M4 macro processor to perform the actual include,
since Bison does not provide this function.

Makefiles/project files updated.

M4 is typically included in the Bison package, for both Windows
and Unix.
2014-08-08 14:31:29 -07:00
Robert Moore
99e12b1943 iASL: Split ASCII support functions to a new file.
New file is aslascii.c
2014-08-01 14:09:37 -07:00
Robert Moore
b452ef99a5 Makefiles/ProjectFiles: Update for new files.
Update for new files created in the previous commit.
2014-07-18 14:33:50 -07:00
Robert Moore
f26b0d861f Update Windows/MSVC project files for new source files.
Update all projects for various new C source files.
2014-06-24 15:04:09 -07:00
Lv Zheng
6d94e241e3 EFI: Add EFI support for acpidump.
This patch enables acpidump for EFI. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-06-12 15:16:23 +08:00
Lv Zheng
da73e87ad9 EFI: Add generic OSL support for GNU EFI development.
This patch adds generic OSL for GNU EFI shell development.

The following files are enhanced with GNU EFI builds:
1. os_specific/service_layers/osefixf.c
2. include/platform/acefi.h

Note that this patch only uses GNU EFI definitions and the following 2
implementations:
1. Linking GNU EFI entry point and we implements efi_main();
2. Linking DivU64x32 to perform division.
This is because:
1. We do not want to maintain architecture specific code in ACPICA, the
   entry point and division implementation are architecture specific;
2. We do not want to define all EFI structures/macros again to inflate our
   initial implementation. Since for non-architecture specific code, we
   should try our best to implement our own to be more portable, we may
   redefine these stuff in the future as they are not architecture
   specific.

Note that linking DivU64x32() to implement ACPI_DIV_64_BY_32() can produce
correct division result for AcpiUtDivide(), but it is not performance
friendly as the two APIs have different meanings. This definitely will slow
down the applications. There is no architecture specific API in GNU EFI
that has implemented the same meaning as ACPI_DIV_64_BY_32(), so we have no
choice. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-06-12 15:16:22 +08:00
Lv Zheng
3d7add2b94 EFI: Add build environment support for GNU EFI development.
This patch adds build environment for GNU EFI shell development.

Note that only the Makefiles used by EFI development are created in this
patch, actual OSL is not implemented and ACPICA applications are enabled in
this patch. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-06-12 15:16:22 +08:00
Lv Zheng
3d44182bff Common: Enhance AcpiGetopt() to improve portability.
This patch enhances AcpiGetopt() by converting the standard C library
invocations into portable ACPI string APIs and AcpiLogError() to improve
portability.

With actual references added to AcpiLogError(), the applications need to
link utlibcfs.o, utdebug.o, utexcep.o, utmath.o, utprint.o and utxferror.o.
Though it is required to add AcpiOsInitialize() invocations if an
application starts to use AcpiLogError(), this doesn't appear in this
patch. A previous patch in the same series should have already added
AcpiOsInitialize() invocations for all applications. Lv Zheng.

With actual references added, some utilities need to add utlibcfs.o,
utdebug.o, utexcep.o, utmath.o, utprint.o and utxferror.o in order to
link. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-06-12 15:16:20 +08:00
Lv Zheng
58887a7b95 Common: Enhance CmGetFileSize() to improve portability.
This patch uses abstract file IO and AcpiLogError() APIs to enhance
CmGetFileSize() so that applications that invoke this API could have
portability improved.

With actual references added to abstract file IO and AcpiLogError(), the
applications need to link utlibcfs.o, utdebug.o, utexcep.o, utmath.o,
utprint.o and utxferror.o.
Though it is required to add AcpiOsInitialize() invocations if an
application starts to use AcpiLogError(), this doesn't appear in this
patch. A previous patch in the same series should have already added
AcpiOsInitialize() invocations for all applications. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-06-12 15:16:19 +08:00
Lv Zheng
630622cedf Application: Enhance ACPI_USAGE_xxx/ACPI_OPTION with AcpiOsPrintf() to improve portability.
This patch enhances ACPI_USAGE_xxx/ACPI_OPTION macros to use portable
AcpiOsPrintf() so that usage functions for applications no longer rely on
the printf() API.

To use AcpiOsPrintf() exported by osunixxf.c/oswinxf.c as a replacement of
printf, applications need to initialize AcpiGbl_OutputFile to stdout and
initialize AcpiGbl_DbOutputFlags to ACPI_DB_CONSOLE_OUTPUT. The latter is
automatically done by ACPI_INIT_GLOBAL(), applications need to link
utglobal.o to utilize this mechanism. For GCC, assigning stdout to
AcpiGbl_OutputFile using ACPI_INIT_GLOBAL() is not possible as stdout is
not a constant in GCC environment. As an alternative solution, stdout
assignment has been put into AcpiOsInitialize(). Thus AcpiOsInitialize()
need to be invoked very early by the applications to initialize the default
output of AcpiOsPrintf() to keep behavior consistency.

The details of AcpiOsInitialize() are as follows:
1. acpidump have already invoked AcpiOsInitialize(), thus no need to add.
2. acpiexamples/acpiexec/acpinames have already invoked
   AcpiInitializeSubsystem() very early, thus no need to add
   AcpiOsInitialize() for them.
3. iasl have already invoked AcpiOsInitialize(), but the invocation is not
   early enough to make its usage functioning proper. This patch adds an
   early AcpiOsInitialize() invocation for it.

Unix makefiles are also updated to include osunixxf.o/utglobal.o in this
patch.  The acpihelp/acpisrc/acpixtract applications are the only ones that
do not have the 2 object files linked. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-06-12 15:16:19 +08:00
Lv Zheng
5bf3cb862f Utilities: Introduce AcpiLogError() to improve portability.
Invocations like fprintf(stderr) and perror() are not portable, this patch
introduces AcpiLogError() as a replacement, it is implemented using new
portable API - AcpiUtFileVprintf().

Some applications are already referencing utdebug.c, they now need to build
utlibcfs.c/utprint.c as well.

Note that though AcpiOsInitialize() need to be invoked prior than using
this new API, since no users are introduced in this patch, such invocations
are not added for applications that link utprint.c in this patch. Futher
patches that introduce users of AcpiLogError() should take care of this.
Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-06-12 15:16:18 +08:00
Lv Zheng
5bc4ac7ffc OSL: Cleanup AcpiOsPrintf()/AcpiOsVprintf() stubs.
This patch is mainly for acpidump where there are redundant
AcpiOsPrintf()/AcpiOsVprintf() stubs implemented. This patch cleans up such
specific implementation by linking acpidump to osunixxf.c/oswinxf.c.

To make AcpiOsPrintf() exported by osunixxf.c/oswinxf.c to behave as the
old acpidump specific ones, applications need to:
1. Initialize AcpiGbl_DbOutputFlags to ACPI_DB_CONSOLE_OUTPUT.
   This is automatically done by ACPI_INIT_GLOBAL(), applications need to
   link utglobal.o to utilize this mechanism.
2. Initialize AcpiGbl_OutputFile to stdout.
   For GCC, assigning stdout to AcpiGbl_OutputFile using ACPI_INIT_GLOBAL()
   is not possible as stdout is not a constant in GCC environment. As an
   alternative solution, stdout assignment is put into AcpiOsInitialize().
   Thus AcpiOsInitialize() need to be invoked very early by the
   applications to initialize the default output of AcpiOsPrintf().

Note that acpidump has been released to Linux kernel, after adding
osunixxf.c to generate/unix/acpidump/Makefile, libacpica.sh also need to be
updated to release osunixxf.c to Linux kernel. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-06-12 15:13:10 +08:00
Lv Zheng
a97e1f7691 Utilities: Cleanup DEFINE_ACPI_GLOBALS by moving AcpiUtInitGlobal() from utglobal.c to utinit.c.
The utglobal.c is used to define and initialize global variables.  It makes
sense if just adding utglobal.o to applications that are using such
variables. But AcpiUtInitGlobals() is preventing us from doing so as this
initialization function references other components' initializations code,
which leads to the requirement that many files should also get linked if
one wants to link utglobal.o.

By eliminating the stubs for acpiexamples, acpinames, iasl, now it is
possible to just move AcpiUtInitGlobal() to utinit.c for applications that
require this function to link.

By linking utglobal.o, we can stop defining DEFINE_ACPI_GLOBALS for
applications (currently only acpidump is affected). Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-06-12 15:13:10 +08:00
Lv Zheng
f5aca417dd acpinames: Cleanup stubs by linking some utilities objects.
This patch tries to reduce stubs for acpinames by adding some utilities
objects to link.

By doing so, we have to create stubs for AcpiEvTerminate(). While
definining ACPI_REDUCED_HARDWARED can eliminate such requirements
permanently. Then we are able to delete some AcpiHwXXX() AcpiEvXXX() stubs
from anstubs.c

It also makes senses to link exsystem.o and exmutex.o because they've
already been made no-op by underlying OSL. By doing so, we can reduce some
AcpiExXXX() stubs.

Linking utids.o and uteval.o can help to reduce lots of stubs. It's safe to
do so as such functions are not invoked by acpinames.

This is the minimal effort to removing stubs from acpinames. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-06-12 15:13:09 +08:00
Lv Zheng
2441e00269 acpiexamples: Enable notify/region examples.
The patch is generated in the purposes of:
1. AcpiOsPrintf()/AcpiOsVprintf() need to be linked by applications;
2. utglobal.o linkage is prefered than defining DEFINE_ACPI_GLOBALS for
   applications, then applications that have already linked to utinit.o
   need to be updated, especially, their stubs need to be updated.

The acpiexamples loads tables and invokes control methods, waiting for
notifications, possibly in the future we can add region demonstrations.
Thus it makes senses to link acpiexamples to all of the following
components:
  tables
  namespace
  dispatcher
  executer
  parser
  events (notify/region part)

This patch updates acpiexamples in the way of:
1. Linking all namespace/utilities objects and deleting stubs of
   AcpiUt/AcpiNs functions from exstubs.c;
2. Linking all region/notify objects and deleting relevent stubs of AcpiEv
   functions from exstubs.c;
3. Adding region/notify examples in the DSDT.
4. Converting AcpiOsExecute() into a direct callback invocation.
5. Linking hwpci.c, the file has nothing to do with hardware, it is more
   suitable to be utpci.c;
6. Since no hardware samples are demonstrated in acpiexamples, defining
   ACPI_REDUCED_HARDWARE to 1 and deleting relevent stubs of AcpiHw
   functions from exstubs.c.

This patch thus updates exstubs.c with such minimal efforts. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-06-12 15:13:09 +08:00
Lv Zheng
484b7da8ec Utilities: Cleanup use of ACPI_DEBUGGER
The acpinames code defines ACPI_DEBUGGER in order to link
AcpiDbReadTableFromFile(). This patch splits the AcpiDbReadTableFromFile()
function from the debugger and implements it in a generic utilities API so that
acpinames no longer needs to link the debugger for this.

Because acpinames needs access to dump functions, ACPI_DEBUG_OUTPUT needs to be
defined and AcpiDbgLevel needs to be set to maintain consistent behavior.

This patch also cleans up ACPI_DEBUGGER for acpihelp.

This patch is required for removing anstubs.c. Without doing this first,
removing anstubs.c will lead to many link requirements to all debugger and
disassembler objects for acpinames.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-05-20 19:08:52 -07:00
acpibob
4bddc1d21b Update build.txt readme file for SSH.
Add some additional info about SSH access to the git tree.
2014-04-19 22:05:57 -07:00
Robert Moore
2f6f0d2f4a iASL: Improve handling of exception code blocks.
Split exception codes into three distinct blocks; for the main
ASL compiler, Table compiler, and the preprocessor. This allows
easy addition of new codes into each block without disturbing
the others. Adds one new file, aslmessages.c
2014-04-11 14:47:23 -07:00
Lv Zheng
3c1fecab89 acpidump: Update new structures and add missing file.
This patch updates release automation with new structures and files that
are used by the newly released acpidump.  Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-04-10 09:55:21 +08:00
Robert Moore
9d278086a1 Makefiles: Add additional automatic host detection.
Adds auto-detect for FreeBSD and MacOSx.
Ronnie Dilli, Jung-uk Kim.
2014-04-03 11:42:04 -07:00
Robert Moore
7f27ee779a Update acpisubsystem MS project file.
Adds a new file, tbdata.c
2014-03-25 09:30:17 -07:00
Robert Moore
f7009bfa08 AcpiDump: Add support to generate acpidump release.
This pactch adds AcpiDump release automation support. Lv Zheng.
2014-03-25 07:58:36 -07:00
Robert Moore
e7818427a2 Table Manager: Split tbinstal.c into two files.
New file is tbdata.c -- management functions for ACPICA table
manager data structures.
2014-03-20 14:12:15 -07:00
David E. Box
54cfe2454d Modify instructions for updating release version on acpica.org.
acpica.org now supports using a token to modify all page references to the
release version. Updates the instructions in build.txt.
2014-03-12 20:20:43 -07:00
Robert Moore
fe1009618e Disassembler: Add support to decode _HID and _CID values.
For _HID and _CID, the disassembler will emit a string that describes
the device if the _HID/_CID value is recognized. AcpiHelp updated also.
AcpiHelp will now search for a specific ID as well as displaying
the list of "known" (to ACPICA) IDs.
2014-02-28 14:51:56 -08:00
Robert Moore
1824846998 ACPICA tools: Add common function to get file size.
Replaces 7 separate instances of this common function, with
full exception handling. One new file, common/cmfsize.c
2014-02-18 13:18:17 -08:00
Robert Moore
221fcf4bb3 Unix makefiles: Add a few new compile time warning options.
Some additional gcc 4+ warnings are now enabled.
2014-02-14 09:44:44 -08:00
Robert Moore
548bef3d1a iASL: Remove -g option (get ACPI tables from registry).
This option was only available on Windows. It has been made obsolete
by the acpidump utility, so it is removed from iASL.
2014-02-13 09:23:19 -08:00
Robert Moore
2171e9bafb Update ACPICA build/release instructions.
Add additional info about accounts and documentation.
2014-01-15 12:16:06 -08:00
Robert Moore
2bfdbca305 Update acpica library project file for new debugger file.
Adds dbtest.c
2014-01-14 09:25:56 -08:00
Robert Moore
3f4da4257d AcpiSrc: Add support for patch files.
This change add support to invoke necessary conversions on patch
descriptions in the release process so that human intervention can be reduced.

After applying, data types/structures and mixed case words will be
converted.  It reduces human intervention greatly but we still need to
check the URL address fields (From/Signed-off-by/Buglink/Reported-by/
Tested-by/Original-by/etc.) after conversion as there are low
possibilities that they are matched to the target conversion types.
Lv Zheng.
2014-01-10 14:06:33 -08:00
Robert Moore
360c69d564 Debugger: Add new command to read/write/compare all namespace objects.
This command "test objects" will exercise the entire namespace by
writing new values to each data object, and ensuring that the write
was successful. The original value is then restored and verified.
2014-01-10 09:42:57 -08:00
Robert Moore
41711e6686 Build script: Add example program makefile.
The example code is now a working program, add it to the unix
makefile tree.
2013-12-19 07:42:30 -08:00
Robert Moore
40bbabbc18 Linuxize: Cleanup format conversions.
As AcpiSrc supports the case that the input/output files are the same file,
ACPICA_TMP is not useful for divergence.sh any more.
This patch cleans up ACPICA_TMP by invoking new linuxize_format() function
provided by libacpica.sh.  A similar cleanup is also done in gen-repo.sh in
this patch. Lv Zheng.
2013-12-17 13:30:25 -08:00
Robert Moore
da63493b97 Examples: Update makefiles and project files.
Update for recent changes to the example ACPICA code.
2013-12-13 14:19:26 -08:00
Robert Moore
5465b066f8 Update master build file for ACPICA release packages.
Use quiet mode for dos2unix, unix2dos and pkzip25. This makes the
output of the build much easier to read.
2013-12-09 13:30:06 -08:00
Robert Moore
64a2d59ee9 Update the various ACPICA build readme files.
Miscellaneous fixes and clarifications to help new users generate
the ACPICA code from source.
2013-12-09 13:28:57 -08:00
Robert Moore
4b0367593e Unix makefiles: Add option to disable optimizations and _FORTIFY_SOURCE
Some older compilers have problems compiling ACPICA with optimizations
(reportedly, gcc 4.4 for example). This change adds a command line
option for make (NOOPT) that disables all compiler optimizations and
the _FORTIFY_SOURCE compiler flag. The default optimization is -O2
with the _FORTIFY_SOURCE flag specified. ACPICA BZ 1034.
Lv Zheng, Bob Moore.
2013-11-14 13:37:02 -08:00
Robert Moore
04c53d76ff Update ACPICA build instruction file (build.txt).
Add more detail to the "required tools" section to clarify not
only what tools are needed, but why they are needed, and add pointers
to additional instruction readme files in ACPICA.
2013-11-14 10:31:01 -08:00
Robert Moore
1097e067b9 Linux: Consistently use the bash shell for linuxize scripts.
This patch changes "sh" to "bash" as there are only limitted
shell clones tested for the linuxize scripts.  Lv Zheng.
2013-11-14 08:43:05 -08:00