Wed Feb 14 00:21:17 1996 David Mosberger-Tang <davidm@azstarnet.com>
[kopensolaris-gnu/glibc.git] / sysdeps / unix / alpha / sysdep.h
1 /* Copyright (C) 1992, 1995, 1996 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 #include <sysdeps/unix/sysdep.h>
20
21 #ifdef ASSEMBLER
22
23 #ifdef __STDC__
24 #define ENTRY(name)                             \
25   .globl name;                                  \
26   .align 3;                                     \
27   .ent name,0;                                  \
28   name##:                                       \
29   .frame sp,0,ra
30 #else
31 #define ENTRY(name)                             \
32   .globl name;                                  \
33   .align 3;                                     \
34   .ent name,0;                                  \
35   name/**/:                                     \
36   .frame sp,0,ra
37 #endif
38
39 /* Note that while it's better structurally, going back to set errno
40    can make things confusing if you're debugging---it looks like it's jumping
41    backwards into the previous fn.  */
42 #ifdef __STDC__
43 #define PSEUDO(name, syscall_name, args)        \
44     .globl name;                                \
45     .align 3;                                   \
46     .ent name,0;                                \
47                                                 \
48 1:  br          gp,2f;                          \
49 2:  ldgp        gp,0(gp);                       \
50     lda         pv,syscall_error;               \
51     jmp         zero,(pv);                      \
52                                                 \
53 name##:                                         \
54     ldi         v0,SYS_ify(syscall_name);       \
55     .set noat;                                  \
56     call_pal    PAL_callsys;                    \
57     .set at;                                    \
58     bne         a3,1b;                          \
59 3:
60 #else
61 #define PSEUDO(name, syscall_name, args)        \
62     .globl name;                                \
63     .align 3;                                   \
64     .ent name,0;                                \
65                                                 \
66 1:  br          gp,2f;                          \
67 2:  ldgp        gp,0(gp);                       \
68     lda         pv,syscall_error;               \
69     jmp         zero,(pv);                      \
70                                                 \
71 name/**/:                                       \
72     ldi         v0,SYS_ify(syscall_name);       \
73     .set noat;                                  \
74     call_pal    PAL_callsys;                    \
75     .set at;                                    \
76     bne         a3,1b;                          \
77 3:
78 #endif
79
80 #define ret     ret     zero,(ra),1
81 #define r0      v0
82 #define r1      a4
83
84 #define MOVE(x,y)       mov x,y
85
86 #endif