[flashrom] [commit] r1932 - trunk
svn at flashrom.org
Sat Feb 20 21:21:58 CET 2016
Date: Sat Feb 20 21:21:58 2016
New Revision: 1932
Include sys/glibc-syscalls.h instead of inexistent sys/io.h on Android.
This won't make raw I/O work magically but at least it would provide iopl()
if some driver requires it and there is no better alternative currently.
Signed-off-by: Stefan Tauner <stefan.tauner at alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
--- trunk/hwaccess.h Fri Feb 19 09:17:24 2016 (r1931)
+++ trunk/hwaccess.h Sat Feb 20 21:21:58 2016 (r1932)
@@ -201,8 +201,14 @@
/* sys/io.h provides iopl(2) and x86 I/O port access functions (inb, outb etc).
* It is included in glibc (thus available also on debian/kFreeBSD) but also in other libcs that mimic glibc,
- * e.g. musl and uclibc. */
-#if defined(__linux__) || defined(__GLIBC__)
+ * e.g. musl and uclibc. Because we cannot detect the libc or existence of the header or of the instructions
+ * themselves safely in here we use some heuristic below:
+ * On Android we don't have the header file and no way for I/O port access at all. However, sys/glibc-syscalls.h
+ * refers to an iopl implementation and we therefore include at least that one for now. On non-Android we assume
+ * that a Linux system's libc has a suitable sys/io.h or (on non-Linux) we depend on glibc to offer it. */
+#elif defined(__linux__) || defined(__GLIBC__)
More information about the flashrom