From patchwork Fri Feb 21 20:43:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 25123 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DA769201EE for ; Fri, 21 Feb 2014 20:43:47 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id pa12sf7539335veb.9 for ; Fri, 21 Feb 2014 12:43:47 -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=IdYObdY/5iP2L5irwyfdeaiEuXDY+cKn1WE/Ir8fYCng1993LB00Ao9J7vP7bMkK6a fDEQDXdy3rG42TuF4YvxkFD8QU11LcBIH1lJCakiLjk6+IOL8d0DSD+O8035OxWVeDDw eCWAsIKfsYohIP2FTRWPICbxUUAnHYlq7J8+YtfqtfT+ejkdHId9ATFxhh8z0XzvTRWb TW68iIzZW7O/+xD34ehomPD4EFDEMdndKreuX+GOs/9T47aMrW+0eMcKvRSXuSJ1uXvG vhPYYdcgtmOOvg1UuBmiHmoen2QbSa0nXh4riAUl/ONYKQ4hI+zVDrCO60QM+Ou45Xcl RiWQ== X-Gm-Message-State: ALoCoQnPCrvMfr/U4y/5ejhI0QI8yFCmqrtvjMGANfkwhb5paUc04TucslzYvz/FmBOHA/d3yCOS X-Received: by 10.52.96.39 with SMTP id dp7mr4003668vdb.3.1393015427683; Fri, 21 Feb 2014 12:43:47 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.119 with SMTP id h110ls1067501qge.54.gmail; Fri, 21 Feb 2014 12:43:47 -0800 (PST) X-Received: by 10.220.250.203 with SMTP id mp11mr6112057vcb.2.1393015427451; Fri, 21 Feb 2014 12:43:47 -0800 (PST) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id cz20si3500514veb.129.2014.02.21.12.43.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Feb 2014 12:43:47 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id lg15so146570vcb.40 for ; Fri, 21 Feb 2014 12:43:47 -0800 (PST) X-Received: by 10.220.106.84 with SMTP id w20mr6169503vco.18.1393015427296; Fri, 21 Feb 2014 12:43:47 -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 u4csp62255vcz; Fri, 21 Feb 2014 12:43:46 -0800 (PST) X-Received: by 10.68.130.202 with SMTP id og10mr11245200pbb.133.1393015426012; Fri, 21 Feb 2014 12:43:46 -0800 (PST) Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by mx.google.com with ESMTPS id q5si8319230pbh.314.2014.02.21.12.43.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Feb 2014 12:43:46 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.172 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.192.172; Received: by mail-pd0-f172.google.com with SMTP id y13so525353pdi.17 for ; Fri, 21 Feb 2014 12:43:45 -0800 (PST) X-Received: by 10.69.1.2 with SMTP id bc2mr11293104pbd.102.1393015425478; Fri, 21 Feb 2014 12:43:45 -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 qs1sm24327600pbb.18.2014.02.21.12.43.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Feb 2014 12:43:44 -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 1/3] staging: binder: Fix ABI for 64bit Android Date: Fri, 21 Feb 2014 12:43:32 -0800 Message-Id: <1393015414-12499-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393015414-12499-1-git-send-email-john.stultz@linaro.org> References: <1393015414-12499-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.220.181 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 */