]> xenbits.xensource.com Git - xen.git/commitdiff
Arm: constrain {,u}int64_aligned_t in public header
authorJan Beulich <jbeulich@suse.com>
Thu, 7 Sep 2023 07:22:40 +0000 (09:22 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 7 Sep 2023 07:22:40 +0000 (09:22 +0200)
For using a GNU extension, it may not be exposed in general, just like
is done on x86 (except that here we need to also work around not all of
the tool stack actually defining __XEN_TOOLS__). External consumers (not
using gcc or a compatible compiler) need to make this type available up
front (just like we expect {,u}int<N>_t to be supplied) - unlike on x86
the type is actually needed outside of tools-only interfaces, because
guest handle definitions use it.

While there also add underscores around "aligned".

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Henry Wang <Henry.Wang@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/public/arch-arm.h

index 492819ad22c9af04f60b7c430c2b7a864dbe2309..6a4467e8f5d1532e826a7ad3be48c7b352553b08 100644 (file)
 
 #define XEN_HYPERCALL_TAG   0XEA1
 
-#define  int64_aligned_t  int64_t __attribute__((aligned(8)))
-#define uint64_aligned_t uint64_t __attribute__((aligned(8)))
+#if defined(__XEN__) || defined(__XEN_TOOLS__) || defined(__GNUC__)
+#define  int64_aligned_t  int64_t __attribute__((__aligned__(8)))
+#define uint64_aligned_t uint64_t __attribute__((__aligned__(8)))
+#endif
 
 #ifndef __ASSEMBLY__
 #define ___DEFINE_XEN_GUEST_HANDLE(name, type)                  \