Replace FSF snail mail address with URLs.
[glibc.git] / sysdeps / mach / hurd / powerpc / intr-msg.h
blobc567217c9c73de74997a126ee5a34c9f15cdf7ae
1 /* Machine-dependent details of interruptible RPC messaging. PowerPC version.
2 Copyright (C) 1995,96,97,99,2001 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, see
17 <http://www.gnu.org/licenses/>. */
19 #define INTR_MSG_TRAP(msg, option, send_size, rcv_size, rcv_name, timeout, notify) \
20 ({ \
21 error_t err; \
22 asm (".globl _hurd_intr_rpc_msg_do_trap\n" \
23 ".globl _hurd_intr_rpc_msg_in_trap\n" \
24 " mr 3, %1\n" \
25 " mr 4, %2\n" \
26 " mr 5, %3\n" \
27 " mr 6, %4\n" \
28 " mr 7, %5\n" \
29 " mr 8, %6\n" \
30 " mr 9, %7\n" \
31 " li 0, -25\n" \
32 "_hurd_intr_rpc_msg_do_trap: sc\n" \
33 "_hurd_intr_rpc_msg_in_trap: mr 3, %0\n" \
34 : "=r" (err) \
35 : "r" (msg), "r" (option), "r" (send_size), "r" (rcv_size), \
36 "r" (rcv_name), "r" (timeout), "r" (notify) \
37 : "0", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"); \
38 err; \
41 static void inline
42 INTR_MSG_BACK_OUT (struct ppc_thread_state *state)
44 return;
47 #include "hurdfault.h"
49 /* This cannot be an inline function because it calls setjmp. */
50 #define SYSCALL_EXAMINE(state, callno) \
51 ({ \
52 u_int32_t *p = (void *) ((state)->srr0 - 4); \
53 int result; \
54 _hurdsig_catch_memory_fault (p) ? 0 : \
55 ({ \
56 if (result = (*p == 0x44000002)) \
57 /* The PC is just after an `sc' instruction. \
58 This is a system call in progress; %r0 holds the call number. */ \
59 *(callno) = (state)->r0; \
60 _hurdsig_end_catch_fault (); \
61 result; \
62 }); \
65 struct mach_msg_trap_args
67 /* This is the order of arguments to mach_msg_trap. */
68 mach_msg_header_t *msg;
69 mach_msg_option_t option;
70 mach_msg_size_t send_size;
71 mach_msg_size_t rcv_size;
72 mach_port_t rcv_name;
73 mach_msg_timeout_t timeout;
74 mach_port_t notify;
77 /* This cannot be an inline function because it calls setjmp. */
78 #define MSG_EXAMINE(state, msgid, rcv_name, send_name, option, timeout) \
79 ({ \
80 mach_msg_header_t *msg = (mach_msg_header_t *) (state)->r3; \
81 *(option) = (mach_msg_option_t) (state)->r4; \
82 *(rcv_name) = (mach_port_t) (state)->r7; \
83 *(timeout) = (mach_msg_timeout_t) (state)->r8; \
84 (msg == 0) ? \
85 ({ \
86 *(send_name) = MACH_PORT_NULL; \
87 *(msgid) = 0; \
88 0; \
89 }) : \
90 (_hurdsig_catch_memory_fault (msg) ? -1 : \
91 ({ \
92 *(send_name) = msg->msgh_remote_port; \
93 *(msgid) = msg->msgh_id; \
94 _hurdsig_end_catch_fault (); \
95 0; \
96 }) \
97 ); \