00001
00002 #ifndef _MINIX_ENDPOINT_H
00003 #define _MINIX_ENDPOINT_H 1
00004
00005 #include <minix/sys_config.h>
00006 #include <minix/com.h>
00007 #include <limits.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #define _ENDPOINT_GENERATION_SIZE (NR_TASKS+_MAX_MAGIC_PROC+1)
00019 #define _ENDPOINT_MAX_GENERATION (INT_MAX/_ENDPOINT_GENERATION_SIZE-1)
00020
00021
00022 #define _ENDPOINT(g, p) ((g) * _ENDPOINT_GENERATION_SIZE + (p))
00023 #define _ENDPOINT_G(e) (((e)+NR_TASKS) / _ENDPOINT_GENERATION_SIZE)
00024 #define _ENDPOINT_P(e) ((((e)+NR_TASKS) % _ENDPOINT_GENERATION_SIZE) - NR_TASKS)
00025
00026 #endif