#ifndef _FSSH_KERNEL_H
#define _FSSH_KERNEL_H
#include "fssh_os.h"
#if 0
#define IS_USER_ADDRESS(x) \
((addr_t)(x) < KERNEL_BASE || (addr_t)(x) > KERNEL_TOP)
#define IS_KERNEL_ADDRESS(x) \
((addr_t)(x) >= KERNEL_BASE && (addr_t)(x) <= KERNEL_TOP)
#endif
#define DEBUG_KERNEL_STACKS
#ifndef DEBUG_KERNEL_STACKS
# define KERNEL_STACK_SIZE (B_PAGE_SIZE * 2)
#else
# define KERNEL_STACK_SIZE (B_PAGE_SIZE * 3)
#endif
#define KERNEL_STACK_GUARD_PAGES 1
#define USER_MAIN_THREAD_STACK_SIZE (16 * 1024 * 1024)
#define USER_STACK_SIZE (256 * 1024)
#define USER_STACK_GUARD_PAGES 4
#define ENV_SIZE (B_PAGE_SIZE * 8)
#define ROUNDUP(a, b) (((a) + ((b)-1)) & ~((b)-1))
#define ROUNDDOWN(a, b) (((a) / (b)) * (b))
#define HOWMANY(a, b) (((a) + ((b) - 1)) / (b))
#define CHECK_BIT(a, b) ((a) & (1 << (b)))
#define SET_BIT(a, b) ((a) | (1 << (b)))
#define CLEAR_BIT(a, b) ((a) & (~(1 << (b))))
#endif