Commit Graph

11794 Commits

Author SHA1 Message Date
Robert Moore
bffc163770 AcpiSrc: Add support to modify include file paths/names.
This change adds support to enable AcpiSrc to modify include file
pathnames and/or filenames. This is useful for linuxization.
Lv Zheng.
2013-09-27 08:27:15 -07:00
Robert Moore
b83c59cdca Linuxize: Add local declarations for script subfunctions.
All functions defined for the linuxizing scripts lack "local"
declarations.  This patch adds "local" for all such variables.  No
functional changes.  Lv Zheng.
2013-09-27 08:10:00 -07:00
Robert Moore
3a475e8d8b Update aclinux.h for new OSL override mechanism.
The new ACPICA OSL override mechanism is used to solve these issues
for the Linux OSL:
1. Linux can implement OSL using macro.
2. Linux can implement OSL using inlined function.
3. Linux can leave OSL not implemented for __KERNEL__ undefined code
   fragments.
4. Linux can add sparse declarators (__iomem) to OSL.
5. Linux can add memory tuning declarators (__init/__exit) to OSL.

This patch also changes the coding style used in aclinux.h to be ACPICA coding
style as long as these changes can be automatcally reverted by ACPICA release
process:
1. Extra spaces in the inline functions are revertable.
2. Extra spaces in the macros are not revertable.
3. Tab stop in the inline functions and macros are revertable.
4. Symbol names in the inline functions and macros are revertable.
NOTE: Linux symbol names are not converted.  Lv Zheng.
2013-09-27 07:26:27 -07:00
Robert Moore
9905cd7403 AcpiDump: Allow tables that contain only an ACPI table header.
Apparently, some BIOSs create SSDTs that contain an ACPI table header
but no other data. This change adds support to dump these tables. Any
tables shorter than the length of an ACPI table header remain in error.
(an error message is emitted.) Reported by Yi Li.
2013-09-26 13:48:31 -07:00
Robert Moore
f8fdcaa5a7 Add support to allow host to redefine individual OSL prototypes.
This change enables the host to redefine OSL prototypes found in the
acpiosxf.h file. This allows the host to implement OSL interfaces with
a macro or inlined function. Further, it allows the host to add any
additional required modifiers such as __iomem, __init, __exit, etc.,
as necessary on a per-interface basis. Enables maximum flexibility
for the OSL interfaces. Lv Zheng.
2013-09-26 12:36:19 -07:00
Robert Moore
0d93cbf26f ASLTS: Update tests for FieldUnit and BufferField.
Fixes errors in ASLTS due to an incorrect interpretation of the
use of references for Field Units and Buffer Fields. Per the ACPI
spec, "Fields permanently retain their types and cannot be changed".
Fixes those errors that incorrectly expected the Field type to change.
David Box.

Please enter the commit message for your changes. Lines starting
2013-09-26 11:49:08 -07:00
Robert Moore
51527fe019 Simplify configuration of global ACPI_REDUCED_HARDWARE macro.
Surround definition of this with a #ifndef so that the kernel
can define it elsewhere if desired.
2013-09-26 10:47:21 -07:00
Robert Moore
d09bc88ad2 AcpiSrc: Fix indentation issues for macro invocations.
During the linuxizing process, some extra white spaces are added by the
"indent" program at the beginning of the line which is an invocation of a
macro and there is no ";" at the end of the line.

This patch adds new mode to AcpiSrc to remove extra spaces inserted before
invoking such macros and add an empty line between the invocations of such
macros (like the other function declarations).  This new mode is executed
after executing "indent" during the Linux release process.

The affected macros and files are:
 1. ACPI_HW_DEPENDENT_RETURN (acpixf.h):
    This macro is used as a wrapper for hardware dependent APIs to offer a
    stub when the reduced hardware is configured during compilation.
 2. ACPI_EXPORT_SYMBOL (utglobal.c):
    This macro is used by Linux to export symbols to be found by Linux
    modules.  All such invocations are well formatted except those exported
    as global variables.

This can help to reduce the source code differences between Linux and
ACPICA, and also help to automate the release process.  Lv Zheng.
2013-09-26 08:33:05 -07:00
Robert Moore
e093a60d8b Prevent possible build issues for use of ACPI_PRINTF_LIKE macro
This macro is used in the OSL header. This change modifies the position
of this macro in each instance where it is used (AcpiDebugPrint, etc.)
to avoid build issues if the OSL defines the implementation of the interface
to be an inline stub function. Lv Zheng.
2013-09-26 08:09:11 -07:00
Robert Moore
f2c386eee6 Cleanup global variable that is used only by OSL code.
Move AcpiGbl_DebugTimeout from AcpiExec to the OSL layer so that
any new utilities linked to the OSL file(s) won't have to define
it in order to link. Lv Zheng.
2013-09-25 13:56:13 -07:00
Robert Moore
8cd93d4ce0 AcpiExec: Remove unused variable.
Remove an unused local variable from the acgetline module.
2013-09-25 12:38:06 -07:00
Robert Moore
015bcb3d8b AcpiExec: Add full line-editing support for Unix/Linux systems.
Adds a portable module to perform line editing via right-arrow,
left-arrow, and the DEL key. Portability is the key here, so
we don't attempt to use readline(), etc.
2013-09-25 12:19:39 -07:00
Robert Moore
c1f5977c79 Deploy ACPI_EXPORT_SYMBOL_INIT for main ACPICA initialization interfaces.
This change adds a new macro for the main init and terminate external
interfaces in order to support hosts that require additional or different
processing for these functions. Changed from ACPI_EXPORT_SYMBOL to
ACPI_EXPORT_SYMBOL_INIT. Lv Zheng, Bob Moore.
2013-09-20 09:19:58 -07:00
Robert Moore
447120f07d Debugger: Echo actual command for "unknown command" message.
Output is now: <command>: unknown command
Provides some additional information, especially if line-editing
is involved.
2013-09-20 09:17:20 -07:00
Robert Moore
3262a4bfb0 Linuxize: Change indentation of C labels.
It is reported by kernel build test systems that all ACPICA linuxized
files have incorrect label indentation.  This patch changes default indent
option to fix this bug.  Lv Zheng.
2013-09-19 07:58:02 -07:00
Robert Moore
24298543de Update comment: no functional change.
Adds a comment to clarify reason for using AcpiOsFree directly
instead of ACPI_FREE.
2013-09-19 07:44:29 -07:00
Robert Moore
68be8c5b8d Add EXPORT_ACPI_INTERFACES macro to external interface modules.
This change adds this new macro to all files that contain external
ACPICA interfaces. It can be detected and used by the host (via the
host-specific header) for any special processing required for such
modules. Lv Zheng.
2013-09-18 14:26:21 -07:00
Robert Moore
57bdfbee67 Hardcode access width for the reset register.
The ACPI spec requires the reset register width to be 8, so we
now hardcode it and ignore the FADT value. This provides/maintains
compatibility with other ACPI implementations that have allowed
BIOS code with bad register width values to go unnoticed.
Matthew Garett, Bob Moore, Lv Zheng.
2013-09-18 14:17:17 -07:00
Robert Moore
c9ea44b39e Gcc-specific header: replace __FUNCTION__ with __func__
The __func__ is c99 standard declarator which is used by GCC.
Lv Zheng.
2013-09-18 13:56:42 -07:00
Robert Moore
6ac115c242 Fix several possible memory leaks in the GPE handling.
This change fixes several potential memory leaks in the error paths
of the GPE handling code. Lv Zheng.
2013-09-18 13:34:02 -07:00
Robert Moore
b30264449d Predefine name macros: Sort list, add _CBA method.
_CBA is used in at least Linux.
2013-09-18 13:25:46 -07:00
Robert Moore
d8a0e964dd iASL/Makefile: Add parallel compilation support.
This patch enables parallel compilation for iASL. Fixes issues
caused by the YACC header generation.
Reported by Andrew McDermott, fixed by Lv Zheng.
2013-09-18 13:15:38 -07:00
Robert Moore
c0671907c6 Linuxize: Fix several issues in libacpica.sh
This patch includes the following fixes:
1. removes non-Linux header files from release process.
2. makes the path names in the generated divergences diff to be relative
   path names.
These changes affect the scripts in the generate/linux folder.  Lv Zheng.
2013-09-18 12:46:01 -07:00
Robert Moore
a7b23d6256 Linuxize: Split git-extract.sh into two scripts.
This patch splits git-extract.sh so that the changes made in the
scripts can be linuxized into patches. Lv Zheng.
2013-09-18 12:41:12 -07:00
Robert Moore
d01b604951 Cleanup memory allocation macros and configurability.
In the common case, the ACPI_ALLOCATE and related macros now resolve
directly to their respective AcpiOs* OSL interfaces. Two options:
1) The ACPI_ALLOCATE_ZEROED macro defaults to a simple local implementation
by default, unless overridden by the USE_NATIVE_ALLOCATE_ZEROED define.
2) For AcpiExec (and for debugging), the macros can optionally be
resolved to the local interfaces that track each allocation (used
to immediately detect memory leaks).
Lv Zheng.
2013-09-18 12:24:15 -07:00
Robert Moore
a46683c938 Debugger/Apps: Add safe versions of common string functions.
This change adds and deploys "safe" versions of strcpy and strcat that
ensure that the target buffer does not overflow. These safe functions
are only helpful for processing user input and command lines. For most
ACPICA code however, the required buffer length is precisely calculated
before buffer allocation, so the use of these functions is unnecessary.
ACPICA BZ 1043.
2013-09-18 08:41:48 -07:00
Robert Moore
c2523c3f95 Fix a macro for the hardware-reduced case
This fix repairs a version of a macro that is used for the hardware
reduced case only. It adds a return statement to the macro definition
so that the AcpiSrc translation will not completely delete the second
line of the macro because it thinks that it is an empty block. It actually
clarifies the use of the macro anyway.
2013-09-18 08:34:22 -07:00
Robert Moore
581de77bc9 AcpiExec: Add history/line-editing for Unix/Linux systems.
This change adds full history and limited line editing for Unix and
Linux systems. It does not use readline() because of portability issues.
Instead it uses the POSIX termio interface to put the terminal in raw
input mode so that the various special keys can be trapped (such as
up-arrow and down-arrow for history support).
2013-09-13 12:58:31 -07:00
Robert Moore
de4006bfe4 iASL: Additional fix for wildcard support.
Fixes a possible fault caused by the previous commit for wildcard
changes. Code restructuring left a global variable uninitialized.
2013-09-12 12:50:35 -07:00
Robert Moore
f9668dcffe Debugger: Add a check for a null node during namespace walk.
Mostly for consistency. ACPICA BZ 1042.
2013-09-05 09:15:19 -07:00
Robert Moore
a0436de828 AcpiExec: Add tests for multiple UEFI table support.
This change adds a second UEFI table that is installed by AcpiExec,
then AcpiExec retrieves both tables via the AcpiGetTableHeader and
AcpiGetTable interfaces.
2013-09-05 08:33:10 -07:00
Robert Moore
12bf088481 Fix for a Store->ArgX when ArgX contains a reference to a field.
This change fixes a problem where a Store operation to an ArgX object
that contained a reference to a field object did not complete the
automatic dereference and then write to the actual field object.
Instead, the object type of the field object was inadvertently changed
to match the type of the source operand. The new behavior will actually
write to the field object (buffer field or field unit), thus matching
the correct ACPI-defined behavior.
2013-09-04 14:14:40 -07:00
Robert Moore
e8a9da8c59 Table print header function: Increase default width for table length.
This change increases the default width for the length from 5 to 6,
to improve alignment/readability on systems with large tables. These
are being seen more frequently, especially large DSDTs (greater than
1 MB).
2013-09-04 12:57:48 -07:00
Robert Moore
49f7852a21 AcpiXtract: Handle "empty" lines containing one or more spaces.
Empty lines are ignored by the utility. This change allows AcpiXtract
to correctly handle lines that contain simply one or more spaces as
empty lines. ACPICA BZ 1044.
2013-09-04 12:50:31 -07:00
Robert Moore
93c1c10009 iASL: Implement wildcard support for -e option (get external tables).
This change implements wildcard support for this option. It also
removes the local implementation of wildcard expansion. This part
affects the windows version only. Windows version is now linked
to the setargv.obj library to get this support.
2013-08-30 13:05:16 -07:00
Robert Moore
1ce28e58d5 AcpiExec: Remove local wildcard support.
This change affects windows version only; AcpiExec now is linked
to the windows setargv.obj which implements wildcards. So, all
code related to wildcards is now removed.
2013-08-30 13:02:21 -07:00
Robert Moore
f4205d8e26 Debugger: Ensure that debug output is immediately disabled on termination.
Set the global debug flag to "no output" when the debugger is
shutdown. ACPICA BZ 1011. Tomasz Nowicki.
2013-08-23 13:22:55 -07:00
Robert Moore
b53ee89773 Update ACPICA build instruction file (build.txt).
Fix some missing steps.
2013-08-23 13:21:52 -07:00
Robert Moore
a8f8380a74 Update version to 20130823.
Version 20130823.
2013-08-23 09:45:59 -07:00
Robert Moore
4ff41a8844 Logfile: Changes for version 20130823.
Version 20130823.
2013-08-23 09:45:17 -07:00
Robert Moore
1ab2505cca Documents: Updates for ACPICA and iASl references.
Update to reflect changes in version 20130823.
2013-08-23 09:17:30 -07:00
Robert Moore
ac4b505600 Linux scripts: Update file permissions to add execute.
Simple change to add execute permission as the default.
2013-08-23 08:19:18 -07:00
Robert Moore
4186927833 AcpiDump/Linux: Update for code style, no functional change.
Fixes a while(1) loop to improve readability.
Lv Zheng.
2013-08-23 08:10:20 -07:00
Robert Moore
99779c83f4 AcpiDump: Update for FreeBSD support only.
Adds some conditional compiles required for FreeBSD support.
2013-08-23 08:04:55 -07:00
Robert Moore
08093adb7c Windows table OSL: Compile local mapping functions for acpidump only.
iASL uses oswinxf also, where the original copy of these functions exist.
Does not seem to be worthwhile at this time to split these into a
separate file, but we don't want to link oswinxf into AcpiDump.
2013-08-23 07:57:27 -07:00
Robert Moore
bbd28ae4c1 SCI Handlers: Update handler interface, eliminate unnecessary argument.
The SCI interrupt number is not needed for the SCI handlers, and was
just unnecessary overhead.
2013-08-22 12:56:38 -07:00
Robert Moore
b0cf3e5a09 SCI handlers: Optimize installation by only locking SCI list once.
The code was locking the list twice. Allocate the new SCI handler object
up front to eliminate the second lock, and free the object on any
error.
2013-08-22 12:55:20 -07:00
Robert Moore
d36dbb46ca AcpiDump: Code cleanup, no functional change.
Fix some indenting and whitespace issues.
2013-08-22 09:47:14 -07:00
Robert Moore
181e81c61a AcpiDump: Update for windows OSL and project file.
Port windows version to the recent AcpiDump changes.
2013-08-22 09:31:27 -07:00
Robert Moore
88c42a5f57 AcpiDump: Cleanup exception codes in the Linux OSL.
This patch cleans up ACPI_STATUS returned in the Linux version of AcpiDump.

These changes include:
1. AE_ACCESS is added to reflect requirement of root priviledge.
2. AE_BAD_ADDRESS is used where address is 0.
3. AE_BAD_SIGNATURE is returned where root cause of the error is the
   signature.
4. AE_BAD_HEADER is returned especially on a failure of ApGetTableLength().
5. AE_INVALID_TABLE_LENGTH is returned when reading table content fails
   while reading table header succeeds.
6. AE_ERROR is no longer used for the Linux version.
Some error prompts are also cleaned up in this patch.  Lv Zheng.
2013-08-22 09:28:16 -07:00