All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Wood <thomas.wood@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@intel.com>
Subject: [PATCH i-g-t 1/2] intel_reg: support platforms without sys/io.h
Date: Thu, 16 Jul 2015 12:07:32 +0100	[thread overview]
Message-ID: <1437044853-7940-2-git-send-email-thomas.wood@intel.com> (raw)
In-Reply-To: <1437044853-7940-1-git-send-email-thomas.wood@intel.com>

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>
---
 configure.ac      |  2 +-
 tools/intel_reg.c | 17 ++++++++++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index f3603c1..3770b2f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,7 +56,7 @@ AM_CONDITIONAL(HAVE_RST2MAN, [test "x$RST2MAN" = xyes])
 
 # Checks for functions, headers, structures, etc.
 AC_HEADER_STDC
-AC_CHECK_HEADERS([termios.h linux/kd.h sys/kd.h libgen.h])
+AC_CHECK_HEADERS([termios.h linux/kd.h sys/kd.h libgen.h sys/io.h])
 AC_CHECK_MEMBERS([struct sysinfo.totalram],[],[],[AC_INCLUDES_DEFAULT
 		  #include <sys/sysinfo.h>
 		  ])
diff --git a/tools/intel_reg.c b/tools/intel_reg.c
index 090cc25..190aa5b 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;
-- 
2.4.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-07-16 11:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-15 14:49 [PATCH i-g-t v2] Android.mk: Disable tools that do not build for android Derek Morton
2015-06-15 15:30 ` Jani Nikula
2015-06-16 10:04   ` Morton, Derek J
2015-07-16  8:44     ` Morton, Derek J
2015-07-16 11:07       ` [PATCH i-g-t 0/2] Enabling intel_reg on Android Thomas Wood
2015-07-16 11:07         ` Thomas Wood [this message]
2015-07-16 11:07         ` [PATCH i-g-t 2/2] tools/Android.mk: add any extra program sources Thomas Wood
2015-07-16 14:13           ` Morton, Derek J
2015-07-16 15:23             ` Thomas Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437044853-7940-2-git-send-email-thomas.wood@intel.com \
    --to=thomas.wood@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.