2 ** Copyright 2001-2004, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
8 #include <kernel/ktypes.h>
9 #include <kernel/arch/kernel.h>
10 #include <newos/defines.h>
11 #include <newos/compiler.h>
12 #include <newos/errors.h>
13 #include <boot/stage2.h>
15 #define ROUNDUP(a, b) (((a) + ((b)-1)) & ~((b)-1))
16 #define ROUNDOWN(a, b) (((a) / (b)) * (b))
18 #define min(a, b) ((a) < (b) ? (a) : (b))
19 #define max(a, b) ((a) > (b) ? (a) : (b))
21 #define CHECK_BIT(a, b) ((a) & (1 << (b)))
22 #define SET_BIT(a, b) ((a) | (1 << (b)))
23 #define CLEAR_BIT(a, b) ((a) & (~(1 << (b))))
25 #define TOUCH(x) ((void)(x))
27 #define containerof(ptr, type, member) \
28 ((type *)((addr_t)(ptr) - offsetof(type, member)))
30 extern bool kernel_startup
;
31 extern kernel_args global_kernel_args
;