From patchwork Thu Jul 16 11:07:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 6806061 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C23299F380 for ; Thu, 16 Jul 2015 11:07:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E39E72077D for ; Thu, 16 Jul 2015 11:07:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DEA5F20752 for ; Thu, 16 Jul 2015 11:07:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 51D767A085; Thu, 16 Jul 2015 04:07:37 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTP id BFC337A085 for ; Thu, 16 Jul 2015 04:07:35 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 16 Jul 2015 04:07:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,487,1432623600"; d="scan'208";a="525292395" Received: from pistachio.isw.intel.com ([10.237.224.81]) by FMSMGA003.fm.intel.com with ESMTP; 16 Jul 2015 04:07:34 -0700 From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Thu, 16 Jul 2015 12:07:32 +0100 Message-Id: <1437044853-7940-2-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1437044853-7940-1-git-send-email-thomas.wood@intel.com> References: <2D016F5BA44C744783BA96B1D3EBC5BDA83C70@IRSMSX102.ger.corp.intel.com> <1437044853-7940-1-git-send-email-thomas.wood@intel.com> Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ Cc: Jani Nikula Subject: [Intel-gfx] [PATCH i-g-t 1/2] intel_reg: support platforms without sys/io.h X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Based on an idea from Jani Nikula. Cc: Jani Nikula Cc: Derek Morton Signed-off-by: Thomas Wood --- 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 ]) 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 #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;