kern: Globally define abs64

So we can use it in non-linuxkpi sources.

Reviewed by:	emaste, mmel
Differential Revision:	https://reviews.freebsd.org/D41767
Sponsored by:	Beckhoff Automation GmbH & Co. KG
This commit is contained in:
Emmanuel Vadot 2023-09-07 09:48:51 +02:00
parent 602d360186
commit 229c65a83f
2 changed files with 1 additions and 6 deletions

View file

@ -623,12 +623,6 @@ mult_frac(uintmax_t x, uintmax_t multiplier, uintmax_t divisor)
return ((q * multiplier) + ((r * multiplier) / divisor));
}
static inline int64_t
abs64(int64_t x)
{
return (x < 0 ? -x : x);
}
typedef struct linux_ratelimit {
struct timeval lasttime;
int counter;

View file

@ -113,6 +113,7 @@ static __inline off_t omax(off_t a, off_t b) { return (a > b ? a : b); }
static __inline off_t omin(off_t a, off_t b) { return (a < b ? a : b); }
static __inline int abs(int a) { return (a < 0 ? -a : a); }
static __inline long labs(long a) { return (a < 0 ? -a : a); }
static __inline int64_t abs64(int64_t a) { return (a < 0 ? -a : a); }
static __inline quad_t qabs(quad_t a) { return (a < 0 ? -a : a); }
#ifndef RANDOM_FENESTRASX