Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Apr 2018 14:31:55 +0000 (UTC)
From:      =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r332072 - head/sys/sys
Message-ID:  <201804051431.w35EVtg4047897@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: royger
Date: Thu Apr  5 14:31:54 2018
New Revision: 332072
URL: https://svnweb.freebsd.org/changeset/base/332072

Log:
  introduce GiB and MiB macros
  
  This macros convert from GiB or MiB into bytes.
  
  Sponsored by: Citrix Systems R&D

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Thu Apr  5 14:25:39 2018	(r332071)
+++ head/sys/sys/param.h	Thu Apr  5 14:31:54 2018	(r332072)
@@ -362,4 +362,8 @@ __END_DECLS
  */
 #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_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804051431.w35EVtg4047897>