From patchwork Fri Feb 21 20:42:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 25120 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0C44B201EE for ; Fri, 21 Feb 2014 20:42:26 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id uz6sf17836756obc.6 for ; Fri, 21 Feb 2014 12:42:26 -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: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=Gr6vcBkyOB1JAhDutBJHx4iAjEVMqsB2hmeIoLLu7SxkZmpIcMfcFppoOScr4/k3qD oU4ztAqFLSBgRa2GxlTI+whWZBZfryEyBtKaro9plLHlxfdX82jXobbN++EKrUyYTSiw rb0kVA7RZ31dzBhMlMUZ7U3gxzylx+8K6fx4nTj/qHvDJQSJkA9totRARTA2qDeRhQOM J/l3BfX2sA+ohKaBIHgfRNgKWGfeKqZ/N7h8W2QNFKseI7BnTRskNOQtUzsCwsvujEOU 8DdaEg9Ix1Z/YNbqYgJdwVp/vj1VuhkUV8tU1P3SQoWsJwoDOld+CawvpMe3kinG1TAp lCVA== X-Gm-Message-State: ALoCoQnsWhrzHaMdR+iBB9xbStB+RVTvlh8dco0sn3g38UkBGCgyyAnVMbse7g/U7BqTKzJxT0gk X-Received: by 10.182.98.230 with SMTP id el6mr3040878obb.10.1393015346536; Fri, 21 Feb 2014 12:42:26 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.5 with SMTP id q5ls1120504qgd.99.gmail; Fri, 21 Feb 2014 12:42:26 -0800 (PST) X-Received: by 10.220.99.7 with SMTP id s7mr6014313vcn.19.1393015346410; Fri, 21 Feb 2014 12:42:26 -0800 (PST) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id p9si3490004vdv.122.2014.02.21.12.42.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Feb 2014 12:42:26 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.170 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.170; Received: by mail-vc0-f170.google.com with SMTP id hu8so3839900vcb.1 for ; Fri, 21 Feb 2014 12:42:26 -0800 (PST) X-Received: by 10.220.81.71 with SMTP id w7mr6005001vck.71.1393015346329; Fri, 21 Feb 2014 12:42:26 -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 u4csp62179vcz; Fri, 21 Feb 2014 12:42:25 -0800 (PST) X-Received: by 10.66.65.204 with SMTP id z12mr11306906pas.60.1393015345342; Fri, 21 Feb 2014 12:42:25 -0800 (PST) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by mx.google.com with ESMTPS id m7si8293250pbl.63.2014.02.21.12.42.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Feb 2014 12:42:25 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.176 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.192.176; Received: by mail-pd0-f176.google.com with SMTP id w10so3758860pde.35 for ; Fri, 21 Feb 2014 12:42:24 -0800 (PST) X-Received: by 10.68.162.66 with SMTP id xy2mr11503483pbb.46.1393015344796; Fri, 21 Feb 2014 12:42:24 -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 yh4sm24318634pbb.19.2014.02.21.12.42.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Feb 2014 12:42:24 -0800 (PST) From: John Stultz To: john.stultz@linaro.org Subject: [PATCH 1/3] staging: binder: Fix ABI for 64bit Android Date: Fri, 21 Feb 2014 12:42:19 -0800 Message-Id: <1393015341-12452-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393015341-12452-1-git-send-email-john.stultz@linaro.org> References: <1393015341-12452-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.170 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 */