mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-28 07:23:43 +02:00
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. Corresponding to flashrom svn r1932. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
parent
45207061d8
commit
2c57bbee3c
10
hwaccess.h
10
hwaccess.h
@ -201,8 +201,14 @@ cpu_to_be(64)
|
|||||||
|
|
||||||
/* sys/io.h provides iopl(2) and x86 I/O port access functions (inb, outb etc).
|
/* 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,
|
* It is included in glibc (thus available also on debian/kFreeBSD) but also in other libcs that mimic glibc,
|
||||||
* e.g. musl and uclibc. */
|
* e.g. musl and uclibc. Because we cannot detect the libc or existence of the header or of the instructions
|
||||||
#if defined(__linux__) || defined(__GLIBC__)
|
* 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. */
|
||||||
|
#if defined(__ANDROID__)
|
||||||
|
#include <sys/glibc-syscalls.h>
|
||||||
|
#elif defined(__linux__) || defined(__GLIBC__)
|
||||||
#include <sys/io.h>
|
#include <sys/io.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user