From 80f1553780d0d167cca8bd456a7deb3ff5d9e58e Mon Sep 17 00:00:00 2001 From: Thomas Wood Date: Thu, 16 Jul 2015 11:41:32 +0100 Subject: intel_reg: support platforms without sys/io.h Based on an idea from Jani Nikula. Cc: Jani Nikula Cc: Derek Morton Signed-off-by: Thomas Wood --- tools/intel_reg.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'tools/intel_reg.c') diff --git a/tools/intel_reg.c b/tools/intel_reg.c index 090cc256..190aa5b3 100644 --- a/tools/intel_reg.c +++ b/tools/intel_reg.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -38,6 +37,22 @@ #include "intel_reg_spec.h" + +#ifdef HAVE_SYS_IO_H +#include +#else + +static inline int _not_supported(void) +{ + fprintf(stderr, "portio-vga not supported\n"); + exit(EXIT_FAILURE); +} +#define inb(port) _not_supported() +#define outb(value, port) _not_supported() +#define iopl(level) + +#endif /* HAVE_SYS_IO_H */ + struct config { struct pci_device *pci_dev; char *mmiofile; -- cgit v1.2.3