Skip to contentSkip to conversation

tools/include: make uapi/linux/types.h usable from assembly

PATCH In review Thomas Weißschuh 2 participants 2 messages Mar 21, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/include: make uapi/linux/types.h usable from assembly

The "real" linux/types.h UAPI header gracefully degrades to a NOOP when included from assembly code.

Mirror this behaviour in the tools/ variant.

Test for __ASSEMBLER__ over __ASSEMBLY__ as the former is provided by the toolchain automatically.

Fixes c9fbaa879508 ("selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers")

---
Intended to be merged through the tip tree to fix the arm64 selftest build failure there.

---
 tools/include/uapi/linux/types.h | 3 +++
 1 file changed, 3 insertions(+)
tools/include/uapi/linux/types.h +3 -0
index 91fa51a9c31de1496db9a31c90fa95760adc664d..85aa327245c6874e673f9ed0466698487215c655 100644
@@ -4,6 +4,8 @@
 
 #include <asm-generic/int-ll64.h>
 
+#ifndef __ASSEMBLER__
+
 /* copied from linux:include/uapi/linux/types.h */
 #define __bitwise
 typedef __u16 __bitwise __le16;
@@ -20,4 +22,5 @@ typedef __u32 __bitwise __wsum;
 #define __aligned_be64 __be64 __attribute__((aligned(8)))
 #define __aligned_le64 __le64 __attribute__((aligned(8)))
 
+#endif /* __ASSEMBLER__ */
 #endif /* _UAPI_LINUX_TYPES_H */

---
base-commit: 652262975db421767ada3f05b926854bbb357759
change-id: 20250321-uapi-consistency-38648d1235c1

Best regards,

Signature · 1 line
Thomas Weißschuh <[email protected]>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Thomas Weißschuh

The "real" linux/types.h UAPI header gracefully degrades to a NOOP when included from assembly code.

Mirror this behaviour in the tools/ variant.

Test for __ASSEMBLER__ over __ASSEMBLY__ as the former is provided by the toolchain automatically.