* sysdeps/unix/bsd/osf/alpha/sysdep.h (HAVE_ASM_SET_DIRECTIVE):
[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 /* We really can't handle the .set directive for weak aliases.  */
23 #undef HAVE_ASM_SET_DIRECTIVE
24
25 #include <sysdeps/unix/sysdep.h>
26
27 #ifdef  ASSEMBLER
28
29 #include <machine/pal.h>                /* get PAL_callsys */
30 #include <regdef.h>
31
32 #ifdef __STDC__
33 #define ENTRY(name) \
34   .globl name;                                                                \
35   .ent name,0;                                                                \
36   name##:;                                                                    \
37   .frame sp,0,ra
38 #else
39 #define ENTRY(name) \
40   .globl name;                                                                \
41   .ent name,0;                                                                \
42   name/**/:;                                                                  \
43   .frame sp,0,ra
44 #endif
45
46 #ifdef __STDC__
47 #define PSEUDO(name, syscall_name, args) \
48   ENTRY(name);                                                                \
49   ldiq v0, SYS_##syscall_name;                                                \
50   .set noat;                                                                  \
51   call_pal PAL_callsys;                                                       \
52   .set at;                                                                    \
53   beq a3, 10f;                                                                \
54   br gp, 20f;                                                                 \
55 20:;                                                                          \
56   ldgp gp, 0(gp);                                                             \
57   jmp zero, syscall_error;                                                    \
58 10:
59 #else
60 #define PSEUDO(name, syscall_name, args) \
61   ENTRY(name);                                                                \
62   ldiq v0, SYS_/**/syscall_name;                                              \
63   .set noat;                                                                  \
64   call_pal PAL_callsys;                                                       \
65   .set at;                                                                    \
66   beq a3, 10f;                                                                \
67   br gp, 20f;                                                                 \
68 20:;                                                                          \
69   ldgp gp, 0(gp);                                                             \
70   jmp zero, syscall_error;                                                    \
71 10:
72 #endif
73
74 #define ret             ret zero,(ra),1
75 #define r0              v0
76 #define r1              a4
77 #define MOVE(x,y)       mov x, y
78
79 #endif  /* ASSEMBLER */