From patchwork Wed Nov 29 12:48:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 10082105 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 83E396020B for ; Wed, 29 Nov 2017 12:58:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 789022979C for ; Wed, 29 Nov 2017 12:58:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D550297AA; Wed, 29 Nov 2017 12:58:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 047A6297A3 for ; Wed, 29 Nov 2017 12:58:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=639NAzfOs5UsciIAZmeak3m542hA9Ss51sroeIVeygw=; b=Xr63q3VNwLSiaH ehIkFJz3phfxbiprRivUmGk3PvZD+UFPUykKLHD6Gy6qjTpxK6tDA/eZSgLq3Y0ZT+Q6gzPE5M6xs l2f7PMEyDTPeAUKMP3bfVv894wNgbHF0V7FIGipljsaqphNOZKfQfFBFFiENJl8WpAsJaZRALmam4 B/r0NeFcH9jvwNYUHPvMIj//WAPgtUh3eBjWphz52RWtwdptiXXcM4zD0vFqLIunUpQTmXY58mWM/ Sv6MtK4JgW9fcbiVK4hS1EqxzPeu+C1XI1W+8AHD3mCgamSGCb1d5sLGkj1Ntvh6W3QW76QCKuTpG dWUKmaI+NquGWlEPEvkA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eK1wr-0001cA-Uo; Wed, 29 Nov 2017 12:58:45 +0000 Received: from mail-he1eur01on0055.outbound.protection.outlook.com ([104.47.0.55] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eK1nx-00042K-Rl for linux-arm-kernel@lists.infradead.org; Wed, 29 Nov 2017 12:49:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=QMbX6CBw2MXVPF3hUPNIGlGkIP8pWT77YzJInpsqJVo=; b=G21wK9Nzx/gVbrj9qdCAdbe6S3ElJZSQTu8nSfptb48HX0kGmuRFEquVkQkYiUbpeqOnmTra/f9WL8q/q+zsNA52mpOWvx5VSTHfnNQ9BppISyRWHEpmGAPkZabHxeDgx8szRYVWtt27rt/Me+8NNLc1cL9MJ657qmFxbydvHkU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Volodymyr_Babchuk@epam.com; Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.56) by AM4PR03MB1762.eurprd03.prod.outlook.com (2603:10a6:200:f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Wed, 29 Nov 2017 12:49:07 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Wed, 29 Nov 2017 14:49:03 +0200 From: Volodymyr Babchuk To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tee-dev@lists.linaro.org, Jens Wiklander Subject: [RESEND PATCH v2 03/14] tee: shm: add accessors for buffer size and page offset Date: Wed, 29 Nov 2017 14:48:27 +0200 Message-Id: <1511959718-5421-4-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511959718-5421-1-git-send-email-volodymyr_babchuk@epam.com> References: <1507923164-12796-1-git-send-email-volodymyr_babchuk@epam.com> <1511959718-5421-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.56] X-ClientProxiedBy: DB6PR0301CA0045.eurprd03.prod.outlook.com (2603:10a6:4:54::13) To AM4PR03MB1762.eurprd03.prod.outlook.com (2603:10a6:200:f::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: db7990fb-281e-412c-b4ca-08d537279472 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603270); SRVR:AM4PR03MB1762; X-Microsoft-Exchange-Diagnostics: 1; AM4PR03MB1762; 3:oRtpAd2M5+EGSNwPIeU7TFCTUMoP2mNSTJEPNKVX1Nz+Eg0k/ohgwxnkJ305wtutdilTcNdMqHCY9ahF2Dg0Nl90+H407RuEvV2FbkKuNAwsulsGq+FZtlNUHyy/hEAztJi4DEX4YmBtpMjkyB3DgH1Z23VLp0cF0mPvz3eCCVqH7u8Sxx6keCtFqBcau3aH3vnB0UGGnOll/mY0fjlOkA9gcqazb83fgp62uLpovUIBL46xNnky1ZpGfD1SGoER; 25:MfFQRpuY5nEp9vUPfjYDaMkJh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DIj8ZUfMioU3wnoQdq5/Tv+Tdby+Jnnhm713z54FA1WnKP2ARiD9eZubebODTMvkVIOM/oXUDlcUPUlLvtz0iVtQ6hh9sn; 4:8jPcbbsOZrizqXIOpModfkiyeCfpOxHbI8wUP9qmJTUYnL0LxNIc9tYdIfEQCIZn3REnbe0vvplK8bplqqCp7Pt6Gv7Nlpk4KbiixLmRHjAZ14oWshaaqIQsDhM9Uwcqu1oz3pMiu3enVif1mzA5oEbWbvwdK6mjKn+wK1WzN3uHW/Ldh83Bw46QKk2OwRsFolQJTZxknUo6s4T2gStB1ijECttmE5YmQIAW/7x3mnmtr4u6les2X/OIQIp0g6D0kTtMssXjBtBcpxyHHCm+2w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231022)(10201501046)(6041248)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM4PR03MB1762; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM4PR03MB1762; X-Forefront-PRVS: 05066DEDBB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(366004)(346002)(189002)(199003)(106356001)(2950100002)(42186006)(16586007)(107886003)(50226002)(2906002)(97736004)(50466002)(80792005)(55236003)(52116002)(66066001)(47776003)(122856001)(53936002)(4326008)(6916009)(48376002)(316002)(39060400002)(8936002)(6666003)(51416003)(50986999)(3846002)(6116002)(76176999)(5660300001)(68736007)(189998001)(36756003)(81166006)(81156014)(105586002)(8676002)(101416001)(7736002)(305945005)(478600001)(86362001)(72206003)(33646002)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR03MB1762; H:EPUAKYIW2556.kyiv.epam.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: epam.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR03MB1762; 23:cHN/1smPyJsM9PwYRrjggKjYUdCilav7xq7of2Izp?= =?us-ascii?Q?fPA18n4t74aWmWmIR86QC6pPPWYAbgkrHHsU2paaNK/7u22OiaP7qnTIVEoV?= =?us-ascii?Q?wjP1lqmcEB6ws96VxZvp4Ll64VUn69K5K3Rr8aRy4Fll0Oig2oM0it7lA6LD?= =?us-ascii?Q?GsSQ1ECRR7IdVZ8aLqDhj0LtBn6YOIqdGhlnQw3EHuChsgrOxXkzH++SaPbX?= =?us-ascii?Q?mgoZyiUk1lXoEJflJLD+/dfGqxy2MjihdF/rrKPdo9mEHt3EtPVTYlVMeyrS?= =?us-ascii?Q?dmJgnRJlpvXYUkHF0fdfjtOCsnbNZJ7ru94uf307yTHEtvQF0YObkIOcxmPG?= =?us-ascii?Q?zFVyV2xMwsOQc1E14wakxvpPUzWx2b1ZvDl8vTMypAwIKpixv/9PyyFp5Ths?= =?us-ascii?Q?oBB7EXLmoIQxs9BM+Ec6qeAzMPZwnwEbei0zjTWEH7tE7zDeDQlNCNyqx0ID?= =?us-ascii?Q?JM5hk1povy71VqRGF6uq1mIuBud4h89BOo6RrBZGfLHfdOcCaZ+MhgrSBMi4?= =?us-ascii?Q?YIY8vyK1LjvHnrEyUm0vi+CEK1ME/Is+RXm2g6j3uTOhTgDwG/EZ18M7OyEv?= =?us-ascii?Q?dT1dJrIWmsRIveSpMZ+pG0+Pfp24LIHS6WX3Z1+z3n9BpZciZVdboScYTVks?= =?us-ascii?Q?eCls0fCc2kT6soG2qOu9cAPIg+H6voYEpfAImwnh4In7GR+YPmmSIE2BaSNM?= =?us-ascii?Q?Si8Tqix4tm76cZkOGeIQsINyXS3/aMPkDpqrE6JqZDHd6fu5DI63RGnCNSwD?= =?us-ascii?Q?7vxuHKVTk9IZ30mNP5uSK7FyGEmcmmHQfBAMW1wja0aD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LweCxEJU4jrndiR3De6y42mhuS01rboEsTljpwj7Mkwq3EL1s3fS6dxegZt7s0qPh9AwLD344LaKLVXzQ=; 7:ftZ/SVWGAUod1cvow+DfmSyymW0Cer/0MGyftt6vgG7NpRCy35elFivRkzpbKRJYGT4TaSQOdA/LNGnumSfBC50GtZdm6ONNH+3Qo0UUlEs3Zolir1Qk7aNJnK/pwN8y94kr8ezmekK8Kks8foqPBiQXbDlVa1KfFcAwykptE5jKyZwUf7wnp/kGBqct/MrcOsbf3MlKlf1392M8RFSdKMU2H0zDJeuQBl/Cjcg9LVDPa4o58y7/VYX36iPEi6mi SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2017 12:49:07.0184 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db7990fb-281e-412c-b4ca-08d537279472 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR03MB1762 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171129_044934_507404_6365C09E X-CRM114-Status: UNSURE ( 7.95 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Volodymyr Babchuk , volodymyr_babchuk@epam.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Volodymyr Babchuk These two function will be needed for shared memory registration in OP-TEE Signed-off-by: Volodymyr Babchuk --- include/linux/tee_drv.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h index 70b9c73..0d7f2a5 100644 --- a/include/linux/tee_drv.h +++ b/include/linux/tee_drv.h @@ -384,6 +384,26 @@ void *tee_shm_get_va(struct tee_shm *shm, size_t offs); int tee_shm_get_pa(struct tee_shm *shm, size_t offs, phys_addr_t *pa); /** + * tee_shm_get_size() - Get size of shared memory buffer + * @shm: Shared memory handle + * @returns size of shared memory + */ +static inline size_t tee_shm_get_size(struct tee_shm *shm) +{ + return shm->size; +} + +/** + * tee_shm_get_page_offset() - Get shared buffer offset from page start + * @shm: Shared memory handle + * @returns page offset of shared buffer + */ +static inline size_t tee_shm_get_page_offset(struct tee_shm *shm) +{ + return shm->offset; +} + +/** * tee_shm_get_id() - Get id of a shared memory object * @shm: Shared memory handle * @returns id