[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 3/4] include: move STR() and IS_ALIGNED()
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Thu, 31 Mar 2022 11:31:02 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6S1HpDENtJ7ubBweYtGrl5poiiLyhdsWba6MqBcEJhM=; b=G/CvAumSVmKG3+SKVSitG3KZ/o8Sug/S2l3Z3FUpLpEG6xTfL7aNn5/X/RgLkAWwrBXlyA7U1rkrjR5oudC3byxjrgl8GezSoa31CiTtK7z4P6yiyldicBEhX8E2V6xnYrhaKzLPzFz67P/ugVox4kF4uqzlYH190YTQyjwFtdB3EhUUtflzgZkte+od9kwuJMcogdbrhFynbw+P6l1D+aqxMg6hxNyx0WuIoW0x4G40htPRFxnmHNF+OWS15bNTvD8if6G+A8LlQMUvP0fg3qLWA83zvKv57K6eIr2GF+OYzJTFqBReUF1YyTGokRbw1ICvLliFCIcuMOolIU99zQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UC0dpPWDisbFK77x9NKqkHvYBfBYBJC5/LqvKLpR/Ag6iCeOvoMYCAp6La3M8ivSqXZjgoXh9dIz0uoVKMgzltx7fOxL5Bvbm6774RO90kwIKibyfcid2ZGh9sdePSkhVurbUZMGzsyskLnH603NrUbUorJpSnmG4WQ8SkF904IluKnBVbO0ec68ERDbU3jCzDwfNJQDuRgMZfH6HpoHo1Hv70udwve94hLyn1cXIUOBpaLWQO1npjIuwGGtr6yqUdW5xSYwRVS6ONvE2LCFjz9BnMaV3o2+D29WO55kqkLGtv30VROx0ytcqBuTDVecRANtUEji9Y2RGOV62NxCoA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
- Delivery-date: Thu, 31 Mar 2022 09:31:19 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
lib.h is imo a better fit for them than config.h.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
v4: New.
---
Originally I thought I'd also move KB() etc, but they're used in places
where yet further adjustments (adding of #include) would be necessary.
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -3,6 +3,7 @@
/* Modified for ARM Xen by Ian Campbell */
#include <xen/cache.h>
+#include <xen/lib.h>
#include <asm/page.h>
#undef ENTRY
#undef ALIGN
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -2,6 +2,7 @@
/* Modified for i386/x86-64 Xen by Keir Fraser */
#include <xen/cache.h>
+#include <xen/lib.h>
#include <asm/page.h>
#undef ENTRY
#undef ALIGN
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -82,11 +82,6 @@
#define MB(_mb) (_AC(_mb, ULL) << 20)
#define GB(_gb) (_AC(_gb, ULL) << 30)
-#define IS_ALIGNED(val, align) (((val) & ((align) - 1)) == 0)
-
-#define __STR(...) #__VA_ARGS__
-#define STR(...) __STR(__VA_ARGS__)
-
/* allow existing code to work with Kconfig variable */
#define NR_CPUS CONFIG_NR_CPUS
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -3,6 +3,8 @@
#define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
+#define IS_ALIGNED(val, align) (!((val) & ((align) - 1)))
+
#define DIV_ROUND(n, d) (((n) + (d) / 2) / (d))
#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
@@ -17,6 +19,9 @@
#define PASTE_(a, b) a ## b
#define PASTE(a, b) PASTE_(a, b)
+#define __STR(...) #__VA_ARGS__
+#define STR(...) __STR(__VA_ARGS__)
+
#ifndef __ASSEMBLY__
#include <xen/inttypes.h>
|