1433d6423SLionel Sambuc /* General macros and constants used by the kernel. */ 2433d6423SLionel Sambuc #ifndef CONST_H 3433d6423SLionel Sambuc #define CONST_H 4433d6423SLionel Sambuc 5433d6423SLionel Sambuc #include <minix/config.h> 6433d6423SLionel Sambuc #include <minix/bitmap.h> 7433d6423SLionel Sambuc 8433d6423SLionel Sambuc #include "debug.h" 9433d6423SLionel Sambuc 10433d6423SLionel Sambuc /* Translate an endpoint number to a process number, return success. */ 11433d6423SLionel Sambuc #ifndef isokendpt 12433d6423SLionel Sambuc #define isokendpt(e,p) isokendpt_d((e),(p),0) 13433d6423SLionel Sambuc #define okendpt(e,p) isokendpt_d((e),(p),1) 14433d6423SLionel Sambuc #endif 15433d6423SLionel Sambuc 16433d6423SLionel Sambuc /* Constants used in virtual_copy(). Values must be 0 and 1, respectively. */ 17433d6423SLionel Sambuc #define _SRC_ 0 18433d6423SLionel Sambuc #define _DST_ 1 19433d6423SLionel Sambuc 20433d6423SLionel Sambuc #define get_sys_bit(map,bit) \ 21433d6423SLionel Sambuc ( MAP_CHUNK((map).chunk,bit) & (1 << CHUNK_OFFSET(bit) )) 22433d6423SLionel Sambuc #define get_sys_bits(map,bit) \ 23433d6423SLionel Sambuc ( MAP_CHUNK((map).chunk,bit) ) 24433d6423SLionel Sambuc #define set_sys_bit(map,bit) \ 25433d6423SLionel Sambuc ( MAP_CHUNK((map).chunk,bit) |= (1 << CHUNK_OFFSET(bit) )) 26433d6423SLionel Sambuc #define unset_sys_bit(map,bit) \ 27433d6423SLionel Sambuc ( MAP_CHUNK((map).chunk,bit) &= ~(1 << CHUNK_OFFSET(bit) )) 28433d6423SLionel Sambuc 29433d6423SLionel Sambuc /* for kputc() */ 30433d6423SLionel Sambuc #define END_OF_KMESS 0 31433d6423SLionel Sambuc 32*53398d73SCristiano Giuffrida /* User limits. */ 33*53398d73SCristiano Giuffrida #ifndef USR_DATATOP 34*53398d73SCristiano Giuffrida #ifndef _MINIX_MAGIC 35*53398d73SCristiano Giuffrida #define USR_DATATOP 0xF0000000 36*53398d73SCristiano Giuffrida #else 37*53398d73SCristiano Giuffrida #define USR_DATATOP 0xE0000000 /* TODO: is this necessary? */ 38*53398d73SCristiano Giuffrida #endif 39*53398d73SCristiano Giuffrida #endif 40*53398d73SCristiano Giuffrida 41*53398d73SCristiano Giuffrida #ifndef USR_STACKTOP 42*53398d73SCristiano Giuffrida #define USR_STACKTOP USR_DATATOP 43*53398d73SCristiano Giuffrida #endif 44*53398d73SCristiano Giuffrida 45*53398d73SCristiano Giuffrida #ifndef USR_DATATOP_COMPACT 46*53398d73SCristiano Giuffrida #define USR_DATATOP_COMPACT USR_DATATOP 47*53398d73SCristiano Giuffrida #endif 48*53398d73SCristiano Giuffrida 49*53398d73SCristiano Giuffrida #ifndef USR_STACKTOP_COMPACT 50*53398d73SCristiano Giuffrida #define USR_STACKTOP_COMPACT 0x50000000 51*53398d73SCristiano Giuffrida #endif 52*53398d73SCristiano Giuffrida 53433d6423SLionel Sambuc #endif /* CONST_H */ 54