40b1d58077
NR_TASKS in the endpoint macros. MAX_NR_TASKS defines the maximal number of kernel tasks. It is unlikely that we will ever need this many tasks as the goal is not to have such a difference in the future. For now it makes possible to remove the limiting NR_TASKS from the endpoint code.
39 lines
710 B
C
39 lines
710 B
C
|
|
#include <stdio.h>
|
|
#include <minix/endpoint.h>
|
|
#include <minix/sys_config.h>
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
int g, p;
|
|
|
|
printf("Test 39 ");
|
|
|
|
for(g = 0; g <= _ENDPOINT_MAX_GENERATION; g++) {
|
|
for(p = -MAX_NR_TASKS; p < _NR_PROCS; p++) {
|
|
endpoint_t e;
|
|
int mg, mp;
|
|
e = _ENDPOINT(g, p);
|
|
mg = _ENDPOINT_G(e);
|
|
mp = _ENDPOINT_P(e);
|
|
if(mg != g || mp != p) {
|
|
printf("%d != %d || %d != %d\n", mg, g, mp, p);
|
|
return 1;
|
|
}
|
|
if(g == 0 && e != p) {
|
|
printf("%d != %d and g=0\n", e, p);
|
|
return 1;
|
|
}
|
|
if(e == ANY || e == SELF || e == NONE) {
|
|
printf("endpoint (%d,%d) is %d; ANY, SELF or NONE\n",
|
|
g, p, e);
|
|
return 1;
|
|
}
|
|
}
|
|
}
|
|
|
|
printf("ok\n");
|
|
|
|
return 0;
|
|
}
|
|
|