xref: /haiku/src/system/runtime_loader/utility.h (revision 82a8a20999118b748396cf16a33c47c3b0c0222d)
1 /*
2  * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef UTILITY_H
6 #define UTILITY_H
7 
8 #include <OS.h>
9 
10 
11 #define	PAGE_MASK (B_PAGE_SIZE - 1)
12 
13 #define	PAGE_OFFSET(x) ((x) & (PAGE_MASK))
14 #define	PAGE_BASE(x) ((x) & ~(PAGE_MASK))
15 #define TO_PAGE_SIZE(x) ((x + (PAGE_MASK)) & ~(PAGE_MASK))
16 
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 void dprintf(const char *format, ...);
23 
24 #ifdef __cplusplus
25 }
26 #endif
27 
28 #endif	// UTILITY_H
29