From patchwork Mon Apr 22 16:49:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 162608 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2801364jan; Mon, 22 Apr 2019 09:51:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxd+s2gKpU3zC00n8QOeR89loz7zXbVuhN3Be6Jdc9HDnhdWd6aMyBQNgVP67LU19UTx/7 X-Received: by 2002:a25:25d2:: with SMTP id l201mr17330155ybl.257.1555951880457; Mon, 22 Apr 2019 09:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555951880; cv=none; d=google.com; s=arc-20160816; b=RLollyNLbaaBzOtwGl5fMk5Uh4JHGd767uC5pL7B4OjgxFjKrDqzoCb/Pipe7C0fsb SvltnfNQGaEBlhyrCbLA0UIo0EYfIsOL679OFdo8F9qO98aDlNp5QKDa8t0XfXTVq58h 0o8lXLjW+4H6J9xOiX1EUelH/pjY0PEGQjt5gBfuiElSCVgpmSua5MfMUKLk5fQPv66O A5UapAjYHYbLYb0d5FVHF/f45FaIHZLWmDrceQa8fG9lQ+Gpxe1vPIiwqdQa7yiAlcjx QxSrNMufgOY7/g32SDvkk1DCXSOqmrRA4FH+OJTHnU4Z3PCsH3X40EQ0zKpUX8z8Psi5 dJXA== 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:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=RnIkcWvTDTtP7dQEhDgaDwQ1HPPH7uW3TdJHf9p0IZs=; b=qXCgH/Y40NKWSHOGNTjn7kTi1G2htFx5vWQ/4zzcGdaCGFBIQpqUmfNPB50MGxIts6 ABVTdQ1qeZIKG4YBH07QGNH4Wk5zaEC69FIeyBAxSw0u0DQFNMWx5715laGMfpUvBveU adDTne8x0erFeUfZVaE3adlIGERWX0y0eom5GjdettjwVy6UD5033q3HQBCf3JHSJmuZ Hze/MOHVIsoS9Cmh3X8r0A+DYifJm9nVn2SFBXSWH+ijdX8nvHY9C0J4Mgs7wYEgbkd9 E+f2SLIIxp95dKVn/mILfDc3s9ARPbaO6o8nRK88ZxErObDi6bMsHVAMCjaou73a8ukr vOHA== 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 y204si965759ywy.441.2019.04.22.09.51.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Apr 2019 09:51:20 -0700 (PDT) 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.89) (envelope-from ) id 1hIc8g-0004Qk-La; Mon, 22 Apr 2019 16:49:54 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hIc8f-0004Qe-N1 for xen-devel@lists.xenproject.org; Mon, 22 Apr 2019 16:49:53 +0000 X-Inumbo-ID: a6946122-651e-11e9-9db4-1b290d8ec6c6 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id a6946122-651e-11e9-9db4-1b290d8ec6c6; Mon, 22 Apr 2019 16:49:53 +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 B70BDEBD; Mon, 22 Apr 2019 09:49:52 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A35DE3F557; Mon, 22 Apr 2019 09:49:50 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 22 Apr 2019 17:49:18 +0100 Message-Id: <20190422164937.21350-2-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190422164937.21350-1-julien.grall@arm.com> References: <20190422164937.21350-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 01/20] xen/const: Introduce _BITUL and _BITULL X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: sstabellini@kernel.org, Andrii_Anisov@epam.com, Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Oleksandr_Tyshchenko@epam.com, Julien Grall , Jan Beulich , Wei Liu MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The pattern _AC(1, UL{,L}) << X is commonly used in the headers to make define usuable in both assembly and C. So introduce _BITUL and _BITULL to make the code slightly more readable. The idea has been taken from Linux (see include/uapi/linux.h). Signed-off-by: Julien Grall --- xen/include/xen/const.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/include/xen/const.h b/xen/include/xen/const.h index 0d5b2c64f5..b4b067bffa 100644 --- a/xen/include/xen/const.h +++ b/xen/include/xen/const.h @@ -21,4 +21,7 @@ #define _AT(T,X) ((T)(X)) #endif +#define _BITUL(x) (_AC(1, UL) << (x)) +#define _BITULL(x) (_AC(1, ULL) << (x)) + #endif /* __XEN_CONST_H__ */