From patchwork Wed Apr 24 17:08:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 162799 Delivered-To: patches@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp903871jan; Wed, 24 Apr 2019 10:08:46 -0700 (PDT) X-Received: by 2002:aa7:8518:: with SMTP id v24mr27342302pfn.219.1556125726076; Wed, 24 Apr 2019 10:08:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556125726; cv=none; d=google.com; s=arc-20160816; b=lhN3oXf9AVXhFa6nojpKM4c0O4D4S4wC5+cpjava97Lkfjws6u9+IUK+J41mvEogOa bXZhDeXLzrFNcFaRDscPVTu1gExsZLRWFIxJ2+5G1fXcuQaOhb/2EOmdZLVPgVItatuD tFU8NL0TjFBY2q1eYp/xsV3my0BRB0Bz0IWK9smmAA+9stTlSQe9ayDBAJjd7Os+BXqW iYsxtHJu3j4kBMV9GpUhK1sngCHZN0c21sCJGH10B9HrjK3E9rj0pvYAOJZnIV7l3XWf Ooc4iMbp7jJi+RRibGxz3d4LnLW//zAhvz3fYo3FwVk6pHfXhjAfgaXa0OgNzt1i6Hx8 F4XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=fGMCTWJCYFtCmoIcDdlw37giMEwdIgyb7vmAWnlhAbU=; b=Hd8psFHy++bqUy4oH6/XkbD06MGx5J2DqFEcKp1h8Bm1Qp0BGUPujAnPTT3r5gn1bd kJvE8VT26NHjGF3smWNaSO3QTwZ4L2Nfzni4QK2cCfY+89BqybySfrhFoeUXlgp7Ie6g HLJBEzOILZ4ntthpMD0B/5vbVPoyRzsvXHJnTVK+gWI2ZUfpU66jY2I0cykj+Z8lUn57 adWrzfm3JKlT3L8ZeXkRBSUfrVAgQMq849G3wl+p+R/J5PEonyANj3Xf5ahue0NrYMYh 23jmvleorIQeMrvzs3h9iDWZX5H29xRx+Y1+BhlEco4H7dz/6R8PKcfCfvMyMaGNWjv+ uxdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UTf2v6St; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id r10sor22173536pfd.10.2019.04.24.10.08.45 for (Google Transport Security); Wed, 24 Apr 2019 10:08:46 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UTf2v6St; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fGMCTWJCYFtCmoIcDdlw37giMEwdIgyb7vmAWnlhAbU=; b=UTf2v6StjvEQJI37I3dzf0v43Cliy2iqN+hDTOGB6Gn8Olsb+LvnwR3EcjXKL4+Xzl Ldr7ePtP+nu58vm3NXUzS3CVrzNuhzhDgCvM27ViArCBGv+PAz+jE/t2cwmaYCKJ5uq4 9Ltc97Eu8BJYuRf1aSSRbQ9xLnilprXhQ6V1f16h3srFZ7IwA8kLusO8kU2bj+h6DsJ9 58DXBAuRSDfH1azZDVuBwRJ7LHRbpuGysYYK4ehwj6Ji7hWzJnlu4Ff6BUmyIYlK6wl4 jOvblAtvL3oGRx6dAE3cAacdVwj5JVEplH/Xu7jKn1HETxdxXr+epfzqk8FLJFUAXfeZ XljQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fGMCTWJCYFtCmoIcDdlw37giMEwdIgyb7vmAWnlhAbU=; b=qXB5eoKe6VBzVXR0RGZNuye9DbcpvGF53zsaIfL3TOlqQsEmHsn862QB2CuyUm3lIk Sh3BWWYy4Lzvb334uQVLD3hjrDNc37bmgxWTy/eSmqgI9XRpFLgSmlFDOBdhcps5jSQi 36fBdO1Stid5OWB3HJkZTDGFGzLk8k3XSc/pXhZwU+zy7MGbqVKPxmNkULdVjFNu6RLa 0iUgMVPWTNGH9GgPFK/mCkZyTyjvFMX5a8gwoNvaaZx96DOlzV2ZLIzHyzURiXoBRn63 K5fvOoZ9UTayex4cxao2pS3VQwIMpW+yaLT5sTtzKtCy/oLHed+dxBT39hUaYHw4LAlM OGCQ== X-Gm-Message-State: APjAAAWv55OT3OTm31UyvEAetPbiC4sXEopIiA4iTo/fCdIY1R6TE8Bc 6JYbz6xKFzKeS4B7Po9JXLdXGTbxWQ0iPg== X-Google-Smtp-Source: APXvYqz6CFw5lGSSen7EuCkTvTwvP/PD0nL/SxzVhNOmBWySmKaHoOzCFB2ss79TJh7/2xra2caRHA== X-Received: by 2002:a62:5ec2:: with SMTP id s185mr35524823pfb.16.1556125725630; Wed, 24 Apr 2019 10:08:45 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id e4sm4425073pfn.185.2019.04.24.10.08.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Apr 2019 10:08:44 -0700 (PDT) From: John Stultz To: dri-devel Cc: Sean Paul , Emil Velikov , Alistair Strachan , Marissa Wall , John Stultz Subject: [PATCH 1/6 v2] libdrm: Use mmap64 instead of __mmap2 Date: Wed, 24 Apr 2019 10:08:36 -0700 Message-Id: <1556125721-32145-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> References: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> MIME-Version: 1.0 From: Sean Paul __mmap2 isn't supported on all platforms, mmap64 is the right way to do this in android. Also folds in a fix from Stéphane Marchesin Cc: Emil Velikov Cc: Sean Paul Cc: Alistair Strachan Cc: Marissa Wall Acked-by: Alex Deucher Reviewed-by: Emil Velikov Signed-off-by: Sean Paul [jstultz: Folded in Stéphane's fix] Signed-off-by: John Stultz --- libdrm_macros.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.7.4 diff --git a/libdrm_macros.h b/libdrm_macros.h index 95f0ef5..0dca827 100644 --- a/libdrm_macros.h +++ b/libdrm_macros.h @@ -48,8 +48,6 @@ #if defined(ANDROID) && !defined(__LP64__) #include /* for EINVAL */ -extern void *__mmap2(void *, size_t, int, int, int, size_t); - static inline void *drm_mmap(void *addr, size_t length, int prot, int flags, int fd, loff_t offset) { @@ -59,7 +57,7 @@ static inline void *drm_mmap(void *addr, size_t length, int prot, int flags, return MAP_FAILED; } - return __mmap2(addr, length, prot, flags, fd, (size_t) (offset >> 12)); + return mmap64(addr, length, prot, flags, fd, offset); } # define drm_munmap(addr, length) \