From patchwork Mon Feb 17 21:58:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 24801 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f72.google.com (mail-pb0-f72.google.com [209.85.160.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4E54120143 for ; Mon, 17 Feb 2014 21:59:10 +0000 (UTC) Received: by mail-pb0-f72.google.com with SMTP id up15sf37037381pbc.7 for ; Mon, 17 Feb 2014 13:59:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=fUUi7Nrb/OlZ70QXvWeuYGiVyRpdxW8iabO88VOg03w=; b=JRZa3H8Sivpsd7fuV3jcmDB9rGKUh2OnlvXjNDS3jtfELdKCzwI8x613PvHUfzPIA0 mYIXr3bRmFWKVLJvLYazKaiJ5tHLTfytbCuTeUb48xFJrEwpegwc/0s6OKIoLyNyTrso UONLsVvuCjOj3Jf6Rk4BT0ipA9LGUQm6jOFC4ivtjr2xdD5eFLlpWBhknTr617hCkCrB X9OHjhyhqhoAFPk8tmw2l/uuwGJ1jBmWjW1IiM1/bmczqnLX1WSHzlMPkFmxEdVAKgKn 8fCtaDz9ynbVBz9yhHgmv8dabnItzdQIIMF2vNh2Kaz2NOMkhv+bvAYFnRIPrIHiimru cK4Q== X-Gm-Message-State: ALoCoQlFfEze1F3Iw46eWGTOBY/sAD+4giR+MDcu2c7EM5SgmoAB4Rnt2B1RR5QMTuVMJINTZHz6 X-Received: by 10.66.172.103 with SMTP id bb7mr11378208pac.44.1392674349515; Mon, 17 Feb 2014 13:59:09 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.24.49 with SMTP id 46ls1093007qgq.21.gmail; Mon, 17 Feb 2014 13:59:09 -0800 (PST) X-Received: by 10.52.165.101 with SMTP id yx5mr12218874vdb.29.1392674349363; Mon, 17 Feb 2014 13:59:09 -0800 (PST) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id sx1si4809103vdc.127.2014.02.17.13.59.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 13:59:09 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id pa12so12937264veb.30 for ; Mon, 17 Feb 2014 13:59:09 -0800 (PST) X-Received: by 10.52.185.196 with SMTP id fe4mr12138089vdc.27.1392674349284; Mon, 17 Feb 2014 13:59:09 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp169531vcz; Mon, 17 Feb 2014 13:59:08 -0800 (PST) X-Received: by 10.67.5.7 with SMTP id ci7mr28604492pad.99.1392674348500; Mon, 17 Feb 2014 13:59:08 -0800 (PST) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by mx.google.com with ESMTPS id cb2si13249593pbb.64.2014.02.17.13.59.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 13:59:08 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.50 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.220.50; Received: by mail-pa0-f50.google.com with SMTP id kp14so15765333pab.23 for ; Mon, 17 Feb 2014 13:59:08 -0800 (PST) X-Received: by 10.67.22.38 with SMTP id hp6mr28995214pad.53.1392674348019; Mon, 17 Feb 2014 13:59:08 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id x5sm49045254pbw.26.2014.02.17.13.59.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 13:59:07 -0800 (PST) From: John Stultz To: LKML Cc: Serban Constantinescu , Greg KH , Colin Cross , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Android Kernel Team , John Stultz Subject: [PATCH 12/14] staging: binder: Fix ABI for 64bit Android Date: Mon, 17 Feb 2014 13:58:40 -0800 Message-Id: <1392674322-9036-13-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1392674322-9036-1-git-send-email-john.stultz@linaro.org> References: <1392674322-9036-1-git-send-email-john.stultz@linaro.org> MIME-Version: 1.0 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Serban Constantinescu This patch fixes the ABI for 64bit Android userspace. BC_REQUEST_DEATH_NOTIFICATION and BC_CLEAR_DEATH_NOTIFICATION claim to be using struct binder_ptr_cookie, but they are using a 32bit handle and a pointer. On 32bit systems the payload size is the same as the size of struct binder_ptr_cookie, however for 64bit systems this will differ. This patch adds struct binder_handle_cookie that fixes this issue for 64bit Android. Since there are no 64bit users of this interface that we know of this change should not affect any existing systems. Cc: Greg KH Cc: Colin Cross Cc: Arve Hjønnevåg Cc: Serban Constantinescu Cc: Android Kernel Team Signed-off-by: Serban Constantinescu [jstultz: Minor commit tweaks, few 80+ col fixes for checkpatch] Signed-off-by: John Stultz --- drivers/staging/android/uapi/binder.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/staging/android/uapi/binder.h b/drivers/staging/android/uapi/binder.h index 2b1eb81..4071fcf 100644 --- a/drivers/staging/android/uapi/binder.h +++ b/drivers/staging/android/uapi/binder.h @@ -152,6 +152,11 @@ struct binder_ptr_cookie { void *cookie; }; +struct binder_handle_cookie { + __u32 handle; + void *cookie; +} __attribute__((packed)); + struct binder_pri_desc { __s32 priority; __u32 desc; @@ -308,15 +313,17 @@ enum binder_driver_command_protocol { * of looping threads it has available. */ - BC_REQUEST_DEATH_NOTIFICATION = _IOW('c', 14, struct binder_ptr_cookie), + BC_REQUEST_DEATH_NOTIFICATION = _IOW('c', 14, + struct binder_handle_cookie), /* - * void *: ptr to binder + * int: handle * void *: cookie */ - BC_CLEAR_DEATH_NOTIFICATION = _IOW('c', 15, struct binder_ptr_cookie), + BC_CLEAR_DEATH_NOTIFICATION = _IOW('c', 15, + struct binder_handle_cookie), /* - * void *: ptr to binder + * int: handle * void *: cookie */