sandbox/linux/defs.h

28 lines
461 B
C
Raw Normal View History

2018-02-22 19:38:27 +00:00
#ifndef __KF_LINUX_DEFS_H__
#define __KF_LINUX_DEFS_H__
#include <stddef.h>
#include <stdint.h>
2018-02-22 19:38:27 +00:00
typedef int32_t KF_INT;
typedef uint32_t KF_UINT;
typedef int64_t KF_LONG;
constexpr size_t dshift = (sizeof(KF_INT) * 8) - 1;
typedef uintptr_t KF_ADDR;
constexpr uint8_t STACK_SIZE = 128;
constexpr size_t ARENA_SIZE = 65535;
static inline KF_INT
mask(size_t bits)
{
KF_INT m = 0;
for (size_t i = 0; i < bits; i++) {
m += 1 << i;
}
return m;
}
2018-02-22 19:38:27 +00:00
#endif