Damien Zammit, le dim. 22 févr. 2026 07:18:03 +0000, a ecrit:
> Since curr_ipl is accessed using the CX() macro,
> this type needs to be 8 bytes long on 64 bit.

We have more of such issue with CX. Rather than changing the type (which
may have unexpected consequences on other parts of the code), we'd
rather have a CX() variant that always take 32bit.

Samuel

> Reported by Brent Baccala
> ---
>  i386/i386/fpu.c | 2 +-
>  i386/i386/spl.h | 4 ++++
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c
> index 22bb28a1..dbd16255 100644
> --- a/i386/i386/fpu.c
> +++ b/i386/i386/fpu.c
> @@ -61,7 +61,7 @@
>  #define ASSERT_IPL(L) \
>  MACRO_BEGIN \
>        if (curr_ipl[cpu_number()] != L) { \
> -           printf("IPL is %d, expected %d\n", curr_ipl[cpu_number()], L); \
> +           printf("IPL is %ld, expected %d\n", (long)curr_ipl[cpu_number()], 
> L); \
>             panic("fpu: wrong ipl"); \
>        } \
>  MACRO_END
> diff --git a/i386/i386/spl.h b/i386/i386/spl.h
> index 834204c4..f4417e7b 100644
> --- a/i386/i386/spl.h
> +++ b/i386/i386/spl.h
> @@ -30,7 +30,11 @@
>   *   machine-dependent code.
>   */
>  
> +#ifdef __x86_64__
> +typedef long         spl_t;
> +#else
>  typedef int          spl_t;
> +#endif
>  
>  extern spl_t (splhi)(void);
>  
> -- 
> 2.51.0
> 
> 
> 

Reply via email to