From eb076dbf3754f44efdda926e1cc55a5c86136f5c Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Sun, 7 Jul 2024 09:39:07 +0200 Subject: MHR-36: IMP: Add ProgramLoader class, *_cast macros and patching capability. FIX: Device constructor marked as explicit. Signed-off-by: Amlal EL Mahrouss --- Kernel/NewKit/Macros.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Kernel/NewKit') diff --git a/Kernel/NewKit/Macros.hpp b/Kernel/NewKit/Macros.hpp index 1f121a37..b15cda51 100644 --- a/Kernel/NewKit/Macros.hpp +++ b/Kernel/NewKit/Macros.hpp @@ -10,18 +10,34 @@ #define KIB(X) ((X) / 1024) #endif +#ifndef kib_cast +#define kib_cast(X) ((X) * 1024) +#endif + #ifndef MIB #define MIB(X) ((UInt64)KIB(X) / 1024) #endif +#ifndef mib_cast +#define mib_cast(X) ((UInt64)kib_cast(X) * 1024) +#endif + #ifndef GIB #define GIB(X) ((UInt64)MIB(X) / 1024) #endif +#ifndef gib_cast +#define gib_cast(X) ((UInt64)mib_cast(X) * 1024) +#endif + #ifndef TIB #define TIB(X) ((UInt64)GIB(X) / 1024) #endif +#ifndef tib_cast +#define tib_cast(X) ((UInt64)gib_cast(X) * 1024) +#endif + #ifndef ARRAY_SIZE #define ARRAY_SIZE(a) \ (((sizeof(a) / sizeof(*(a))) / \ -- cgit v1.2.3