summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2018-11-16 11:18:25 +0100
committerJean Delvare <jdelvare@suse.de>2018-11-16 11:18:25 +0100
commit82497fa02d60757c2cfa645cf89a79abb1435273 (patch)
tree96daaaf9a600e48ce38c94e2ebd85762df59b503 /config.h
parentfde47bb227b8fa817c88d7e10a8eb771c46de1df (diff)
downloaddmidecode-git-82497fa02d60757c2cfa645cf89a79abb1435273.tar.gz
dmidecode: Don't use memcpy on /dev/mem on arm64
On arm64, calling memcpy on /dev/mem will cause a bus error if the start and the end of the buffer are not aligned on a 64-bit boundary. Using option --no-sysfs triggers this. Use a slow manual byte-by-byte copy in that case, to prevent the bus error. This is only a fallback path (at least on Linux) and not performance-critical anyway, as it is a one-time operation and DMI tables are usually not too large. This fixes bug #55026: https://savannah.nongnu.org/bugs/index.php?55026 Signed-off-by: Jean Delvare <jdelvare@suse.de>
Diffstat (limited to 'config.h')
-rw-r--r--config.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/config.h b/config.h
index e39091f..4237355 100644
--- a/config.h
+++ b/config.h
@@ -26,4 +26,9 @@
#define ALIGNMENT_WORKAROUND
#endif
+/* Avoid unaligned memcpy on /dev/mem */
+#ifdef __aarch64__
+#define USE_SLOW_MEMCPY
+#endif
+
#endif