[PATCH master 2/8] include: asm-generic/pointer.h: fix ASM_PTR definition for i386

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Mar 19 22:16:35 PDT 2025


For GNU as on i386, a .word is 16-bit wide, unlikes ARM, where it's
32-bit. The code in asm-generic/pointer.h expects .word to be
32-bit wide though, therefore to switch to .long.

Unlike C's long, an assembly .long is always 32-bit (and thus
identical to .int).

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
v1 -> v2:
  - new patch to fix compile error with IMD on i386 sandbox
---
 include/asm-generic/pointer.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/asm-generic/pointer.h b/include/asm-generic/pointer.h
index 89817ce59ebc..fbd1a831b8be 100644
--- a/include/asm-generic/pointer.h
+++ b/include/asm-generic/pointer.h
@@ -16,12 +16,12 @@
 #endif
 #elif __SIZEOF_POINTER__ == 4
 #ifdef __ASSEMBLY__
-#define ASM_PTR		.word
+#define ASM_PTR		.long
 #define ASM_SZPTR	4
 #define ASM_LGPTR	2
 #define ASM_LD_PTR(x)	LONG(x)
 #else
-#define ASM_PTR		".word"
+#define ASM_PTR		".long"
 #define ASM_SZPTR	"4"
 #define ASM_LGPTR	"2"
 #endif
-- 
2.39.5




More information about the barebox mailing list