Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 1 | From 7fd144f101fa5c9316d3468ed26f55629afe1305 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Tue, 17 Dec 2019 17:55:54 -0800 |
| 4 | Subject: [PATCH 3/3] Fix non x86 platforms on musl |
| 5 | |
| 6 | Musl only specifies in/outb for x86/x86. Use the fallback path in case |
| 7 | musl is used. |
| 8 | |
| 9 | This should fail compilation during the linking stage but for some reason |
| 10 | does not. Will do if -Werror=implicit-function-declaration is specified. |
| 11 | |
| 12 | Original here: https://github.com/openwrt/packages/blob/master/utils/lcdproc/patches/110-in-outb.patch |
| 13 | Upstream-Status: Pending |
| 14 | |
| 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 16 | --- |
| 17 | server/drivers/port.h | 2 +- |
| 18 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 19 | |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 20 | --- a/server/drivers/port.h |
| 21 | +++ b/server/drivers/port.h |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame^] | 22 | @@ -94,7 +94,7 @@ static inline int port_deny_multiple(uns |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 23 | /* ---------------------------- Linux ------------------------------------ */ |
| 24 | /* Use ioperm, inb and outb in <sys/io.h> (Linux) */ |
| 25 | /* And iopl for higher addresses of PCI LPT cards */ |
| 26 | -#if defined HAVE_IOPERM |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame^] | 27 | +#if HAVE_INB |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 28 | |
| 29 | /* Glibc2 and Glibc1 */ |
| 30 | # ifdef HAVE_SYS_IO_H |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame^] | 31 | @@ -333,7 +333,7 @@ static inline int port_deny_multiple (un |
| 32 | return i386_set_ioperm(port, count, 0); |
| 33 | } |
| 34 | |
| 35 | -#else |
| 36 | +#elif defined(__x86__) && defined(__x86_64__) |
| 37 | |
| 38 | /* ------------------------- Everything else ----------------------------- */ |
| 39 | /* Last chance! Use /dev/io and i386 ASM code (BSD4.3 ?) */ |
| 40 | --- a/configure.ac |
| 41 | +++ b/configure.ac |
| 42 | @@ -144,6 +144,7 @@ AC_CHECK_LIB(i386, i386_get_ioperm, |
| 43 | [])] |
| 44 | ) |
| 45 | |
| 46 | +AC_CHECK_FUNCS(inb) |
| 47 | AC_CHECK_FUNCS(iopl) |
| 48 | AC_CHECK_FUNCS(ioperm) |
| 49 | AC_CHECK_HEADERS(sys/io.h) |