On Tue, 5 Nov 2024, Haris Okanovic wrote: > -#define USECS_TO_CYCLES(time_usecs) \ > - xloops_to_cycles((time_usecs) * 0x10C7UL) > - > -static inline unsigned long xloops_to_cycles(unsigned long xloops) > +static inline u64 xloops_to_cycles(u64 xloops) > { > return (xloops * loops_per_jiffy * HZ) >> 32; > } > > -void __delay(unsigned long cycles) > +#define USECS_TO_XLOOPS(time_usecs) \ > + ((time_usecs) * 0x10C7UL) > + > +#define USECS_TO_CYCLES(time_usecs) \ > + xloops_to_cycles(USECS_TO_XLOOPS(time_usecs)) > + > +#define NSECS_TO_XLOOPS(time_nsecs) \ > + ((time_nsecs) * 0x10C7UL) The constant here is the same value as for microseconds. If I remember correctly its 5UL for nanoseconds.