about summary refs log tree commit diff
path: root/sysdeps/mach/hurd
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-08-22 22:23:58 +0000
committerRoland McGrath <roland@gnu.org>1999-08-22 22:23:58 +0000
commit38e30b398a33ecaf1c17aa5cef9520564d41d4ef (patch)
treea51890bda3f5aad7b993deb023f9bbb38fad1f48 /sysdeps/mach/hurd
parentab58d6203b8322bcfa253923d86c991c1f6a4294 (diff)
downloadglibc-38e30b398a33ecaf1c17aa5cef9520564d41d4ef.tar.gz
glibc-38e30b398a33ecaf1c17aa5cef9520564d41d4ef.tar.xz
glibc-38e30b398a33ecaf1c17aa5cef9520564d41d4ef.zip
1999-08-19 Roland McGrath <roland@baalperazim.frob.com>
	* sysdeps/mach/hurd/i386/intr-msg.h (INTR_MSG_TRAP): Mark OPTION and
	TIMEOUT as outputs of the asm to indicate that the signal thread
	might mutate them.
	* hurd/intr-msg.c (_hurd_intr_rpc_mach_msg): Short circuit to plain
	mach_msg if only sending or only receiving (i.e., not an RPC).  When
	making an RPC that might get interrupted, save OPTION and the portion
	of the message buffer that gets clobbered by an EINTR reply message,
	and properly restore them before attempting to retry the request
	message send.
Diffstat (limited to 'sysdeps/mach/hurd')
-rw-r--r--sysdeps/mach/hurd/i386/intr-msg.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/sysdeps/mach/hurd/i386/intr-msg.h b/sysdeps/mach/hurd/i386/intr-msg.h
index c011447543..a12b2f2174 100644
--- a/sysdeps/mach/hurd/i386/intr-msg.h
+++ b/sysdeps/mach/hurd/i386/intr-msg.h
@@ -1,5 +1,5 @@
 /* Machine-dependent details of interruptible RPC messaging.  i386 version.
-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,9 @@
    Boston, MA 02111-1307, USA.  */
 
 
+/* Note that we must mark OPTION and TIMEOUT as outputs of this operation,
+   to indicate that the signal thread might mutate them as part
+   of sending us to a signal handler.  */
 #define INTR_MSG_TRAP(msg, option, send_size, rcv_size, rcv_name, timeout, notify) \
 ({									      \
   error_t err;								      \
@@ -26,12 +29,14 @@
        ".globl _hurd_intr_rpc_msg_cx_sp\n"				      \
        ".globl _hurd_intr_rpc_msg_sp_restored\n"			      \
        "				movl %%esp, %%ecx\n"		      \
-       "				leal %1, %%esp\n"		      \
+       "				leal %3, %%esp\n"		      \
        "_hurd_intr_rpc_msg_cx_sp:	movl $-25, %%eax\n"		      \
        "_hurd_intr_rpc_msg_do_trap:	lcall $7, $0 # status in %0\n"	      \
        "_hurd_intr_rpc_msg_in_trap:	movl %%ecx, %%esp\n"		      \
        "_hurd_intr_rpc_msg_sp_restored:"				      \
-       : "=a" (err) : "m" ((&msg)[-1]) : "%ecx");			      \
+       : "=a" (err), "=m" (option), "=m" (timeout)			      \
+       : "m" ((&msg)[-1]), "1" (option), "2" (timeout)			      \
+       : "%ecx");							      \
   err;									      \
 })