>> Index: src/sys/arch/aarch64/include/cpu.h
>> diff -u src/sys/arch/aarch64/include/cpu.h:1.27 src/sys/arch/aarch64/inc=
>lude/cpu.h:1.28
>> --- src/sys/arch/aarch64/include/cpu.h:1.27  Mon Sep 14 10:06:35 2020
>> +++ src/sys/arch/aarch64/include/cpu.h       Thu Oct  1 06:40:16 2020
>> @@ -1,4 +1,4 @@
>> -/* $NetBSD: cpu.h,v 1.27 2020/09/14 10:06:35 ryo Exp $ */
>> +/* $NetBSD: cpu.h,v 1.28 2020/10/01 06:40:16 ryo Exp $ */
>>
>>   /*-
>>    * Copyright (c) 2014, 2020 The NetBSD Foundation, Inc.
>> @@ -156,7 +156,7 @@ void     cpu_hatch(struct cpu_info *);
>>   extern struct cpu_info *cpu_info[];
>>   extern struct cpu_info cpu_info_store[];
>>
>> -#define CPU_INFO_ITERATOR   cpuid_t
>> +#define CPU_INFO_ITERATOR   int
>>   #if defined(MULTIPROCESSOR) || defined(_MODULE)
>>   #define cpu_number()               (curcpu()->ci_index)
>>   #define CPU_IS_PRIMARY(ci) ((ci)->ci_index =3D=3D 0)
>>
>
>I think this is the wrong way to go ultimately
>
>unsigned int at least

In most arch, CPU_INFO_ITERATOR is an int.

  # grep CPU_INFO_ITERATOR /usr/src/sys/arch/*/include/cpu.h
  /usr/src/sys/arch/aarch64/include/cpu.h:#define CPU_INFO_ITERATOR     int
  /usr/src/sys/arch/alpha/include/cpu.h:#define CPU_INFO_ITERATOR               
int __unused
  /usr/src/sys/arch/arm/include/cpu.h:#define CPU_INFO_ITERATOR int
  /usr/src/sys/arch/hppa/include/cpu.h:#define  CPU_INFO_ITERATOR               
int
  /usr/src/sys/arch/ia64/include/cpu.h:#define  CPU_INFO_ITERATOR               
int __unused
  /usr/src/sys/arch/mips/include/cpu.h:#define  CPU_INFO_ITERATOR               
int
  /usr/src/sys/arch/mips/include/cpu.h:#define  CPU_INFO_ITERATOR               
int __unused
  /usr/src/sys/arch/or1k/include/cpu.h:#define CPU_INFO_ITERATOR        cpuid_t
  /usr/src/sys/arch/powerpc/include/cpu.h:#define CPU_INFO_ITERATOR     int
  /usr/src/sys/arch/powerpc/include/cpu.h:#define CPU_INFO_ITERATOR     int
  /usr/src/sys/arch/riscv/include/cpu.h:#define CPU_INFO_ITERATOR       cpuid_t
  /usr/src/sys/arch/sparc64/include/cpu.h:#define CPU_INFO_ITERATOR             
int __unused
  /usr/src/sys/arch/vax/include/cpu.h:#define   CPU_INFO_ITERATOR       int 
__unused
  /usr/src/sys/arch/x86/include/cpu.h:#define   CPU_INFO_ITERATOR               
int __unused

and, it is compared to "int ncpu", so it is matched to the type of 'ncpu'. 
(otherwise, clang warns)

-- 
ryo shimizu

Reply via email to