[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] xen/config.h: Move BITS_PER_* definitions from asm/config.h to xen/config.h




On 3/28/25 8:49 AM, Jan Beulich wrote:
On 27.03.2025 18:33, Oleksii Kurochko wrote:
BITS_PER_* values can be defined in a common way using compiler-provided macros.
Thus, these definitions are moved to xen/config.h to reduce duplication across
architectures.

Additionally, *_BYTEORDER macros are removed, as BITS_PER_* values now come
directly from the compiler environment.

The arch_fls() implementation for Arm and PPC is updated to use BITS_PER_INT
instead of a hardcoded value of 32.

Suggested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
albeit ...

--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -98,4 +98,14 @@
 #define ZERO_BLOCK_PTR ((void *)-1L)
 #endif
 
+#define BYTES_PER_LONG  __SIZEOF_LONG__
... I remain unconvinced that we actually need this (yet then not its sibling
for int). All uses I can spot could be replaced by sizeof(long). This (and its
sibling) would be needed only for #if uses, and there I would then wonder why
we couldn't use __SIZEOF_LONG__ directly, now that we assume its universally
available.
I left only because BYTES_PER_LONG is used in ARM and x86 code.
If no one minds, I can replace BYTES_PER_LONG with __SIZEOF_LONG__.

~ Oleksii

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.