summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-emulation/vendor-reset/files')
-rw-r--r--app-emulation/vendor-reset/files/Fix-5.11-build.patch52
-rw-r--r--app-emulation/vendor-reset/files/vendor-reset-0.1.1-allow-correct-compilation-with-clang.patch23
-rw-r--r--app-emulation/vendor-reset/files/vendor-reset-0.1.1-fix-build-on-kernel-6.8.patch35
3 files changed, 58 insertions, 52 deletions
diff --git a/app-emulation/vendor-reset/files/Fix-5.11-build.patch b/app-emulation/vendor-reset/files/Fix-5.11-build.patch
deleted file mode 100644
index 845ea08afc54..000000000000
--- a/app-emulation/vendor-reset/files/Fix-5.11-build.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 225a49a40941e350899e456366265cf82b87ad25 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?T=C3=A9rence=20Clastres?= <t.clastres@gmail.com>
-Date: Sun, 31 Jan 2021 20:22:00 +0100
-Subject: [PATCH] [core] add support for linux 5.11
-
-This approach maintains compatibility with previous kernel versions.
-
-Thanks to @justinkb for finding the commit that broke it (torvalds/linux@d19ad07).
----
- dkms.conf | 2 +-
- src/ftrace.c | 8 ++++++++
- 2 files changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/dkms.conf b/dkms.conf
-index 396abd3..09fbcf0 100644
---- a/dkms.conf
-+++ b/dkms.conf
-@@ -1,5 +1,5 @@
- PACKAGE_NAME="vendor-reset"
--PACKAGE_VERSION="0.1.0"
-+PACKAGE_VERSION="0.1.1"
- BUILT_MODULE_NAME[0]="${PACKAGE_NAME}"
- MAKE[0]="make KDIR=${kernel_source_dir}"
- CLEAN="make KDIR=${kernel_source_dir} clean"
-diff --git a/src/ftrace.c b/src/ftrace.c
-index 80bb4aa..7eed223 100644
---- a/src/ftrace.c
-+++ b/src/ftrace.c
-@@ -22,6 +22,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
- #include <linux/ftrace.h>
- #include <linux/kprobes.h>
- #include <linux/pci.h>
-+#include <linux/version.h>
-
- #include "ftrace.h"
-
-@@ -48,8 +49,15 @@ static int resolve_hook_address(struct ftrace_hook *hook)
- return 0;
- }
-
-+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0))
- static void notrace fh_trace_thunk(unsigned long ip, unsigned long parent_ip, struct ftrace_ops *ops, struct pt_regs *regs)
- {
-+#else
-+static void notrace fh_trace_thunk(unsigned long ip, unsigned long parent_ip, struct ftrace_ops *ops, struct ftrace_regs *fregs)
-+{
-+ struct pt_regs *regs;
-+ regs = ftrace_get_regs(fregs);
-+#endif
- struct ftrace_hook *hook = to_ftrace_hook(ops);
-
- if (!within_module(parent_ip, THIS_MODULE))
diff --git a/app-emulation/vendor-reset/files/vendor-reset-0.1.1-allow-correct-compilation-with-clang.patch b/app-emulation/vendor-reset/files/vendor-reset-0.1.1-allow-correct-compilation-with-clang.patch
new file mode 100644
index 000000000000..32ae298d4049
--- /dev/null
+++ b/app-emulation/vendor-reset/files/vendor-reset-0.1.1-allow-correct-compilation-with-clang.patch
@@ -0,0 +1,23 @@
+https://github.com/gnif/vendor-reset/commit/084881c6e9e11bdadaf05798e669568848e698a3.patch
+From: =?UTF-8?q?Marcus=20K=C3=B6hler?= <khler.marcus@gmail.com>
+Date: Mon, 25 Dec 2023 21:43:41 +0100
+Subject: [PATCH] Allow correct compilation with Clang/LLVM
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Marcus Köhler <khler.marcus@gmail.com>
+--- a/src/hook.c
++++ b/src/hook.c
+@@ -30,7 +30,11 @@ static bool hook_installed = false;
+ static int (*orig_pci_dev_specific_reset)(struct pci_dev *dev, int probe);
+
+ /* TCO breaks the hook, we must disable it for this function */
++#if defined(__GNUC__) && !defined(__llvm__)
+ __attribute__((optimize("-fno-optimize-sibling-calls")))
++#elif defined(__clang__)
++__attribute__((disable_tail_calls))
++#endif
+ static int hooked_pci_dev_specific_reset(struct pci_dev *dev, int probe)
+ {
+ int ret;
diff --git a/app-emulation/vendor-reset/files/vendor-reset-0.1.1-fix-build-on-kernel-6.8.patch b/app-emulation/vendor-reset/files/vendor-reset-0.1.1-fix-build-on-kernel-6.8.patch
new file mode 100644
index 000000000000..d99212c9ee27
--- /dev/null
+++ b/app-emulation/vendor-reset/files/vendor-reset-0.1.1-fix-build-on-kernel-6.8.patch
@@ -0,0 +1,35 @@
+https://github.com/gnif/vendor-reset/commit/f72619e468846e0bab4426f5e71b069f88c33a11.patch
+From: Sakari <20642596+sakarie9@users.noreply.github.com>
+Date: Thu, 14 Mar 2024 10:59:15 +0800
+Subject: [PATCH] Fix build on kernel 6.8+
+
+--- a/src/amd/amdgpu/atom.c
++++ b/src/amd/amdgpu/atom.c
+@@ -28,6 +28,7 @@
+ #include <linux/sched.h>
+ #include <linux/slab.h>
+ #include <linux/delay.h>
++#include <linux/version.h>
+ #include <asm/unaligned.h>
+
+ //#include <drm/drm_util.h>
+@@ -39,6 +40,10 @@
+ #include "atom-names.h"
+ #include "atom-bits.h"
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
++#define strscpy strlcpy
++#endif
++
+ #define ATOM_COND_ABOVE 0
+ #define ATOM_COND_ABOVEOREQUAL 1
+ #define ATOM_COND_ALWAYS 2
+@@ -1424,7 +1429,7 @@ struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios)
+ if (*str != '\0')
+ {
+ pr_info("ATOM BIOS: %s\n", str);
+- strlcpy(ctx->vbios_version, str, sizeof(ctx->vbios_version));
++ strscpy(ctx->vbios_version, str, sizeof(ctx->vbios_version));
+ }
+
+ return ctx;