commit 5db245f2cef03f05175ff8f13faf77584947bee8fa2a3031ddb9d88e8e69f95b Author: OBS User unknown Date: Mon May 4 02:25:58 2009 +0000 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/acpica?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/acpica-override-CFLAGS.diff b/acpica-override-CFLAGS.diff new file mode 100644 index 0000000..e674f08 --- /dev/null +++ b/acpica-override-CFLAGS.diff @@ -0,0 +1,68 @@ +Make it possible to extend CFLAGS when invoking make + +From: Thomas Renninger + +--- + compiler/Makefile | 2 +- + tools/acpiexec/Makefile | 2 +- + tools/acpisrc/Makefile | 4 ++-- + tools/acpixtract/Makefile | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) + +Index: acpica-unix-20090320/compiler/Makefile +=================================================================== +--- acpica-unix-20090320.orig/compiler/Makefile ++++ acpica-unix-20090320/compiler/Makefile +@@ -92,7 +92,7 @@ SRCS= aslcompilerparse.c aslcompilerlex. + ../osunixxf.c + + NOMAN= YES +-CFLAGS+= -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include ++override CFLAGS+= -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include + + #YACC= yacc + YACC= bison +Index: acpica-unix-20090320/tools/acpiexec/Makefile +=================================================================== +--- acpica-unix-20090320.orig/tools/acpiexec/Makefile ++++ acpica-unix-20090320/tools/acpiexec/Makefile +@@ -133,7 +133,7 @@ SRCS= aetables.c aehandlers.c aeexec.c a + ../../osunixxf.c + + +-CFLAGS+= -Wall -g -D_LINUX -DNDEBUG -D_CONSOLE -DACPI_EXEC_APP -D_MULTI_THREADED -Wstrict-prototypes -I../../include ++override CFLAGS+= -D_LINUX -DNDEBUG -D_CONSOLE -DACPI_EXEC_APP -D_MULTI_THREADED -Wstrict-prototypes -I../../include + + + acpiexec : $(patsubst %.c,%.o, $(SRCS)) +Index: acpica-unix-20090320/tools/acpixtract/Makefile +=================================================================== +--- acpica-unix-20090320.orig/tools/acpixtract/Makefile ++++ acpica-unix-20090320/tools/acpixtract/Makefile +@@ -3,7 +3,7 @@ + PROG= acpixtract + SRCS= acpixtract.c + +-CFLAGS+= -Wall -O2 -D_LINUX -DACPI_APPLICATION -Wstrict-prototypes -I../../include ++override CFLAGS+= -D_LINUX -DACPI_APPLICATION -Wstrict-prototypes -I../../include + + + acpixtract : $(patsubst %.c,%.o, $(SRCS)) +Index: acpica-unix-20090320/tools/acpisrc/Makefile +=================================================================== +--- acpica-unix-20090320.orig/tools/acpisrc/Makefile ++++ acpica-unix-20090320/tools/acpisrc/Makefile +@@ -4,11 +4,11 @@ PROG= acpisrc + SRCS= ascase.c asconvrt.c asfile.c asmain.c asremove.c astable.c \ + asutils.c osunixdir.c ../../common/getopt.c + +-CFLAGS+= -Wall -O2 -D_LINUX -DACPI_APPLICATION -Wstrict-prototypes -I../../include ++override CFLAGS+= -D_LINUX -DACPI_APPLICATION -Wstrict-prototypes -I../../include + + + aslmain : $(patsubst %.c,%.o, $(SRCS)) +- $(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG) ++ $(CC) $(LDFLAGS) $(CFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG) + + CLEANFILES= $(PROG) + diff --git a/acpica-unix-20090320.tar.bz2 b/acpica-unix-20090320.tar.bz2 new file mode 100644 index 0000000..e5a81af --- /dev/null +++ b/acpica-unix-20090320.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:162f2957bcc623316d416cc5f6d8cdb29f59bd6868a6288a63b452a64977614c +size 618428 diff --git a/acpica.changes b/acpica.changes new file mode 100644 index 0000000..7661b91 --- /dev/null +++ b/acpica.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Wed Apr 8 15:06:17 CEST 2009 - trenn@suse.de + +- Initial check-in: Version 20090320 + diff --git a/acpica.spec b/acpica.spec new file mode 100644 index 0000000..6d5e3ed --- /dev/null +++ b/acpica.spec @@ -0,0 +1,103 @@ +# +# spec file for package acpica (Version 20090320) +# +# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + +# norootforbuild + + +Name: acpica +Url: http://acpica.org +Version: 20090320 +Release: 1 +License: Intel ACPICA +%define src_dir acpica-unix-%{version} +Group: Development/Tools/Debuggers +Summary: This is a set of tools to display and debug your BIOS ACPI tables. +Source: %{src_dir}.tar.bz2 +Patch1: acpica-override-CFLAGS.diff +Patch2: acpidump-override-CFLAGS.patch +Patch3: unaligned_acpidump.patch +Patch4: acpidump-cleanup.diff +Patch5: acpidump_adjust_to_new_acpica_headers.patch +Source2: acpidump.tar.bz2 +BuildRoot: %{_tmppath}/%{name}-%{version}-build +ExclusiveArch: %ix86 ia64 x86_64 +BuildRequires: bison flex + +%description +The included tools share the same code as it is used in the ACPI +implementation of the kernel. The code of the acpica project is exactly +the same as the ACPI parser and interpreter code of the kernel and the +code gets synced regularly from the acpica project into the kernel. +E.g. if you identify bugs in the kernel's ACPI implementation it might +be easier to debug them in userspace if possible. If the bug is part of +the acpica code, it has to be submitted to the acpica project to get +merged into the mainline kernel sources. + +iasl compiles ASL (ACPI Source Language) into AML (ACPI Machine +Language). This AML is suitable for inclusion as a DSDT in system +firmware. It also can disassemble AML, for debugging purposes. + + + +Authors: +-------- + "Moore, Robert" + and other Intel people + +%prep +%setup -n %{src_dir} -a 2 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 + +%build +make -C acpidump CFLAGS="$RPM_OPT_FLAGS" +make -C compiler CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" +make -C tools/acpisrc CFLAGS="$RPM_OPT_FLAGS" +make -C tools/acpixtract CFLAGS="$RPM_OPT_FLAGS" +# this needs total recompilation with other flags +cp compiler/iasl . +make clean -C compiler CFLAGS="$RPM_OPT_FLAGS" +make -C tools/acpiexec CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" + +%install +install -dm 755 %{buildroot}/usr/sbin +install -dm 755 %{buildroot}/usr/bin +install -m 755 acpidump/acpidump %{buildroot}/usr/sbin +#install -dm 755 %{buildroot}/%{_mandir}/man8 +install -Dm 755 iasl %{buildroot}/usr/bin/iasl +install -Dm 755 tools/acpisrc/acpisrc %{buildroot}/usr/sbin/acpisrc +install -Dm 755 tools/acpiexec/acpiexec %{buildroot}/usr/bin/acpiexec +install -Dm 755 tools/acpixtract/acpixtract %{buildroot}/usr/bin/acpixtract +install -Dm 644 README %{buildroot}/%{_docdir}/%{name}/README + +%files +%defattr(-,root,root) +#/usr/sbin/acpidump +/usr/bin/iasl +/usr/bin/acpiexec +/usr/bin/acpixtract +/usr/sbin/acpisrc +/usr/sbin/acpidump +%doc %{_docdir}/%{name} +#/%{_mandir}/man8/* + +%changelog +* Wed Apr 08 2009 trenn@suse.de +- Initial check-in: Version 20090320 diff --git a/acpidump-cleanup.diff b/acpidump-cleanup.diff new file mode 100644 index 0000000..8a748df --- /dev/null +++ b/acpidump-cleanup.diff @@ -0,0 +1,66 @@ +Cleanup option parsing in acpidump + +From: Andreas Schwab + +--- x/acpidump/acpidump.c ++++ y/acpidump/acpidump.c +@@ -406,13 +406,13 @@ static void usage(const char *progname) + } + + static struct option long_options[] = { +- {"addr", 1, 0, 0}, +- {"table", 1, 0, 0}, +- {"output", 1, 0, 0}, +- {"binary", 0, 0, 0}, +- {"length", 1, 0, 0}, +- {"skip", 1, 0, 0}, +- {"help", 0, 0, 0}, ++ {"addr", 1, 0, 'a'}, ++ {"table", 1, 0, 't'}, ++ {"output", 1, 0, 'o'}, ++ {"binary", 0, 0, 'b'}, ++ {"length", 1, 0, 'l'}, ++ {"skip", 1, 0, 's'}, ++ {"help", 0, 0, 'h'}, + {0, 0, 0, 0} + }; + int main(int argc, char **argv) +@@ -428,38 +428,12 @@ int main(int argc, char **argv) + addr = length = 0; + skip = 0; + while (1) { +- option_index = 0; + c = getopt_long(argc, argv, "a:t:o:bl:s:h", + long_options, &option_index); + if (c == -1) + break; + + switch (c) { +- case 0: +- switch (option_index) { +- case 0: +- addr = strtoul(optarg, (char **)NULL, 16); +- break; +- case 1: +- memcpy(select_sig, optarg, 4); +- break; +- case 2: +- filename = optarg; +- break; +- case 3: +- print = 0; +- break; +- case 4: +- length = strtoul(optarg, (char **)NULL, 16); +- break; +- case 5: +- skip = strtoul(optarg, (char **)NULL, 10); +- break; +- case 6: +- usage(argv[0]); +- exit(0); +- } +- break; + case 'a': + addr = strtoul(optarg, (char **)NULL, 16); + break; diff --git a/acpidump-override-CFLAGS.patch b/acpidump-override-CFLAGS.patch new file mode 100644 index 0000000..f663354 --- /dev/null +++ b/acpidump-override-CFLAGS.patch @@ -0,0 +1,21 @@ +Make it possible to extend CFLAGS when invoking make + +From: Thomas Renninger + +--- + acpidump/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: acpica-unix-20090320/acpidump/Makefile +=================================================================== +--- acpica-unix-20090320.orig/acpidump/Makefile ++++ acpica-unix-20090320/acpidump/Makefile +@@ -1,7 +1,7 @@ + PROG= acpidump + SRCS= acpidump.c + KERNEL_INCLUDE := ../include +-CFLAGS += -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Os -s -D_LINUX -DDEFINE_ALTERNATE_TYPES -I$(KERNEL_INCLUDE) ++override CFLAGS += -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Os -s -D_LINUX -DDEFINE_ALTERNATE_TYPES -I$(KERNEL_INCLUDE) + + all: acpidump + $(PROG) : $(SRCS) diff --git a/acpidump.tar.bz2 b/acpidump.tar.bz2 new file mode 100644 index 0000000..78fcc92 --- /dev/null +++ b/acpidump.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ae47d296ef192d8ddea4e680f29b754d4ce1d732f71643098c7f1d4fe7b7716 +size 5121 diff --git a/acpidump_adjust_to_new_acpica_headers.patch b/acpidump_adjust_to_new_acpica_headers.patch new file mode 100644 index 0000000..b10968b --- /dev/null +++ b/acpidump_adjust_to_new_acpica_headers.patch @@ -0,0 +1,332 @@ +Adjust acpidump to latest acpica headers and make it compile in acpica env + +From: Thomas Renninger + +--- x/acpidump/acpidump.c 2009-04-08 14:18:29.000000000 +0200 ++++ y/acpidump/acpidump.c 2009-04-08 14:11:52.000000000 +0200 +@@ -45,12 +45,16 @@ + #include + + +-#include +-#include +-#include +-#include ++#include "acconfig.h" ++#include "platform/acenv.h" ++#include "actypes.h" ++#include "actbl.h" ++ ++typedef unsigned char u8; ++typedef UINT32 u32; ++typedef UINT64 u64; + +-static inline u8 checksum(u8 * buffer, u32 length) ++static u8 checksum(u8 * buffer, u8 length) + { + u8 sum = 0, *i = buffer; + buffer += length; +@@ -105,28 +109,28 @@ static struct acpi_table_header *acpi_ma + unsigned size; + struct acpi_table_header *tbl = (struct acpi_table_header *) + acpi_map_memory(where, sizeof(struct acpi_table_header)); +- if (!tbl || (sig && memcmp(sig, tbl->signature, 4))) return 0; +- size = tbl->length; ++ if (!tbl || (sig && memcmp(sig, tbl->Signature, 4))) return 0; ++ size = tbl->Length; + acpi_unmap_memory((u8 *) tbl, sizeof(struct acpi_table_header)); + return (struct acpi_table_header *)acpi_map_memory(where, size); + } + + static void acpi_unmap_table(struct acpi_table_header *tbl) + { +- acpi_unmap_memory((u8 *)tbl, tbl->length); ++ acpi_unmap_memory((u8 *)tbl, tbl->Length); + } + +-static struct acpi_rsdp_descriptor *acpi_scan_for_rsdp(u8 *begin, u32 length) ++static struct acpi_table_rsdp *acpi_scan_for_rsdp(u8 *begin, u32 length) + { +- struct acpi_rsdp_descriptor *rsdp; ++ struct acpi_table_rsdp *rsdp; + u8 *i, *end = begin + length; + /* Search from given start address for the requested length */ + for (i = begin; i < end; i += ACPI_RSDP_SCAN_STEP) { + /* The signature and checksum must both be correct */ + if (memcmp((char *)i, "RSD PTR ", 8)) continue; +- rsdp = (struct acpi_rsdp_descriptor *)i; ++ rsdp = (struct acpi_table_rsdp *)i; + /* Signature matches, check the appropriate checksum */ +- if (!checksum((u8 *) rsdp, (rsdp->revision < 2) ? ++ if (!checksum((u8 *) rsdp, (rsdp->Revision < 2) ? + ACPI_RSDP_CHECKSUM_LENGTH : + ACPI_RSDP_XCHECKSUM_LENGTH)) + /* Checksum valid, we have found a valid RSDP */ +@@ -204,9 +208,9 @@ check_table_dumped(u64 address) { + static void acpi_show_table(int fd, struct acpi_table_header *table, unsigned long addr) + { + char buff[80]; +- int len = snprintf(buff, 80, "%.4s @ %p\n", table->signature, (void *)addr); ++ int len = snprintf(buff, 80, "%.4s @ %p\n", table->Signature, (void *)addr); + write(fd, buff, len); +- acpi_show_data(fd, (u8 *) table, table->length); ++ acpi_show_data(fd, (u8 *) table, table->Length); + buff[0] = '\n'; + write(fd, buff, 1); + } +@@ -222,9 +226,9 @@ static void write_table(int fd, struct a + if (print) { + acpi_show_table(fd, tbl, addr); + } else { +- write(fd, tbl, tbl->length); ++ write(fd, tbl, tbl->Length); + } +- } else if (!select_done && !memcmp(select_sig, tbl->signature, 4)) { ++ } else if (!select_done && !memcmp(select_sig, tbl->Signature, 4)) { + if (skip > 0) { + --skip; + return; +@@ -232,7 +236,7 @@ static void write_table(int fd, struct a + if (print) { + acpi_show_table(fd, tbl, addr); + } else { +- write(fd, tbl, tbl->length); ++ write(fd, tbl, tbl->Length); + } + select_done = 1; + } +@@ -240,51 +244,51 @@ static void write_table(int fd, struct a + } + + static void acpi_dump_FADT(int fd, struct acpi_table_header *tbl, unsigned long xaddr) { +- struct acpi_fadt_descriptor x; ++ struct acpi_table_fadt x; + unsigned long addr; +- size_t len = sizeof(struct acpi_fadt_descriptor); +- if (len > tbl->length) len = tbl->length; ++ size_t len = sizeof(struct acpi_table_fadt); ++ if (len > tbl->Length) len = tbl->Length; + memcpy(&x, tbl, len); +- x.header.length = len; ++ x.Header.Length = len; + if (checksum((u8 *)tbl, len)) { + fprintf(stderr, "Wrong checksum for FADT!\n"); + } +- if (x.header.length >= 148 && x.Xdsdt) { +- addr = (unsigned long)x.Xdsdt; ++ if (x.Header.Length >= 148 && x.XDsdt) { ++ addr = (unsigned long)x.XDsdt; + if (connect) { +- x.Xdsdt = lseek(fd, 0, SEEK_CUR); ++ x.XDsdt = lseek(fd, 0, SEEK_CUR); + } +- } else if (x.header.length >= 44 && x.dsdt) { +- addr = (unsigned long)x.dsdt; ++ } else if (x.Header.Length >= 44 && x.Dsdt) { ++ addr = (unsigned long)x.Dsdt; + if (connect) { +- x.dsdt = lseek(fd, 0, SEEK_CUR); ++ x.Dsdt = lseek(fd, 0, SEEK_CUR); + } + } else { + fprintf(stderr, "No DSDT in FADT!\n"); + goto no_dsdt; + } +- tbl = acpi_map_table(addr, DSDT_SIG); ++ tbl = acpi_map_table(addr, ACPI_SIG_DSDT); + if (!tbl) goto no_dsdt; +- if (checksum((u8 *)tbl, tbl->length)) ++ if (checksum((u8 *)tbl, tbl->Length)) + fprintf(stderr, "Wrong checksum for DSDT!\n"); + write_table(fd, tbl, addr); + acpi_unmap_table(tbl); + no_dsdt: +- if (x.header.length >= 140 && x.xfirmware_ctrl) { +- addr = (unsigned long)x.xfirmware_ctrl; ++ if (x.Header.Length >= 140 && x.XFacs) { ++ addr = (unsigned long)x.XFacs; + if (connect) { +- x.xfirmware_ctrl = lseek(fd, 0, SEEK_CUR); ++ x.XFacs = lseek(fd, 0, SEEK_CUR); + } +- } else if (x.header.length >= 40 && x.firmware_ctrl) { +- addr = (unsigned long)x.firmware_ctrl; ++ } else if (x.Header.Length >= 40 && x.Facs) { ++ addr = (unsigned long)x.Facs; + if (connect) { +- x.firmware_ctrl = lseek(fd, 0, SEEK_CUR); ++ x.Facs = lseek(fd, 0, SEEK_CUR); + } + } else { + fprintf(stderr, "No FACS in FADT!\n"); + goto no_facs; + } +- tbl = acpi_map_table(addr, FACS_SIG); ++ tbl = acpi_map_table(addr, ACPI_SIG_FACS); + if (!tbl) goto no_facs; + /* do not checksum FACS */ + write_table(fd, tbl, addr); +@@ -294,22 +298,22 @@ no_facs: + } + + +-static int acpi_dump_RSDT(int fd, struct acpi_rsdp_descriptor *rsdp) ++static int acpi_dump_RSDT(int fd, struct acpi_table_rsdp *rsdp) + { + struct acpi_table_header *sdt, *tbl = 0; + int i, num; + char *offset; + unsigned long addr; + +- tbl = acpi_map_table(rsdp->rsdt_physical_address, "RSDT"); ++ tbl = acpi_map_table(rsdp->RsdtPhysicalAddress, "RSDT"); + if (!tbl) return 0; + +- sdt = malloc(tbl->length); +- memcpy(sdt, tbl, tbl->length); ++ sdt = malloc(tbl->Length); ++ memcpy(sdt, tbl, tbl->Length); + acpi_unmap_table(tbl); +- if (checksum((u8 *)sdt, sdt->length)) ++ if (checksum((u8 *)sdt, sdt->Length)) + fprintf(stderr, "Wrong checksum for %s!\n", "RSDT"); +- num = (sdt->length - sizeof(struct acpi_table_header))/sizeof(u32); ++ num = (sdt->Length - sizeof(struct acpi_table_header))/sizeof(u32); + offset = (char *)sdt + sizeof(struct acpi_table_header); + for (i = 0; i < num; ++i, offset += sizeof(u32)) { + u32 tmp; +@@ -319,11 +323,11 @@ static int acpi_dump_RSDT(int fd, struct + if (!addr) continue; + tbl = acpi_map_table(addr, 0); + if (!tbl) continue; +- if (!memcmp(tbl->signature, FADT_SIG, 4)) { ++ if (!memcmp(tbl->Signature, ACPI_SIG_FADT, 4)) { + acpi_dump_FADT(fd, tbl, addr); + } else { +- if (checksum((u8 *)tbl, tbl->length)) +- fprintf(stderr, "Wrong checksum for %.4s!\n", tbl->signature); ++ if (checksum((u8 *)tbl, tbl->Length)) ++ fprintf(stderr, "Wrong checksum for %.4s!\n", tbl->Signature); + write_table(fd, tbl, addr); + } + acpi_unmap_table(tbl); +@@ -332,9 +336,9 @@ static int acpi_dump_RSDT(int fd, struct + memcpy(offset, &tmp, sizeof(tmp)); + } + } +- addr = (unsigned long)rsdp->rsdt_physical_address; ++ addr = (unsigned long)rsdp->RsdtPhysicalAddress; + if (connect) { +- rsdp->rsdt_physical_address = lseek(fd, 0, SEEK_CUR); ++ rsdp->RsdtPhysicalAddress = lseek(fd, 0, SEEK_CUR); + } + write_table(fd, sdt, addr); + free (sdt); +@@ -342,23 +346,23 @@ static int acpi_dump_RSDT(int fd, struct + } + + +-static int acpi_dump_XSDT(int fd, struct acpi_rsdp_descriptor *rsdp) ++static int acpi_dump_XSDT(int fd, struct acpi_table_rsdp *rsdp) + { + struct acpi_table_header *sdt, *tbl = 0; + int i, num; + char *offset; + unsigned long addr; +- if (rsdp->revision > 1 && rsdp->xsdt_physical_address) { +- tbl = acpi_map_table(rsdp->xsdt_physical_address, "XSDT"); ++ if (rsdp->Revision > 1 && rsdp->XsdtPhysicalAddress) { ++ tbl = acpi_map_table(rsdp->XsdtPhysicalAddress, "XSDT"); + } + if (!tbl) return 0; + +- sdt = malloc(tbl->length); +- memcpy(sdt, tbl, tbl->length); ++ sdt = malloc(tbl->Length); ++ memcpy(sdt, tbl, tbl->Length); + acpi_unmap_table(tbl); +- if (checksum((u8 *)sdt, sdt->length)) ++ if (checksum((u8 *)sdt, sdt->Length)) + fprintf(stderr, "Wrong checksum for %s!\n", "XSDT"); +- num = (sdt->length - sizeof(struct acpi_table_header))/sizeof(u64); ++ num = (sdt->Length - sizeof(struct acpi_table_header))/sizeof(u64); + offset = (char *)sdt + sizeof(struct acpi_table_header); + for (i = 0; i < num; ++i, offset += sizeof(u64)) { + u64 tmp; +@@ -367,11 +371,11 @@ static int acpi_dump_XSDT(int fd, struct + if (!addr) continue; + tbl = acpi_map_table(addr, 0); + if (!tbl) continue; +- if (!memcmp(tbl->signature, FADT_SIG, 4)) { ++ if (!memcmp(tbl->Signature, ACPI_SIG_FADT, 4)) { + acpi_dump_FADT(fd, tbl, addr); + } else { +- if (checksum((u8 *)tbl, tbl->length)) +- fprintf(stderr, "Wrong checksum for %.4s\n", tbl->signature); ++ if (checksum((u8 *)tbl, tbl->Length)) ++ fprintf(stderr, "Wrong checksum for %.4s\n", tbl->Signature); + write_table(fd, tbl, addr); + } + acpi_unmap_table(tbl); +@@ -380,9 +384,9 @@ static int acpi_dump_XSDT(int fd, struct + memcpy(offset, &tmp, sizeof(tmp)); + } + } +- addr = (unsigned long)rsdp->xsdt_physical_address; ++ addr = (unsigned long)rsdp->XsdtPhysicalAddress; + if (connect) { +- rsdp->xsdt_physical_address = lseek(fd, 0, SEEK_CUR); ++ rsdp->XsdtPhysicalAddress = lseek(fd, 0, SEEK_CUR); + } + write_table(fd, sdt, addr); + free (sdt); +@@ -419,7 +423,7 @@ int main(int argc, char **argv) + { + int option_index, c, fd; + u8 *raw; +- struct acpi_rsdp_descriptor rsdpx, *x = 0; ++ struct acpi_table_rsdp rsdpx, *x = 0; + char *filename = 0; + char buff[80]; + memset(select_sig, 0, 4); +@@ -483,7 +487,7 @@ int main(int argc, char **argv) + return 0; + } + +- length = sizeof(struct acpi_rsdp_descriptor); ++ length = sizeof(struct acpi_table_rsdp); + if (!addr) { + addr = read_efi_systab(); + if (!addr) { +@@ -497,12 +501,12 @@ int main(int argc, char **argv) + goto not_found; + + /* Find RSDP and print all found tables */ +- memcpy(&rsdpx, x, sizeof(struct acpi_rsdp_descriptor)); ++ memcpy(&rsdpx, x, sizeof(struct acpi_table_rsdp)); + acpi_unmap_memory(raw, length); + if (connect) { +- lseek(fd, sizeof(struct acpi_rsdp_descriptor), SEEK_SET); ++ lseek(fd, sizeof(struct acpi_table_rsdp), SEEK_SET); + } +- if (rsdpx.revision > 1 && rsdpx.xsdt_physical_address) { ++ if (rsdpx.Revision > 1 && rsdpx.XsdtPhysicalAddress) { + /* ACPIDUMP uses xsdt table */ + if (!acpi_dump_XSDT(fd, &rsdpx)) + goto not_found; +@@ -511,13 +515,13 @@ int main(int argc, char **argv) + goto not_found; + if (connect) { + lseek(fd, 0, SEEK_SET); +- write(fd, x, (rsdpx.revision < 2) ? ++ write(fd, x, (rsdpx.Revision < 2) ? + ACPI_RSDP_CHECKSUM_LENGTH : ACPI_RSDP_XCHECKSUM_LENGTH); + } else if (!select_sig[0] || !memcmp("RSD PTR ", select_sig, 4)) { + addr += (long)x - (long)raw; + length = snprintf(buff, 80, "RSD PTR @ %p\n", (void *)addr); + write(fd, buff, length); +- acpi_show_data(fd, (u8 *) & rsdpx, (rsdpx.revision < 2) ? ++ acpi_show_data(fd, (u8 *) & rsdpx, (rsdpx.Revision < 2) ? + ACPI_RSDP_CHECKSUM_LENGTH : ACPI_RSDP_XCHECKSUM_LENGTH); + buff[0] = '\n'; + write(fd, buff, 1); diff --git a/ready b/ready new file mode 100644 index 0000000..473a0f4 diff --git a/unaligned_acpidump.patch b/unaligned_acpidump.patch new file mode 100644 index 0000000..175e5df --- /dev/null +++ b/unaligned_acpidump.patch @@ -0,0 +1,49 @@ +Avoid unaligend accesses for IA64 in acpidump + +From: Andreas Schwab + +--- pmtools-20071116/acpidump/acpidump.c ++++ pmtools-20071116/acpidump/acpidump.c +@@ -312,7 +312,10 @@ static int acpi_dump_RSDT(int fd, struct + num = (sdt->length - sizeof(struct acpi_table_header))/sizeof(u32); + offset = (char *)sdt + sizeof(struct acpi_table_header); + for (i = 0; i < num; ++i, offset += sizeof(u32)) { +- addr = (unsigned long)(*(u32 *)offset); ++ u32 tmp; ++ memcpy(&tmp, offset, sizeof(tmp)); ++ addr = (unsigned long)(tmp); ++ + if (!addr) continue; + tbl = acpi_map_table(addr, 0); + if (!tbl) continue; +@@ -325,7 +328,8 @@ static int acpi_dump_RSDT(int fd, struct + } + acpi_unmap_table(tbl); + if (connect) { +- (*(u32*)offset) = lseek(fd, 0, SEEK_CUR); ++ tmp = lseek(fd, 0, SEEK_CUR); ++ memcpy(offset, &tmp, sizeof(tmp)); + } + } + addr = (unsigned long)rsdp->rsdt_physical_address; +@@ -357,7 +361,9 @@ static int acpi_dump_XSDT(int fd, struct + num = (sdt->length - sizeof(struct acpi_table_header))/sizeof(u64); + offset = (char *)sdt + sizeof(struct acpi_table_header); + for (i = 0; i < num; ++i, offset += sizeof(u64)) { +- addr = (unsigned long)(*(u64 *)offset); ++ u64 tmp; ++ memcpy(&tmp, offset, sizeof(tmp)); ++ addr = (unsigned long)tmp; + if (!addr) continue; + tbl = acpi_map_table(addr, 0); + if (!tbl) continue; +@@ -370,7 +376,8 @@ static int acpi_dump_XSDT(int fd, struct + } + acpi_unmap_table(tbl); + if (connect) { +- (*(u64*)offset) = lseek(fd, 0, SEEK_CUR); ++ tmp = lseek(fd, 0, SEEK_CUR); ++ memcpy(offset, &tmp, sizeof(tmp)); + } + } + addr = (unsigned long)rsdp->xsdt_physical_address;