From patchwork Fri Mar 28 12:54:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tim.gore@intel.com X-Patchwork-Id: 3903111 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B7FA09F2E8 for ; Fri, 28 Mar 2014 12:56:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0FD8202A7 for ; Fri, 28 Mar 2014 12:56:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 38A5120222 for ; Fri, 28 Mar 2014 12:56:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CD17A6ECBF; Fri, 28 Mar 2014 05:56:00 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C2396ECBF for ; Fri, 28 Mar 2014 05:56:00 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 28 Mar 2014 05:55:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,751,1389772800"; d="scan'208";a="509646165" Received: from tgore-linux.iwi.intel.com ([172.28.253.54]) by orsmga002.jf.intel.com with ESMTP; 28 Mar 2014 05:55:20 -0700 From: tim.gore@intel.com To: intel-gfx@lists.freedesktop.org Date: Fri, 28 Mar 2014 12:54:58 +0000 Message-Id: <1396011300-11605-2-git-send-email-tim.gore@intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1396011300-11605-1-git-send-email-tim.gore@intel.com> References: <1396011300-11605-1-git-send-email-tim.gore@intel.com> Subject: [Intel-gfx] [PATCH 1/3] intel-gpu-tools: fix problem with redefinition of mmap64 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 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=-4.6 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 From: tgore In android builds there is no reliable way to determine if mmap64 is defined or not, and this sometimes leads to a compile error due to its re-defnition. So this commit avoids its use altogether in intel-gpu-tools for Android builds, unless the HAVE_MMAP64 macro is defined. Signed-off-by: Tim Gore --- lib/drmtest.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/drmtest.h b/lib/drmtest.h index fdf98c6..f3afbaa 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -40,7 +40,11 @@ #ifdef ANDROID #ifndef HAVE_MMAP64 extern void* __mmap2(void *, size_t, int, int, int, off_t); -static inline void *mmap64(void *addr, size_t length, int prot, int flags, + +/* mmap64 is a recent addition to bionic and not available in all android builds. */ +/* I can find no reliable way to know if it is defined or not - so just avoid it */ +#define mmap64 igt_mmap64 +static inline void *igt_mmap64(void *addr, size_t length, int prot, int flags, int fd, off64_t offset) { return __mmap2(addr, length, prot, flags, fd, offset >> 12);