diff --git a/kernel-src/include/util.h b/kernel-src/include/util.h index 8acc3223..287bfea0 100644 --- a/kernel-src/include/util.h +++ b/kernel-src/include/util.h @@ -4,4 +4,8 @@ #define ROUND_DOWN(v, n) ((v) - ((v) % (n))) #define ROUND_UP(v, n) ROUND_DOWN((v) + (n) - 1, n) +static inline long abs(long x) { + return x < 0 ? -x : x; +} + #endif