xref: /minix/minix/kernel/const.h (revision 0a6a1f1d)
1 /* General macros and constants used by the kernel. */
2 #ifndef CONST_H
3 #define CONST_H
4 
5 #include <minix/config.h>
6 #include <minix/bitmap.h>
7 
8 #include "config.h"
9 #include "debug.h"
10 
11 /* Translate an endpoint number to a process number, return success. */
12 #ifndef isokendpt
13 #define isokendpt(e,p) isokendpt_d((e),(p),0)
14 #define okendpt(e,p)   isokendpt_d((e),(p),1)
15 #endif
16 
17 /* Constants used in virtual_copy(). Values must be 0 and 1, respectively. */
18 #define _SRC_	0
19 #define _DST_	1
20 
21 #define get_sys_bit(map,bit) \
22 	( MAP_CHUNK((map).chunk,bit) & (1 << CHUNK_OFFSET(bit) ))
23 #define get_sys_bits(map,bit) \
24 	( MAP_CHUNK((map).chunk,bit) )
25 #define set_sys_bit(map,bit) \
26 	( MAP_CHUNK((map).chunk,bit) |= (1 << CHUNK_OFFSET(bit) ))
27 #define unset_sys_bit(map,bit) \
28 	( MAP_CHUNK((map).chunk,bit) &= ~(1 << CHUNK_OFFSET(bit) ))
29 
30 /* for kputc() */
31 #define END_OF_KMESS	0
32 
33 /* User limits. */
34 #ifndef USR_DATATOP
35 #ifndef _MINIX_MAGIC
36 #define USR_DATATOP 0xF0000000
37 #else
38 #define USR_DATATOP 0xE0000000	/* TODO: is this necessary? */
39 #endif
40 #endif
41 
42 #ifndef USR_STACKTOP
43 #define USR_STACKTOP USR_DATATOP
44 #endif
45 
46 #ifndef USR_DATATOP_COMPACT
47 #define USR_DATATOP_COMPACT USR_DATATOP
48 #endif
49 
50 #ifndef USR_STACKTOP_COMPACT
51 #define USR_STACKTOP_COMPACT 0x50000000
52 #endif
53 
54 #endif /* CONST_H */
55