From d639cffec9a6d041938db202bd62f1cd57edb51e Mon Sep 17 00:00:00 2001 From: Cristiano Giuffrida Date: Tue, 11 Mar 2014 21:11:32 +0100 Subject: [PATCH] libsys: Support for senda_reload(). Change-Id: I67f94515d2b89199643195d32d92f1bef9770359 --- minix/include/minix/sysutil.h | 1 + minix/lib/libsys/asynsend.c | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/minix/include/minix/sysutil.h b/minix/include/minix/sysutil.h index 81a3c4492..45a756044 100644 --- a/minix/include/minix/sysutil.h +++ b/minix/include/minix/sysutil.h @@ -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); } diff --git a/minix/lib/libsys/asynsend.c b/minix/lib/libsys/asynsend.c index d6c19eecd..c3d8e6cf1 100644 --- a/minix/lib/libsys/asynsend.c +++ b/minix/lib/libsys/asynsend.c @@ -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); }