From patchwork Thu Feb 8 19:21:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 127726 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1793802ljc; Thu, 8 Feb 2018 11:24:22 -0800 (PST) X-Google-Smtp-Source: AH8x226a61V0z5PgdjcPCB9BUkjMICvvQkMleucC6KBHEk43IWD+3tu7SK/3kF3vghS7KDuepeca X-Received: by 10.107.79.25 with SMTP id d25mr136073iob.270.1518117862617; Thu, 08 Feb 2018 11:24:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518117862; cv=none; d=google.com; s=arc-20160816; b=y3nhOyk1MpRTzG8PA3PRhSx6pb7MhQ4yycdZMfCnnZE7+BAwrjamQDxSembxerp3Rr mTs6pcPdE2JkcBX8+tFBhz+uXkKPW694LeuztcNFqwaj3zFpKXVQtkQLQkzX0svy7+Zm JlI1Phs5KoUI8+bIRPGs3BtQeUwg59mCjuWmCcHw/2xC3pJ9yvyiwa0Uqt2YSUymVv85 1s91lm4j98TJ6L7ONy8J9lPPXhabxodcnbrzICf91OmZK7Fs3ZY5kY5w2O62uekejf5e bjjy+L8y4yo5uPzZmr0c2QFMnXmZyrVI88MEqXqVV7FEnYCf0MjywyhelGJ/6m94cMU7 jk1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:arc-authentication-results; bh=vLgUpdt4o1DKUo7sa2sxFEFNGK2lxd5L1wqXBhaPj5o=; b=Ha0GZCtD8A+51qgPmLa3gQAsXzTGkPaF/7Ca1ub8+Vr4zIqTkt4m6TZw1NfU89QMv9 gHLAXlZUKbvmdHO8bwVEsEJ5matbWEEUPsHmRh6ABXfd22SsDj5GuegPx4zXZ8dN3Ier 1n3HUrHGecIDzAv7kjOcR7I8vntt5SsqX7P42SFM87olcnjt29hVOlqNZcMzQnCnCCZe lPqY4gV1AYTgJAm2RnFrbgY/SqJyFyRJFFdasIKd/1kvJd/x8/QaDTeh2Q7HwKsnvyD3 LSxzUWLghYrgaUybBMx74PTUGW1QxYdnNAGpvFY9rNik0htAI+okmJITtv2ni814XGRz vMZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 192si469893ioz.151.2018.02.08.11.24.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 11:24:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejrm0-0006Ev-Ub; Thu, 08 Feb 2018 19:22:20 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejrlz-0006Dj-KY for xen-devel@lists.xen.org; Thu, 08 Feb 2018 19:22:19 +0000 X-Inumbo-ID: 50c37992-0d05-11e8-ba59-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 50c37992-0d05-11e8-ba59-bc764e045a96; Thu, 08 Feb 2018 20:21:51 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6AD5280D; Thu, 8 Feb 2018 11:22:18 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5BB173F24D; Thu, 8 Feb 2018 11:22:17 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 8 Feb 2018 19:21:53 +0000 Message-Id: <20180208192203.9556-6-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180208192203.9556-1-julien.grall@arm.com> References: <20180208192203.9556-1-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org, volodymyr_babchuk@epam.com, andre.przywara@linaro.org Subject: [Xen-devel] [PATCH v2 05/15] xen/arm: Adapt smccc.h to be able to use it in assembly code X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Signed-off-by: Julien Grall Reviewed-by: Volodymyr Babchuk Acked-by: Stefano Stabellini --- Changes in v2: - Add Volodymyr's reviewed-by --- xen/include/asm-arm/smccc.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/xen/include/asm-arm/smccc.h b/xen/include/asm-arm/smccc.h index b790fac17c..d24ccb51d8 100644 --- a/xen/include/asm-arm/smccc.h +++ b/xen/include/asm-arm/smccc.h @@ -25,18 +25,20 @@ * http://infocenter.arm.com/help/topic/com.arm.doc.den0028a/index.html */ -#define ARM_SMCCC_STD_CALL 0U -#define ARM_SMCCC_FAST_CALL 1U +#define ARM_SMCCC_STD_CALL _AC(0,U) +#define ARM_SMCCC_FAST_CALL _AC(1,U) #define ARM_SMCCC_TYPE_SHIFT 31 -#define ARM_SMCCC_CONV_32 0U -#define ARM_SMCCC_CONV_64 1U +#define ARM_SMCCC_CONV_32 _AC(0,U) +#define ARM_SMCCC_CONV_64 _AC(1,U) #define ARM_SMCCC_CONV_SHIFT 30 -#define ARM_SMCCC_OWNER_MASK 0x3FU +#define ARM_SMCCC_OWNER_MASK _AC(0x3F,U) #define ARM_SMCCC_OWNER_SHIFT 24 -#define ARM_SMCCC_FUNC_MASK 0xFFFFU +#define ARM_SMCCC_FUNC_MASK _AC(0xFFFF,U) + +#ifndef __ASSEMBLY__ /* Check if this is fast call. */ static inline bool smccc_is_fast_call(register_t funcid) @@ -62,6 +64,8 @@ static inline uint32_t smccc_get_owner(register_t funcid) return (funcid >> ARM_SMCCC_OWNER_SHIFT) & ARM_SMCCC_OWNER_MASK; } +#endif + /* * Construct function identifier from call type (fast or standard), * calling convention (32 or 64 bit), service owner and function number.