4 #include <minix/callnr.h>
6 #include <minix/config.h>
7 #include <minix/const.h>
9 #include <minix/endpoint.h>
10 #include <minix/keymap.h>
11 #include <minix/minlib.h>
12 #include <minix/type.h>
13 #include <minix/ipc.h>
14 #include <minix/sysutil.h>
15 #include <minix/syslib.h>
26 #define SENDSLOTS _NR_PROCS
28 PRIVATE asynmsg_t msgtable
[SENDSLOTS
];
29 PRIVATE
size_t msgtable_n
= SENDSLOTS
;
31 PUBLIC
int asynsend(dst
, mp
)
38 /* Find slot in table */
39 for (i
= 0; i
<msgtable_n
; i
++)
41 flags
= msgtable
[i
].flags
;
42 if ((flags
& (AMF_VALID
|AMF_DONE
)) == (AMF_VALID
|AMF_DONE
))
44 if (msgtable
[i
].result
!= OK
)
47 "VM: asynsend: found completed entry %d with error %d\n",
48 i
, msgtable
[i
].result
);
52 if (flags
== AMF_EMPTY
)
56 vm_panic("asynsend: should resize table", i
);
59 msgtable
[i
].flags
= AMF_VALID
; /* Has to be last. The kernel
60 * scans this table while we are
64 /* Tell the kernel to rescan the table */
65 return senda(msgtable
, msgtable_n
);