> Date: Fri, 9 Mar 2018 19:43:42 +0200
> From: Artturi Alm <artturi....@gmail.com>
> 
> Hi,
> 
> lazy retry[0],
> to give these timers their (likely) copy-paste-robbed MSB back.
> 
> -Artturi
> 
> [0] https://marc.info/?l=openbsd-tech&m=150421823512699&w=1

This doesn't actually fix anything; 31 bits are plenty.  Leaving off
the top bit protects against signed/unsigned mistakes although there
shouldn't be any.  So I'm not sure this is worth it.

> diff --git sys/arch/arm/cortex/agtimer.c sys/arch/arm/cortex/agtimer.c
> index 8d622c058a4..160e22e6949 100644
> --- sys/arch/arm/cortex/agtimer.c
> +++ sys/arch/arm/cortex/agtimer.c
> @@ -46,7 +46,7 @@ int32_t agtimer_frequency = TIMER_FREQUENCY;
>  u_int agtimer_get_timecount(struct timecounter *);
>  
>  static struct timecounter agtimer_timecounter = {
> -     agtimer_get_timecount, NULL, 0x7fffffff, 0, "agtimer", 0, NULL
> +     agtimer_get_timecount, NULL, 0xffffffff, 0, "agtimer", 0, NULL
>  };
>  
>  #define MAX_ARM_CPUS 8
> diff --git sys/arch/arm/cortex/amptimer.c sys/arch/arm/cortex/amptimer.c
> index 81880c1574a..66f0ccfed64 100644
> --- sys/arch/arm/cortex/amptimer.c
> +++ sys/arch/arm/cortex/amptimer.c
> @@ -67,7 +67,7 @@ int32_t amptimer_frequency = TIMER_FREQUENCY;
>  u_int amptimer_get_timecount(struct timecounter *);
>  
>  static struct timecounter amptimer_timecounter = {
> -     amptimer_get_timecount, NULL, 0x7fffffff, 0, "amptimer", 0, NULL
> +     amptimer_get_timecount, NULL, 0xffffffff, 0, "amptimer", 0, NULL
>  };
>  
>  #define MAX_ARM_CPUS 8
> diff --git sys/arch/arm64/dev/agtimer.c sys/arch/arm64/dev/agtimer.c
> index 0e6e6a3bc6e..7d9557e706f 100644
> --- sys/arch/arm64/dev/agtimer.c
> +++ sys/arch/arm64/dev/agtimer.c
> @@ -43,7 +43,7 @@ int32_t agtimer_frequency = TIMER_FREQUENCY;
>  u_int agtimer_get_timecount(struct timecounter *);
>  
>  static struct timecounter agtimer_timecounter = {
> -     agtimer_get_timecount, NULL, 0x7fffffff, 0, "agtimer", 0, NULL
> +     agtimer_get_timecount, NULL, 0xffffffff, 0, "agtimer", 0, NULL
>  };
>  
>  #define MAX_ARM_CPUS 8
> diff --git sys/arch/armv7/omap/gptimer.c sys/arch/armv7/omap/gptimer.c
> index e87db41106e..2e6c8cf8d42 100644
> --- sys/arch/armv7/omap/gptimer.c
> +++ sys/arch/armv7/omap/gptimer.c
> @@ -117,7 +117,7 @@ int gptimer_irq = 0;
>  u_int gptimer_get_timecount(struct timecounter *);
>  
>  static struct timecounter gptimer_timecounter = {
> -     gptimer_get_timecount, NULL, 0x7fffffff, 0, "gptimer", 0, NULL
> +     gptimer_get_timecount, NULL, 0xffffffff, 0, "gptimer", 0, NULL
>  };
>  
>  volatile u_int32_t nexttickevent;
> 
> 

Reply via email to