2018-02-22 19:38:27 +00:00
|
|
|
#ifndef __KF_LINUX_DEFS_H__
|
|
|
|
#define __KF_LINUX_DEFS_H__
|
|
|
|
|
|
|
|
#include <stddef.h>
|
2018-02-23 17:07:12 +00:00
|
|
|
#include <stdint.h>
|
2018-02-22 19:38:27 +00:00
|
|
|
|
2018-02-24 03:19:29 +00:00
|
|
|
typedef int32_t KF_INT;
|
2018-03-02 00:09:06 +00:00
|
|
|
typedef uint32_t KF_UINT;
|
2018-02-28 03:59:29 +00:00
|
|
|
typedef int64_t KF_LONG;
|
2018-03-02 00:09:06 +00:00
|
|
|
constexpr size_t dshift = (sizeof(KF_INT) * 8) - 1;
|
2018-02-28 03:59:29 +00:00
|
|
|
|
2018-03-02 00:09:06 +00:00
|
|
|
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-24 03:19:29 +00:00
|
|
|
|
2018-02-22 19:38:27 +00:00
|
|
|
#endif
|