Tue Aug 22 16:49:12 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
[glibc.git] / sysdeps / mach / hurd / i386 / intr-msg.h
blob353a6d2acd20bef48ed602ab4d6902942b397eec
1 /* Machine-dependent details of interruptible RPC messaging. i386 version.
2 Copyright (C) 1995 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If
17 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
18 Cambridge, MA 02139, USA. */
21 #define INTR_MSG_TRAP(msg, option, send_size, rcv_size, rcv_name, timeout, notify) \
22 ({ \
23 error_t err; \
24 asm (".globl _hurd_intr_rpc_msg_do_trap\n" \
25 ".globl _hurd_intr_rpc_msg_in_trap\n" \
26 ".globl _hurd_intr_rpc_msg_cx_sp\n" \
27 ".globl _hurd_intr_rpc_msg_sp_restored\n" \
28 " movl %%esp, %%ecx\n" \
29 " leal %1, %%esp\n" \
30 "_hurd_intr_rpc_msg_cx_sp: movl $-25, %%eax\n" \
31 "_hurd_intr_rpc_msg_do_trap: lcall $7, $0 # status in %0\n" \
32 "_hurd_intr_rpc_msg_in_trap: movl %%ecx, %%esp\n" \
33 "_hurd_intr_rpc_msg_sp_restored:" \
34 : "=a" (err) : "m" ((&msg)[-1]) : "%ecx"); \
35 err; \
39 static void inline
40 INTR_MSG_BACK_OUT (struct i386_thread_state *state)
42 extern const void _hurd_intr_rpc_msg_cx_sp;
43 if (state->eip >= (natural_t) &_hurd_intr_rpc_msg_cx_sp)
44 state->uesp = state->ecx;
45 else
46 state->ecx = state->uesp;