2013-04-09 01:55:47 +02:00
|
|
|
|
|
|
|
#include <arch/types.h>
|
|
|
|
|
|
|
|
#ifndef __SIZE_TYPE__
|
|
|
|
#define __SIZE_TYPE__ unsigned long
|
|
|
|
#endif
|
|
|
|
typedef __SIZE_TYPE__ size_t;
|
2013-05-02 23:02:28 +02:00
|
|
|
/* There is a GCC macro for a size_t type, but not
|
|
|
|
* for a ssize_t type. Below construct tricks GCC
|
|
|
|
* into making __SIZE_TYPE__ signed.
|
|
|
|
*/
|
|
|
|
#define unsigned signed
|
|
|
|
typedef __SIZE_TYPE__ ssize_t;
|
|
|
|
#undef unsigned
|
2013-04-09 01:55:47 +02:00
|
|
|
|
|
|
|
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER)
|
2015-06-11 14:17:32 +02:00
|
|
|
#define member_size(TYPE, MEMBER) (sizeof(((TYPE *) 0)->MEMBER))
|
2013-04-09 01:55:47 +02:00
|
|
|
|
2014-03-06 00:46:28 +01:00
|
|
|
/* Standard units. */
|
|
|
|
#define KiB (1<<10)
|
|
|
|
#define MiB (1<<20)
|
|
|
|
#define GiB (1<<30)
|