1
/* Machine-dependent details of interruptible RPC messaging. Alpha version.
2
Copyright (C) 2002 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 Lesser General Public
7
License as published by the Free Software Foundation; either
8
version 2.1 of the 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
Lesser General Public License for more details.
15
You should have received a copy of the GNU Lesser General Public
16
License along with the GNU C Library; if not, write to the Free
17
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20
#define INTR_MSG_TRAP(msg, option, send_size, rcv_size, rcv_name, timeout, notify) \
23
asm (".globl _hurd_intr_rpc_msg_do_trap\n" \
24
".globl _hurd_intr_rpc_msg_in_trap\n" \
33
"_hurd_intr_rpc_msg_do_trap: callsys\n" \
34
"_hurd_intr_rpc_msg_in_trap: ret\n" \
36
: "r" (msg), "r" (option), "r" (send_size), "r" (rcv_size), \
37
"r" (rcv_name), "r" (timeout), "r" (notify) \
38
: "16", "17", "18", "19", "20", "21", "1", "0"); \
43
INTR_MSG_BACK_OUT (struct alpha_thread_state *state)
48
#include "hurdfault.h"
50
/* This cannot be an inline function because it calls setjmp. */
51
#define SYSCALL_EXAMINE(state, callno) \
53
u_int32_t *p = (void *) ((state)->pc - 4); \
55
_hurdsig_catch_memory_fault (p) ? 0 : \
57
result = (*p == 0x00000083); \
58
_hurdsig_end_catch_fault (); \
60
/* The PC is just after a `callsys' instruction. \
61
This is a system call in progress; v0 holds the call number. */ \
62
*(callno) = (state)->r0; \
67
struct mach_msg_trap_args
69
/* This is the order of arguments to mach_msg_trap. */
70
mach_msg_header_t *msg;
71
mach_msg_option_t option;
72
mach_msg_size_t send_size;
73
mach_msg_size_t rcv_size;
75
mach_msg_timeout_t timeout;
79
/* This cannot be an inline function because it calls setjmp. */
80
#define MSG_EXAMINE(state, msgid, rcv_name, send_name, option, timeout) \
82
mach_msg_header_t *msg = (mach_msg_header_t *) (state)->r16; \
83
*(option) = (mach_msg_option_t) (state)->r17; \
84
*(rcv_name) = (mach_port_t) (state)->r18; \
85
*(timeout) = (mach_msg_timeout_t) (state)->r19; \
88
*(send_name) = MACH_PORT_NULL; \
92
(_hurdsig_catch_memory_fault (msg) ? -1 : \
94
*(send_name) = msg->msgh_remote_port; \
95
*(msgid) = msg->msgh_id; \
96
_hurdsig_end_catch_fault (); \