From patchwork Fri Feb 21 22:40:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 25127 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 275F6201EE for ; Fri, 21 Feb 2014 22:40:35 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id y13sf3319934pdi.7 for ; Fri, 21 Feb 2014 14:40:34 -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=oMVkS9Z4Uf4fJ6qXFyx3LjzR9SXI5IZ6AaVRiZVmB+c=; b=EK9LVIC9lxploCFdR1ivTkb6CnHPbqKab85eXonj2GEBeDsqE9kTPC4KU20TqSNYdC zY8hrroVljJ1lhM1t1RVg3byCv8cbafEqjdOj7VFFN0CERjxZD2+Bxv2WiQFoFjLbdH/ Uzjyg9GE6YY6VHjPvf9MemdRysZjrnhCrohEcfBNMcfm6ZDz6M4kvQ485bOhToOr85UL Wb8w6WvBdah8u/wxxd3gUHEBU6qRcwWlu0YghRAVlVYhqUe9QGcbX3MxTr44oLZhqusX xux4RP6y3wFkWn805RKlR34BVAMHRIhWA4v7SdMZelM1C7p62z5JYD+twa5bnlTPW/gR GjTQ== X-Gm-Message-State: ALoCoQmZGCaauhdeeSGqfKu/8GyR845634NkNhNL8FrWe0vUO+EuWOsJO6kEqGdkehnes+U/uM/d X-Received: by 10.66.66.109 with SMTP id e13mr4735418pat.1.1393022434263; Fri, 21 Feb 2014 14:40:34 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.25.198 with SMTP id 64ls1182091qgt.31.gmail; Fri, 21 Feb 2014 14:40:34 -0800 (PST) X-Received: by 10.52.230.105 with SMTP id sx9mr5460418vdc.10.1393022434106; Fri, 21 Feb 2014 14:40:34 -0800 (PST) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id ru2si3624439vcb.29.2014.02.21.14.40.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Feb 2014 14:40:34 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.175 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.175; Received: by mail-ve0-f175.google.com with SMTP id oz11so1997263veb.20 for ; Fri, 21 Feb 2014 14:40:34 -0800 (PST) X-Received: by 10.220.106.84 with SMTP id w20mr6447811vco.18.1393022434011; Fri, 21 Feb 2014 14:40:34 -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 u4csp68873vcz; Fri, 21 Feb 2014 14:40:33 -0800 (PST) X-Received: by 10.66.26.176 with SMTP id m16mr11862238pag.142.1393022433055; Fri, 21 Feb 2014 14:40:33 -0800 (PST) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx.google.com with ESMTPS id wp1si8748732pab.223.2014.02.21.14.40.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Feb 2014 14:40:33 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.54 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.220.54; Received: by mail-pa0-f54.google.com with SMTP id fa1so4052872pad.13 for ; Fri, 21 Feb 2014 14:40:32 -0800 (PST) X-Received: by 10.68.162.66 with SMTP id xy2mr11958477pbb.46.1393022432684; Fri, 21 Feb 2014 14:40:32 -0800 (PST) Received: from buildbox.hsd1.or.comcast.net (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id af1sm58083109pad.12.2014.02.21.14.40.31 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Feb 2014 14:40:31 -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: [PATCHv2 1/3] staging: binder: Fix ABI for 64bit Android Date: Fri, 21 Feb 2014 14:40:25 -0800 Message-Id: <1393022427-14364-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393022427-14364-1-git-send-email-john.stultz@linaro.org> References: <1393022427-14364-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.175 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 BC_REQUEST_DEATH_NOTIFICATION and BC_CLEAR_DEATH_NOTIFICATION were defined with the wrong structure that did not match the code. Since a binder pointer and handle are the same size on 32 bit systems, this change does not affect them. The two commands claimed they were using struct binder_ptr_cookie but they are using a 32bit handle and a pointer. The main purpose of this patch is to add the binder_handle_cookie struct so the service manager does not have to define its own version (libbinder writes one field at a time so it does not use the struct). On 32bit systems the payload size is the same as the size of struct binder_ptr_cookie. On 64bit systems, the size does differ, and the ioctl number does change. However, there are no known 64bit users of this interface, and any 64bit systems will need the following patch to run 32 bit processes anyway, so it is not expected that anyone will ship a 64bit system without this change, so 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: Few 80+ col fixes for checkpatch, improved commit message with help from Serban, and included rational from Arve's email] 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 */