summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-08-20 03:45:14 +0000
committerRoland McGrath <roland@gnu.org>1999-08-20 03:45:14 +0000
commit8595b3b943d9d87f910bae2912721a56525cc244 (patch)
tree317aa8ef03aa2ea360d9b3c8cbbf65ff4c78092e /sysdeps
parent28f2b23e6820c74467a0f03d3dcceb8dbabb1060 (diff)
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')
-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; \
})