Make UEFI boot-platform build again
[haiku.git] / headers / private / fs_shell / fssh_kernel_priv.h
blob089210286465c01e248443888d2b13f7f39de8bc
1 /*
2 * Copyright 2002-2005, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
5 * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
6 * Distributed under the terms of the NewOS License.
7 */
8 #ifndef _FSSH_KERNEL_H
9 #define _FSSH_KERNEL_H
12 #include "fssh_os.h"
15 /* Passed in buffers from user-space shouldn't point into the kernel */
16 #if 0
17 #define IS_USER_ADDRESS(x) \
18 ((addr_t)(x) < KERNEL_BASE || (addr_t)(x) > KERNEL_TOP)
20 #define IS_KERNEL_ADDRESS(x) \
21 ((addr_t)(x) >= KERNEL_BASE && (addr_t)(x) <= KERNEL_TOP)
22 #endif // 0
24 #define DEBUG_KERNEL_STACKS
25 // Note, debugging kernel stacks doesn't really work yet. Since the
26 // interrupt will also try to use the stack on a page fault, all
27 // you get is a double fault.
28 // At least, you then know that the stack overflows in this case :)
30 /** Size of the kernel stack */
31 #ifndef DEBUG_KERNEL_STACKS
32 # define KERNEL_STACK_SIZE (B_PAGE_SIZE * 2) // 8 kB
33 #else
34 # define KERNEL_STACK_SIZE (B_PAGE_SIZE * 3) // 8 kB + one guard page
35 #endif
36 #define KERNEL_STACK_GUARD_PAGES 1
38 /** Size of the stack given to teams in user space */
39 #define USER_MAIN_THREAD_STACK_SIZE (16 * 1024 * 1024) // 16 MB
40 #define USER_STACK_SIZE (256 * 1024) // 256 kB
41 #define USER_STACK_GUARD_PAGES 4 // 16 kB
43 /** Size of the environmental variables space for a process */
44 #define ENV_SIZE (B_PAGE_SIZE * 8)
47 #define ROUNDUP(a, b) (((a) + ((b)-1)) & ~((b)-1))
48 #define ROUNDOWN(a, b) (((a) / (b)) * (b))
51 #define CHECK_BIT(a, b) ((a) & (1 << (b)))
52 #define SET_BIT(a, b) ((a) | (1 << (b)))
53 #define CLEAR_BIT(a, b) ((a) & (~(1 << (b))))
56 #endif /* _FSSH_KERNEL_H */