summaryrefslogtreecommitdiff
path: root/tools/intel_reg.c
diff options
context:
space:
mode:
authorThomas Wood <thomas.wood@intel.com>2015-07-16 11:41:32 +0100
committerThomas Wood <thomas.wood@intel.com>2015-07-20 18:13:37 +0100
commit80f1553780d0d167cca8bd456a7deb3ff5d9e58e (patch)
tree17fc2a208a3000de439223d74bdc53606824b2bd /tools/intel_reg.c
parent0705ce6d15320a153c137b4a2119496a7f9c49f1 (diff)
intel_reg: support platforms without sys/io.h
Based on an idea from Jani Nikula. Cc: Jani Nikula <jani.nikula@intel.com> Cc: Derek Morton <derek.j.morton@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Diffstat (limited to 'tools/intel_reg.c')
-rw-r--r--tools/intel_reg.c17
1 files changed, 16 insertions, 1 deletions
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 <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/io.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
@@ -38,6 +37,22 @@
#include "intel_reg_spec.h"
+
+#ifdef HAVE_SYS_IO_H
+#include <sys/io.h>
+#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;