fc661a6b8671b51a16d7a5f5aad98a317ce31558
[kopensolaris-gnu/glibc.git] / sysdeps / unix / bsd / osf / alpha / sysdep.h
1 /* Copyright (C) 1993, 1995 Free Software Foundation, Inc.
2    Contributed by Brendan Kehoe (brendan@zen.org).
3
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB.  If
16 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17 Cambridge, MA 02139, USA.  */
18
19 /* OSF/1 does not precede the asm names of C symbols with a `_'. */
20 #define NO_UNDERSCORES
21
22 #include <sysdeps/unix/sysdep.h>
23
24 #ifdef  ASSEMBLER
25
26 #include <machine/pal.h>                /* get PAL_callsys */
27 #include <regdef.h>
28
29 #ifdef __STDC__
30 #define ENTRY(name) \
31   .globl name;                                                                \
32   .ent name,0;                                                                \
33   name##:;                                                                    \
34   .frame sp,0,ra
35 #else
36 #define ENTRY(name) \
37   .globl name;                                                                \
38   .ent name,0;                                                                \
39   name/**/:;                                                                  \
40   .frame sp,0,ra
41 #endif
42
43 #ifdef __STDC__
44 #define PSEUDO(name, syscall_name, args) \
45   ENTRY(name);                                                                \
46   ldiq v0, SYS_##syscall_name;                                                \
47   .set noat;                                                                  \
48   call_pal PAL_callsys;                                                       \
49   .set at;                                                                    \
50   beq a3, 10f;                                                                \
51   br gp, 20f;                                                                 \
52 20:;                                                                          \
53   ldgp gp, 0(gp);                                                             \
54   jmp zero, syscall_error;                                                    \
55 10:
56 #else
57 #define PSEUDO(name, syscall_name, args) \
58   ENTRY(name);                                                                \
59   ldiq v0, SYS_/**/syscall_name;                                              \
60   .set noat;                                                                  \
61   call_pal PAL_callsys;                                                       \
62   .set at;                                                                    \
63   beq a3, 10f;                                                                \
64   br gp, 20f;                                                                 \
65 20:;                                                                          \
66   ldgp gp, 0(gp);                                                             \
67   jmp zero, syscall_error;                                                    \
68 10:
69 #endif
70
71 #define ret             ret zero,(ra),1
72 #define r0              v0
73 #define r1              a4
74 #define MOVE(x,y)       mov x, y
75
76 #endif  /* ASSEMBLER */