From: Cristiano Giuffrida Date: Tue, 11 Mar 2014 20:11:32 +0000 (+0100) Subject: libsys: Support for senda_reload(). X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=refs%2Fchanges%2F86%2F3086%2F2;p=minix.git libsys: Support for senda_reload(). Change-Id: I67f94515d2b89199643195d32d92f1bef9770359 --- 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); }