2011-03-22 14:47:35 +01:00
|
|
|
#define _SYSTEM 1
|
|
|
|
#include <lib.h>
|
|
|
|
#include <unistd.h>
|
2011-11-14 11:07:49 +01:00
|
|
|
#include <string.h>
|
2011-03-22 14:47:35 +01:00
|
|
|
|
|
|
|
/* return -1, when the query itself or the processing of query has errors.
|
|
|
|
* return 1, when there are more processes waiting to be queried.
|
|
|
|
* return 0, when there are no more processes.
|
|
|
|
* note that for the return value of 0 and 1, the 'endpt' is set accordingly.
|
|
|
|
*/
|
2012-03-25 20:25:53 +02:00
|
|
|
int vm_query_exit(int *endpt)
|
2011-03-22 14:47:35 +01:00
|
|
|
{
|
|
|
|
message m;
|
|
|
|
int r;
|
|
|
|
|
|
|
|
r = _syscall(VM_PROC_NR, VM_QUERY_EXIT, &m);
|
|
|
|
if (r != OK)
|
|
|
|
return -1;
|
|
|
|
if (endpt == NULL)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
*endpt = m.VM_QUERY_RET_PT;
|
|
|
|
return (m.VM_QUERY_IS_MORE ? 1 : 0);
|
|
|
|
}
|
2011-08-12 17:05:08 +02:00
|
|
|
|
2012-03-25 20:25:53 +02:00
|
|
|
int vm_watch_exit(endpoint_t ep)
|
2011-08-12 17:05:08 +02:00
|
|
|
{
|
|
|
|
message m;
|
|
|
|
|
|
|
|
memset(&m, 0, sizeof(m));
|
|
|
|
m.VM_WE_EP = ep;
|
|
|
|
return _syscall(VM_PROC_NR, VM_WATCH_EXIT, &m);
|
|
|
|
}
|