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