aboutsummaryrefslogtreecommitdiff
path: root/include/apos/utils.h
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2021-12-23 18:23:50 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2021-12-23 18:23:50 +0200
commitf2300b433e152968a0fcabd79fb9d0f5fda6bca3 (patch)
tree1f41b5e9277215d83965bc61985ee18d3da608eb /include/apos/utils.h
parent64ef02c4baa0a1181a28e2e1b1517de3ba4907be (diff)
downloadkmi-f2300b433e152968a0fcabd79fb9d0f5fda6bca3.tar.gz
kmi-f2300b433e152968a0fcabd79fb9d0f5fda6bca3.zip
Added alloc_fixed_region
+ Not used at the moment anywhere, but should come in handy when emulating stuff like (s)brk and when mapping ELF stuff
Diffstat (limited to 'include/apos/utils.h')
-rw-r--r--include/apos/utils.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/apos/utils.h b/include/apos/utils.h
index b973d49..f1e79fa 100644
--- a/include/apos/utils.h
+++ b/include/apos/utils.h
@@ -1,6 +1,8 @@
#ifndef APOS_UTILS_H
#define APOS_UTILS_H
+#define ABS(a) (a < 0 ? -a : a)
+
#define MAX(a, b) ((a) >= (b) ? (a) : (b))
#define MAX3(a, b, c) (MAX(a, b) >= MAX(b, c) ? MAX(a, b) : MAX(b, c))
#define MAX4(a, b, c, d) (MAX3(a, b, c) >= MAX3(b, c, d) ? MAX3(a, b, c) : MAX3(b, c, d))