SHA256
1
0
forked from pool/acpica

- Update to version 20121018

-> remove some patches that got integrated
  -> Add one patch (bob_noop.patch) which will get integrated
     mainline: Stop and bail out when max error (200) count is reached.
     Introduce -in compile/disassemble option.

OBS-URL: https://build.opensuse.org/package/show/hardware/acpica?expand=0&rev=45
This commit is contained in:
Thomas Renninger 2013-01-15 12:59:31 +00:00 committed by Git OBS Bridge
parent 915f41291f
commit fa5702f095
8 changed files with 231 additions and 82 deletions

View File

@ -156,12 +156,16 @@ for file in *.dat;do
REF_TABLE_LIST=${SDTs/$file[[:space:]]/}
# Convert the whitespace list into a comma separated one:
REF_TABLE_LIST=${REF_TABLE_LIST//[[:space:]]/,}
[ "$REF_TABLE_LIST" != "" ] && DISASSEMBLE_OPTIONS="-e ${REF_TABLE_LIST} $DISASSEMBLE_OPTIONS"
if [ "$REF_TABLE_LIST" != "" ];then
FINAL_DISASSEMBLE_OPTIONS="-e ${REF_TABLE_LIST} $DISASSEMBLE_OPTIONS"
else
FINAL_DISASSEMBLE_OPTIONS="$DISASSEMBLE_OPTIONS"
fi
echo "stdout and stderr of $file disassembling:" >log/${table}.log
iasl $DISASSEMBLE_OPTIONS -d $file 1>>log/${table}.log 2>&1
[[ $VERBOSE == 1 ]] && echo "iasl $DISASSEMBLE_OPTIONS -e ${REF_TABLE_LIST} -d $file 1>>log/${table}.log 2>&1"
iasl $COMPILE_OPTIONS ${table}.dsl 1>>log/${table}.log 2>>err/${table}.err
[[ $VERBOSE == 1 ]] && echo "iasl $FINAL_DISASSEMBLE_OPTIONS -d $file 1>>log/${table}.log 2>&1"
iasl $FINAL_DISASSEMBLE_OPTIONS -d $file 1>>log/${table}.log 2>&1
[[ $VERBOSE == 1 ]] && echo "iasl $COMPILE_OPTIONS ${table}.dsl 1>>log/${table}.log 2>>err/${table}.err"
iasl $COMPILE_OPTIONS ${table}.dsl 1>>log/${table}.log 2>>err/${table}.err
;;
*.dat)
iasl -d $file 1>log/${table}.log 2>&1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7b9b91f6dbad151cd1975f39d9bd31bb09c1025a420fe9a16b73042029d17f59
size 821064

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f9120791535c9ff00d9eb69f62673640e744eb63eb455075feee5eb3be75d155
size 827093

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Tue Jan 15 12:55:46 UTC 2013 - trenn@suse.de
- Update to version 20121018
-> remove some patches that got integrated
-> Add one patch (bob_noop.patch) which will get integrated
mainline: Stop and bail out when max error (200) count is reached.
Introduce -in compile/disassemble option.
-------------------------------------------------------------------
Wed Jan 9 01:05:33 UTC 2013 - trenn@suse.de

View File

@ -20,7 +20,7 @@
Name: acpica
Url: http://acpica.org
Version: 20121018
Version: 20121220
Release: 6
License: GPL-2.0
%define src_dir acpica-unix2-%{version}
@ -31,8 +31,7 @@ Source: %{src_dir}.tar.bz2
Patch1: acpica_make_CFLAGS_overridable
Patch2: acpidump-override-CFLAGS.patch
Patch3: acpica-no-compiletime.patch
Patch4: acpica_acpisrc_fix_unused_result.patch
Patch5: acpica_makefile_whitespace_cleanup.patch
Patch4: bob_noop.patch
Source1: ec_access.c
Source2: acpidump-%{dmp_ver}.tar.bz2
Source3: acpi_genl.tar.bz2
@ -69,7 +68,6 @@ Authors:
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
cc %{SOURCE1} $RPM_OPT_FLAGS -o ec_access

View File

@ -1,29 +0,0 @@
acpica: Fix unused result warning
As this is the only place where this warning
happens:
'write', declared with attribute warn_unused_result [-Werror=unused-result]
it might be worth fixing instead of ignoring.
Signed-off-by: Thomas Renninger <trenn@suse.de>
---
source/tools/acpisrc/asfile.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Index: acpica-unix2-20121018/source/tools/acpisrc/asfile.c
===================================================================
--- acpica-unix2-20121018.orig/source/tools/acpisrc/asfile.c
+++ acpica-unix2-20121018/source/tools/acpisrc/asfile.c
@@ -810,7 +810,11 @@ AsPutFile (
/* Write the buffer to the file */
FileSize = strlen (FileBuffer);
- write (DestHandle, FileBuffer, FileSize);
+ if (write (DestHandle, FileBuffer, FileSize) < 0) {
+ perror ("Could not write to destination file");
+ close (DestHandle);
+ return -1;
+ }
close (DestHandle);

View File

@ -1,42 +0,0 @@
acpcia: Fixes some minor Tab vs whitespace issues in Makefiles.
Signed-off-by: Thomas Renninger <trenn@suse.de>
---
generate/unix/acpibin/Makefile | 2 +-
generate/unix/iasl/Makefile | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
Index: acpica-unix2-20120913/generate/unix/acpibin/Makefile
===================================================================
--- acpica-unix2-20120913.orig/generate/unix/acpibin/Makefile
+++ acpica-unix2-20120913/generate/unix/acpibin/Makefile
@@ -27,7 +27,7 @@ HEADERS = \
$(wildcard $(ACPIBIN)/*.h)
OBJECTS = \
- $(OBJDIR)/abcompare.o \
+ $(OBJDIR)/abcompare.o \
$(OBJDIR)/abmain.o \
$(OBJDIR)/utalloc.o \
$(OBJDIR)/utcache.o \
Index: acpica-unix2-20120913/generate/unix/iasl/Makefile
===================================================================
--- acpica-unix2-20120913.orig/generate/unix/iasl/Makefile
+++ acpica-unix2-20120913/generate/unix/iasl/Makefile
@@ -192,13 +192,13 @@ INTERMEDIATES = \
$(OBJDIR)/prparserparse.c
MISC = \
- $(OBJDIR)/aslcompilerparse.h \
+ $(OBJDIR)/aslcompilerparse.h \
$(OBJDIR)/aslcompiler.y.h \
$(OBJDIR)/aslcompilerparse.output \
- $(OBJDIR)/dtparserparse.h \
+ $(OBJDIR)/dtparserparse.h \
$(OBJDIR)/dtparser.y.h \
$(OBJDIR)/dtparserparse.output \
- $(OBJDIR)/prparserparse.h \
+ $(OBJDIR)/prparserparse.h \
$(OBJDIR)/prparser.y.h \
$(OBJDIR)/prparserparse.output

209
bob_noop.patch Normal file
View File

@ -0,0 +1,209 @@
diff --git a/source/compiler/aslcompiler.l b/source/compiler/aslcompiler.l
index 6737c80..f981796 100644
--- a/source/compiler/aslcompiler.l
+++ b/source/compiler/aslcompiler.l
@@ -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/source/compiler/aslerror.c b/source/compiler/aslerror.c
index 99e4a41..e515fda 100644
--- a/source/compiler/aslerror.c
+++ b/source/compiler/aslerror.c
@@ -732,7 +732,6 @@ AslCommonError (
Gbl_SourceLine = 0;
Gbl_NextError = Gbl_ErrorLog;
- CmDoOutputFiles ();
CmCleanupAndExit ();
exit(1);
}
diff --git a/source/compiler/asllisting.c b/source/compiler/asllisting.c
index 991ef17..0247040 100644
--- a/source/compiler/asllisting.c
+++ b/source/compiler/asllisting.c
@@ -189,6 +189,8 @@ LsTreeWriteWalk (
UINT32 Level,
void *Context);
+#define ASL_LISTING_LINE_PREFIX ": "
+
/*******************************************************************************
*
@@ -737,7 +739,8 @@ LsWriteListingHexBytes (
{
case ASL_FILE_LISTING_OUTPUT:
- FlPrintFile (FileId, "%8.8X....", Gbl_CurrentAmlOffset);
+ FlPrintFile (FileId, "%8.8X%s", Gbl_CurrentAmlOffset,
+ ASL_LISTING_LINE_PREFIX);
break;
case ASL_FILE_ASM_SOURCE_OUTPUT:
@@ -797,6 +800,24 @@ LsWriteOneSourceLine (
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, " *");
@@ -812,19 +833,21 @@ LsWriteOneSourceLine (
* 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);
+ 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, "%8d....", Gbl_SourceLine);
+ FlPrintFile (FileId, "%8u%s", Gbl_SourceLine,
+ ASL_LISTING_LINE_PREFIX);
}
- /* Read one line (up to a newline or EOF) */
+ /* Read the rest of this line (up to a newline or EOF) */
- while (FlReadFile (ASL_FILE_SOURCE_OUTPUT, &FileByte, 1) == AE_OK)
+ do
{
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
{
@@ -838,13 +861,15 @@ LsWriteOneSourceLine (
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 */
diff --git a/source/compiler/aslmain.c b/source/compiler/aslmain.c
index 5243024..d4e18aa 100644
--- a/source/compiler/aslmain.c
+++ b/source/compiler/aslmain.c
@@ -225,6 +225,7 @@ Options (
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");
@@ -244,6 +245,7 @@ Options (
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");
@@ -694,6 +696,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);
diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c
index 93e6b2f..a924830 100644
--- a/source/components/disassembler/dmwalk.c
+++ b/source/components/disassembler/dmwalk.c
@@ -513,7 +513,30 @@ AcpiDmDescendingOp (
* This is a first-level element of a term list,
* indent a new line
*/
- AcpiDmIndent (Level);
+ switch (Op->Common.AmlOpcode)
+ {
+ case AML_NOOP_OP:
+ /*
+ * Optionally just ignore this opcode. Some tables use
+ * NoOp opcodes for "padding" out packages that the BIOS
+ * changes dynamically. This can leave hundreds or
+ * thousands of NoOp opcodes that if disassembled,
+ * cannot be compiled because they are syntactically
+ * incorrect.
+ */
+ if (AcpiGbl_IgnoreNoopOperator)
+ {
+ Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
+ return (AE_OK);
+ }
+
+ /* Fallthrough */
+
+ default:
+ AcpiDmIndent (Level);
+ break;
+ }
+
Info->LastLevel = Level;
Info->Count = 0;
}
diff --git a/source/include/acglobal.h b/source/include/acglobal.h
index d17082a..7a71c33 100644
--- a/source/include/acglobal.h
+++ b/source/include/acglobal.h
@@ -484,7 +484,7 @@ ACPI_EXTERN UINT32 AcpiGbl_TraceDbgLayer;
/*****************************************************************************
*
- * Debugger globals
+ * Debugger and Disassembler globals
*
****************************************************************************/
@@ -492,6 +492,8 @@ ACPI_EXTERN UINT8 AcpiGbl_DbOutputFlags;
#ifdef ACPI_DISASSEMBLER
+BOOLEAN ACPI_INIT_GLOBAL (AcpiGbl_IgnoreNoopOperator, FALSE);
+
ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_disasm;
ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_verbose;
ACPI_EXTERN ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList;