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

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




On 3/27/25 9:18 AM, Jan Beulich wrote:
On 26.03.2025 18:47, Oleksii Kurochko wrote:
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -98,4 +98,13 @@
 #define ZERO_BLOCK_PTR ((void *)-1L)
 #endif
 
+#define BYTES_PER_LONG  __SIZEOF_LONG__
+
+#define BITS_PER_BYTE   __CHAR_BIT__
+#define BITS_PER_INT    (__SIZEOF_INT__ << 3)
+#define BITS_PER_LONG   (BYTES_PER_LONG << 3)
+#define BITS_PER_LLONG  (__SIZEOF_LONG_LONG__ << 3)
+
+#define POINTER_ALIGN   __SIZEOF_POINTER__
Just one remark here: Imo this needs to come with a comment, as alignment and
size aren't necessarily tied together. It's merely that we assume that
sizeof(void *) == __alignof(void *).
I will added the following comment then:
/* it is assumed that sizeof(void *) == __alignof(void *) */

~ Oleksii

 


Rackspace

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