iasl compiles Switch/Case statements into a single iteration While
loop with If/Else statements. This patch adds support to recognize
this generated compiler output and disassemble it back to the original
Switch statement.
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
This change fixes a problem with the recent support that enables
control method invocations as Target operands to many ASL
operators. Eliminates errors similar to:
Needed type [Reference], found [Processor]
This patch implements ACPI_DO_ONCE macros to avoid log floodings.
There could be OSPM gaps causing some ACPICA functionalities continously
reporting errors, filling up users' filesystem. Reported by Aaron Franke,
Fixed by Lv Zheng.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=188331
Reported-by: Aaron Franke <arnfranke@yahoo.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
This adds the missing ACPI_PRINTF_LIKE attribute which allows compile time
format string checking (and will be used by the coming initify gcc plugin).
Additionally, this fixes the warnings exposed by the attribute.
Original by Emese Revfy and Kees Cook, Ported by Lv Zheng.
Signed-off-by: Emese Revfy <re.emese@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
This patch adds a demo EFI application for stdin/stdout testing. This
utility can be used to narrow down root causes of porting issues. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
This patch implements putchar()/getchar() invoked in AcpiOsGetLine() to
improve the portability.
No functional changes for Unix/Windows environments. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
This patch implements the native string APIs of strpbrk()/strtok().
Unit tests have been done to these two functions in unix environment and no
bugs have been found. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
This patch added two new Clibrary functions: fgetc()/fputc() for EFI
environment, they are implemented using fread()/fwrite().
Note in this patch, stdin is simply defined as NULL for EFI
environment. Its EFI support should be implemented by further patches.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Following error can be seen in linuxize process:
error: short SHA1 07630ad9 is ambiguous.
error: short SHA1 07630ad9 is ambiguous.
fatal: ambiguous argument '07630ad9': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
Fixing this by stop cutting commit IDs into 8-digits.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Build environment has changed because of new improvements:
1. New files are split
2. New inclusion order
This patch updates MSVC project files accordingly.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
This reverts commit 34ccd43af3fd1870fddfac0617dd0ba706963558.
This is an attempt to remove all references in the source to the
FADT version 2, which never was a legal version number. It was
skipped because it was an early version of 64-bit support that
was eventually abandoned for the current 64-bit support.
Appears to have caused problems on some machines. Another attempt
at this will be made later.
fopen mode "t" is non-standard and specific to Windows. Since the
default mode is already text ("b" is needed for binary mode), just
remove it. (This matches all other fopen callers in ACPICA that open a
text file). There is no functional change.
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Currently acpixtract expects that acpidump lines are terminated by LF.
This is not always true, for example when taking the acpidump output
from Windows or from pastebin websites (HTML forms always convert input
to CRLF per HTML5 specification). On such files with CRLFs, acpixtract
would output only the first table from the file.
That happens because `\r\n` is not considered an empty line. Then
AxListTables would continue trying to read a whole header (`\r\nSSDT @
0x...`) and discover that `\r\nSS` is not a valid signature and skip to
the next line. At that point however, the file pointer has advanced and
no new header can be matched anymore.
Affected functions are AxCountTableInstances, AxIsDataBlockHeader,
AxProcessOneTextLine (from axutils.c) and AxListTables (from
acpixtract.c). All of these functions skip the input line if it is
determined to be an empty line (ends with LF). To handle the above
situation, consider a CR (part of CRLF) also as newline.
There is no need to replace the CRLF by LF for normal use:
- AxListTables first reads a line (presumably `SSDT @ 0x...`), then
reads the actual data lines via AxGetTableHeader. That uses
AxConvertLine which uses `sscanf(InputLine, "... %x")` and needs no
further changes.
- AxExtractTables and AxExtractToMultiAmlFile uses
(1) AxIsDataBlockHeader to find the first line (`SSDT @ ...`) but
only looks at the first four characters for the signature.
(2) AxProcessOneTextLine for data lines which uses AxConvertLine
which was already shown to be safe.
- AxListTables may also check whether a table needs a number suffix and
call AxGetNextInstance which calls AxCountTableInstances. That
function is similar to AxIsDataBlockHeader, but additionally counts
the number of occurrences. This is also safe.
Signed-off-by: Peter Wu <peter@lekensteyn.nl>