summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2022-05-27 10:32:57 +0300
committerLinus Groh <mail@linusgroh.de>2022-05-27 08:52:35 +0100
commitd1c9089fcde5d249bf15308503d3556d9a1dd22f (patch)
tree00afc710a2df239490d05cd90fa4f7fb682d2869
parent3667d7e93cf8e671756e1ed8f317403b6315366d (diff)
downloadserenity-d1c9089fcde5d249bf15308503d3556d9a1dd22f.zip
Ports: Add ACPICA tools port
-rw-r--r--Ports/AvailablePorts.md1
-rwxr-xr-xPorts/acpica-tools/package.sh16
-rw-r--r--Ports/acpica-tools/patches/0001--Stop-compiler-warnings-on-dangling-pointer.patch25
-rw-r--r--Ports/acpica-tools/patches/0002-Disable-sprintf-debug-message-due-to-formatting-erro.patch29
-rw-r--r--Ports/acpica-tools/patches/ReadMe.md10
5 files changed, 81 insertions, 0 deletions
diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md
index 5a4e83ce83..7195b61249 100644
--- a/Ports/AvailablePorts.md
+++ b/Ports/AvailablePorts.md
@@ -6,6 +6,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n
| Port | Name | Version | Website |
|-----------------------------------------------------|-----------------------------------------------------------------|--------------------------|--------------------------------------------------------------------------------|
+| [`acpica-tools`](acpica-tools/) | ACPI Component Architecture Project Userspace Utilities | 20220331 | https://acpica.org/downloads |
| [`Another-World`](Another-World/) | Another World Bytecode Interpreter | | https://github.com/fabiensanglard/Another-World-Bytecode-Interpreter |
| [`angband`](angband/) | Angband | 4.2.4 | https://rephial.org |
| [`bash`](bash/) | GNU Bash | 5.1.16 | https://www.gnu.org/software/bash/ |
diff --git a/Ports/acpica-tools/package.sh b/Ports/acpica-tools/package.sh
new file mode 100755
index 0000000000..fc48012c5a
--- /dev/null
+++ b/Ports/acpica-tools/package.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env -S bash ../.port_include.sh
+port=acpica-tools
+version=20220331
+workdir="acpica-unix-${version}"
+auth_type=sha256
+files="https://acpica.org/sites/acpica/files/acpica-unix-${version}.tar.gz acpica-unix-${version}.tar.gz acaff68b14f1e0804ebbfc4b97268a4ccbefcfa053b02ed9924f2b14d8a98e21"
+
+
+build() {
+ run make iasl
+ run make acpixtract
+ # FIXME: Make "run make acpiexec" to work
+ run make acpihelp
+ run make acpisrc
+ run make acpibin
+}
diff --git a/Ports/acpica-tools/patches/0001--Stop-compiler-warnings-on-dangling-pointer.patch b/Ports/acpica-tools/patches/0001--Stop-compiler-warnings-on-dangling-pointer.patch
new file mode 100644
index 0000000000..b74e5a108d
--- /dev/null
+++ b/Ports/acpica-tools/patches/0001--Stop-compiler-warnings-on-dangling-pointer.patch
@@ -0,0 +1,25 @@
+From bf6a3c66f9f4a536ad7bab3eb7f149c7062de851 Mon Sep 17 00:00:00 2001
+From: Liav A <liavalb@gmail.com>
+Date: Fri, 27 May 2022 10:18:35 +0300
+Subject: [PATCH 1/2] Stop compiler warnings on dangling pointer
+
+---
+ source/components/utilities/utdebug.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/source/components/utilities/utdebug.c b/source/components/utilities/utdebug.c
+index f789e68..fd18f5c 100644
+--- a/source/components/utilities/utdebug.c
++++ b/source/components/utilities/utdebug.c
+@@ -182,7 +182,7 @@ void
+ AcpiUtInitStackPtrTrace (
+ void)
+ {
+- ACPI_SIZE CurrentSp;
++ static ACPI_SIZE CurrentSp;
+
+
+ AcpiGbl_EntryStackPointer = &CurrentSp;
+--
+2.36.0
+
diff --git a/Ports/acpica-tools/patches/0002-Disable-sprintf-debug-message-due-to-formatting-erro.patch b/Ports/acpica-tools/patches/0002-Disable-sprintf-debug-message-due-to-formatting-erro.patch
new file mode 100644
index 0000000000..75dd32ae86
--- /dev/null
+++ b/Ports/acpica-tools/patches/0002-Disable-sprintf-debug-message-due-to-formatting-erro.patch
@@ -0,0 +1,29 @@
+From a62c4eb1dcf574cd1f02224cd1120e3435864413 Mon Sep 17 00:00:00 2001
+From: Liav A <liavalb@gmail.com>
+Date: Fri, 27 May 2022 10:19:35 +0300
+Subject: [PATCH 2/2] Disable sprintf debug message due to formatting errors
+
+---
+ source/compiler/dtfield.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/source/compiler/dtfield.c b/source/compiler/dtfield.c
+index f931631..f9fb310 100644
+--- a/source/compiler/dtfield.c
++++ b/source/compiler/dtfield.c
+@@ -280,9 +280,9 @@ DtCompileString (
+
+ if (Length > ByteLength)
+ {
+- sprintf (AslGbl_MsgBuffer,
+- "Maximum %u characters, found %u characters [%s]",
+- ByteLength, Length, Field->Value);
++ //sprintf (AslGbl_MsgBuffer,
++ // "Maximum %u characters, found %u characters [%s]",
++ // ByteLength, Length, Field->Value);
+ DtError (ASL_ERROR, ASL_MSG_STRING_LENGTH, Field, AslGbl_MsgBuffer);
+ Length = ByteLength;
+ }
+--
+2.36.0
+
diff --git a/Ports/acpica-tools/patches/ReadMe.md b/Ports/acpica-tools/patches/ReadMe.md
new file mode 100644
index 0000000000..12a63ef2d6
--- /dev/null
+++ b/Ports/acpica-tools/patches/ReadMe.md
@@ -0,0 +1,10 @@
+# Patches for nyancat on SerenityOS
+
+## `0001--Stop-compiler-warnings-on-dangling-pointer.patch`
+
+Use static variable to prevent using a dangling pointer from a previous stack trace.
+
+
+## `0002-Disable-sprintf-debug-message-due-to-formatting-erro.patch`
+
+Disable sprintf debug message with formatting issues.