From a19bbc8445c1ff31bc11cd527e15df518c8d7082 Mon Sep 17 00:00:00 2001 From: Hubert Badocha Date: Tue, 10 Sep 2024 18:16:50 +0200 Subject: [PATCH] hal/ia32: cast operands to correct sizes Newer binutils versions check closely if asm instructions get operands of correct size. JIRA: RTOS-912 --- hal/ia32/ia32.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hal/ia32/ia32.h b/hal/ia32/ia32.h index 583e78b55..fdf54b059 100644 --- a/hal/ia32/ia32.h +++ b/hal/ia32/ia32.h @@ -29,7 +29,7 @@ static inline u8 hal_inb(void *addr) __asm__ volatile ( "inb %1, %0\n\t" : "=a" (b) - : "d" (addr) + : "d" ((u16)(addr_t)addr) : ); /* clang-format on */ return b; @@ -42,7 +42,7 @@ static inline void hal_outb(void *addr, u8 b) __asm__ volatile ( "outb %1, %0" : - : "d" (addr), "a" (b) + : "d" ((u16)(addr_t)addr), "a" (b) : ); /* clang-format on */ @@ -58,7 +58,7 @@ static inline u16 hal_inw(void *addr) __asm__ volatile ( "inw %1, %0\n\t" : "=a" (w) - : "d" (addr) + : "d" ((u16)(addr_t)addr) : ); /* clang-format on */ @@ -72,7 +72,7 @@ static inline void hal_outw(void *addr, u16 w) __asm__ volatile ( "outw %1, %0" : - : "d" (addr), "a" (w) + : "d" ((u16)(addr_t)addr), "a" (w) : ); /* clang-format on */