summaryrefslogtreecommitdiffhomepage
path: root/dev/user/Macros.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-04-15 17:04:45 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-04-15 17:04:45 +0200
commit0b0f61ae48bbd8827d6088feab6cf58e7837bf92 (patch)
treed54948563b5bb2a2cc72ca4a88cc3032a75657ee /dev/user/Macros.h
parent56a97ff6398c03de22dabd7b93f54b1292f66b97 (diff)
dev, user: drafting a system call map.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/user/Macros.h')
-rw-r--r--dev/user/Macros.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/dev/user/Macros.h b/dev/user/Macros.h
index 98beeb0d..556833ea 100644
--- a/dev/user/Macros.h
+++ b/dev/user/Macros.h
@@ -90,4 +90,36 @@ IMPORT_C void _rtl_assert(Bool expr, const Char* origin);
#define ARRAY_SIZE(X) \
(((sizeof(X) / sizeof(*(X))) / \
(static_cast<SizeT>(!(sizeof(X) % sizeof(*(X)))))))
-#endif \ No newline at end of file
+#endif
+
+#ifndef KIB
+#define KIB(X) (UInt64)((X) / 1024)
+#endif
+
+#ifndef kib_cast
+#define kib_cast(X) (UInt64)((X)*1024)
+#endif
+
+#ifndef MIB
+#define MIB(X) (UInt64)((UInt64)KIB(X) / 1024)
+#endif
+
+#ifndef mib_cast
+#define mib_cast(X) (UInt64)((UInt64)kib_cast(X) * 1024)
+#endif
+
+#ifndef GIB
+#define GIB(X) (UInt64)((UInt64)MIB(X) / 1024)
+#endif
+
+#ifndef gib_cast
+#define gib_cast(X) (UInt64)((UInt64)mib_cast(X) * 1024)
+#endif
+
+#ifndef TIB
+#define TIB(X) (UInt64)((UInt64)GIB(X) / 1024)
+#endif
+
+#ifndef tib_cast
+#define tib_cast(X) ((UInt64)gib_cast(X) * 1024)
+#endif