Skip to content

Commit

Permalink
lib: utilities: add MB and GB defines
Browse files Browse the repository at this point in the history
If MB and GB definition is not available then define new ones

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
  • Loading branch information
tnmysh authored and arnopo committed Sep 11, 2023
1 parent 6d571fd commit 0ad1183
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ extern "C" {
* @{
*/

#define MB (1024 * 1024UL)
#define GB (1024 * 1024 * 1024UL)
#ifndef MB
#define MB (1024UL << 10UL)
#endif

#ifndef GB
#define GB (MB << 10UL)
#endif

/** Marker for unused function arguments/variables. */
#define metal_unused(x) do { (x) = (x); } while (0)
Expand Down

0 comments on commit 0ad1183

Please sign in to comment.