introduce GiB and MiB macros

This macros convert from GiB or MiB into bytes.

Sponsored by: Citrix Systems R&D
This commit is contained in:
royger 2018-04-05 14:31:54 +00:00
parent 2e02693803
commit 6699cd8b0f

View File

@ -362,4 +362,8 @@ __END_DECLS
*/ */
#define __PAST_END(array, offset) (((__typeof__(*(array)) *)(array))[offset]) #define __PAST_END(array, offset) (((__typeof__(*(array)) *)(array))[offset])
/* Unit conversion macros. */
#define GiB(v) (v ## ULL << 30)
#define MiB(v) (v ## ULL << 20)
#endif /* _SYS_PARAM_H_ */ #endif /* _SYS_PARAM_H_ */