libsys: Support for senda_reload().

Change-Id: I67f94515d2b89199643195d32d92f1bef9770359
This commit is contained in:
Cristiano Giuffrida 2014-03-11 21:11:32 +01:00 committed by David van Moolenbroek
parent e1f889d228
commit d639cffec9
2 changed files with 16 additions and 3 deletions

View file

@ -83,6 +83,7 @@ int stime(time_t *_top);
#define asynsend(ep, msg) asynsend3(ep, msg, 0)
int asynsend3(endpoint_t ep, message *msg, int flags);
int asyn_geterror(endpoint_t *dst, message *msg, int *err);
int senda_reload(void);
#define ASSERT(c) if(!(c)) { panic("%s:%d: assert %s failed", __FILE__, __LINE__, #c); }

View file

@ -32,7 +32,7 @@ int fl;
int i, r, src_ind, dst_ind;
unsigned flags;
static int inside = 0;
int len, needack = 0;
int needack = 0;
/* Debug printf() causes asynchronous sends? */
if (inside) /* Panic will not work either then, so exit */
@ -133,13 +133,25 @@ int fl;
*/
next_slot++;
/* Reload. */
inside = 0;
r = senda_reload();
return r;
}
/*===========================================================================*
* senda_reload *
*===========================================================================*/
int senda_reload()
{
int len;
assert(next_slot >= first_slot);
len = next_slot - first_slot;
assert(first_slot + len <= ASYN_NR);
assert(len >= 0);
inside = 0;
/* Tell the kernel to rescan the table */
return ipc_senda(&msgtable[first_slot], len);
}