summaryrefslogtreecommitdiff
path: root/emulators/qemu
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2024-02-09 23:12:56 +0100
committerPiotr Kubaj <pkubaj@FreeBSD.org>2024-02-11 12:49:02 +0100
commit872d8988c1c16aab3d7702b8079e630321b06b07 (patch)
treeffdd33a19fbaf13379b1273fdde53a6eed52e2e6 /emulators/qemu
parentmath/py-libpoly: fix build on 32-bits (diff)
emulators/qemu: fix build on powerpc*
../util/cpuinfo-ppc.c:49:18: error: use of undeclared identifier 'PPC_FEATURE2_ISEL' if (hwcap2 & PPC_FEATURE2_ISEL) { ^ ../util/cpuinfo-ppc.c:62:26: error: use of undeclared identifier 'PPC_FEATURE2_VEC_CRYPTO' if (hwcap2 & PPC_FEATURE2_VEC_CRYPTO) { ^ 2 errors generated.
Diffstat (limited to 'emulators/qemu')
-rw-r--r--emulators/qemu/files/patch-util_cpuinfo-ppc.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/emulators/qemu/files/patch-util_cpuinfo-ppc.c b/emulators/qemu/files/patch-util_cpuinfo-ppc.c
index 1de34b02b063..af9999a22108 100644
--- a/emulators/qemu/files/patch-util_cpuinfo-ppc.c
+++ b/emulators/qemu/files/patch-util_cpuinfo-ppc.c
@@ -1,6 +1,6 @@
--- util/cpuinfo-ppc.c.orig 2024-01-29 19:13:22 UTC
+++ util/cpuinfo-ppc.c
-@@ -6,11 +6,17 @@
+@@ -6,13 +6,21 @@
#include "qemu/osdep.h"
#include "host/cpuinfo.h"
@@ -10,12 +10,25 @@
#else
+# ifdef __linux__
+# include <asm/cputable.h>
++# elif defined(__FreeBSD__)
++# include <machine/cpu.h>
+# endif
# include "elf.h"
-+#endif
-+
-+#ifndef PPC_FEATURE2_ARCH_3_1
-+# define PPC_FEATURE2_ARCH_3_1 0x00040000
#endif
++#ifndef PPC_FEATURE2_ARCH_3_1
++# define PPC_FEATURE2_ARCH_3_1 0x00040000
++#endif
++
unsigned cpuinfo;
+
+ /* Called both as constructor and (possibly) via other constructors. */
+@@ -53,7 +61,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(voi
+ * always have both anyway, since VSX came with Power7
+ * and crypto came with Power8.
+ */
+- if (hwcap2 & PPC_FEATURE2_VEC_CRYPTO) {
++ if (hwcap2 & PPC_FEATURE2_HAS_VEC_CRYPTO) {
+ info |= CPUINFO_CRYPTO;
+ }
+ }