From patchwork Thu Feb 15 15:02:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 128460 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1846924ljc; Thu, 15 Feb 2018 07:05:45 -0800 (PST) X-Google-Smtp-Source: AH8x226AnG4F6FpJ8LoFjDywfUoWQAPfNas61n+ntanU8eWmfjWXLWT20ofhhy8gZfly/nL7gSlS X-Received: by 10.202.90.137 with SMTP id o131mr1899591oib.210.1518707145730; Thu, 15 Feb 2018 07:05:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518707145; cv=none; d=google.com; s=arc-20160816; b=bZzvFNK+kGmlqiHfxahTheB5MXKdcFR47jZWMhuV3POBnJiB3H71tjftj9u7/1H6Dy 002WWIPxy9jwfOnQbxXMivfZkFNm+vymHwW7PD0MTNd4g1tMJHnC5DgPrhj7zYcU4wIv Szv2wjPEGnKjW+9UiPG/VcBjYrB7zucW7lf3vNyMDqFeACq0HPCdCdz9pogteA7VsfUL i78UHFT33Ynj+LUnsBl9srys3Do5GFUmJcHuvphvYF9fUUXBZoURKL1WwTyk5283tH88 SFgK78O36NIQPRzL3+qrSaPIUOh4ohRlPCiCGeL3oGRiddDJZ3jhVOQSBUOxNQmVw0o7 fQvA== 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=ima8HELVD6oCpECxpXHQLSqnkWAMPbKAVNbj6ItWmGw=; b=hA3yeFAy2oVWPW7kdL7PNKgKgfctP/sAO3p9WH92e3LCva3eju+cF4FC5xmAi7nS5U yQ+Ep1SDdakZ5Rw+eCCkV1Y7QRxkZ7ui+fn4tTaCuSNyA/chQFGlgEjRyC+baMuS+koi pQyJf1oA9Nt/VdXD5ZcKNRbRm1WFkmWFevkQKIgydAn2odNEKnRffC+5SpEn8PGx8YKA KAikU6goGJfnAPCar6IlUi6RApdrttQ9s7tu0WMIfJ7qer/q9zyQxkbZm8Z/BYgryFn9 RRMi3I3ufHXvZGKuKWWEdju7srfSvbzh+a+PxAQrGsFAfjJPGK6k324YA3xdJerUIojC q/Aw== 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 f77si1821618itf.51.2018.02.15.07.05.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Feb 2018 07:05:45 -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 1emL43-0001yV-MI; Thu, 15 Feb 2018 15:03:11 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emL43-0001x1-2A for xen-devel@lists.xen.org; Thu, 15 Feb 2018 15:03:11 +0000 X-Inumbo-ID: 8136153c-1261-11e8-b9b1-635ca7ef6cff Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 8136153c-1261-11e8-b9b1-635ca7ef6cff; Thu, 15 Feb 2018 15:04:22 +0000 (UTC) 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 C52DF1435; Thu, 15 Feb 2018 07:03:04 -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 B604D3F41F; Thu, 15 Feb 2018 07:03:03 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 15 Feb 2018 15:02:35 +0000 Message-Id: <20180215150248.28922-5-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180215150248.28922-1-julien.grall@arm.com> References: <20180215150248.28922-1-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org, volodymyr_babchuk@epam.com, andre.przywara@linaro.org Subject: [Xen-devel] [PATCH v3 04/17] 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 2951caa49d..30208d12ca 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.