svn commit: r340676 - in head/sys: kern sys

John Baldwin jhb at FreeBSD.org
Mon Nov 26 20:19:55 UTC 2018


On 11/22/18 9:28 AM, Mateusz Guzik wrote:
> diff --git a/sys/sys/systm.h b/sys/sys/systm.h
> index a1b98c5660c..fab94ee7979 100644
> --- a/sys/sys/systm.h
> +++ b/sys/sys/systm.h
> @@ -523,7 +523,11 @@ int alloc_unr_specific(struct unrhdr *uh, u_int item);
>  int alloc_unrl(struct unrhdr *uh);
>  void free_unr(struct unrhdr *uh, u_int item);
> 
> -#if defined(__mips__) || defined(__powerpc__)
> +#if defined(mips) && !defined(__mips_n64) && !defined(__mips_n32)
> +#define UNR64_LOCKED
> +#endif

This would perhaps be shorter as:

#if defined(__mips__) && defined(__mips_o32)

> +
> +#if defined(__powerpc__) && !defined(__powerpc64__)
>  #define UNR64_LOCKED
>  #endif

It's not clear to me why this isn't just conditional on LP64 though.
If 32-bit riscv existed in FreeBSD it would also not have this.  If we
really care that much about i386 and 32-bit arm you could write it as:

#if !(defined(__LP64__) || defined(__i386__) || defined(__arm__))

(I'm not sure we care that much though and think we could just use __LP64__
alone and call it a day.)

-- 
John Baldwin

                                                                            


More information about the svn-src-head mailing list