aa3f4287d4
Paul points out that some people like 1024*1024, others like 1048576, but in any case these are all open to typos. Define KiB, MiB, GiB, and TiB as in the standard so people can use them. Change-Id: Ic1b57e70d3e9b9e1c0242299741f71db91e7cd3f Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/2769 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins)
31 lines
599 B
C
31 lines
599 B
C
#ifndef STDDEF_H
|
|
#define STDDEF_H
|
|
|
|
typedef long ptrdiff_t;
|
|
#ifndef __SIZE_TYPE__
|
|
#define __SIZE_TYPE__ unsigned long
|
|
#endif
|
|
typedef __SIZE_TYPE__ size_t;
|
|
typedef long ssize_t;
|
|
|
|
typedef int wchar_t;
|
|
typedef unsigned int wint_t;
|
|
|
|
#define NULL ((void *)0)
|
|
|
|
/* Standard units. */
|
|
#define KiB (1<<10)
|
|
#define MiB (1<<20)
|
|
#define GiB (1<<30)
|
|
/* Could we ever run into this one? I hope we get this much memory! */
|
|
#define TiB (1<<40)
|
|
|
|
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
|
|
|
|
#ifdef __PRE_RAM__
|
|
#define ROMSTAGE_CONST const
|
|
#else
|
|
#define ROMSTAGE_CONST
|
|
#endif
|
|
|
|
#endif /* STDDEF_H */
|