]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/alpha/sysdep.h
Mon Jun 10 17:50:31 1996 David Mosberger-Tang <davidm@azstarnet.com>
[thirdparty/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 __linux__
24 # include <alpha/regdef.h>
25 #else
26 # include <regdef.h>
27 #endif
28
29 #ifdef __STDC__
30 #define LEAF(name, framesize) \
31 .globl name; \
32 .align 3; \
33 .ent name, 0; \
34 name##: \
35 .frame sp, framesize, ra
36 #else
37 #define LEAF(name, framesize) \
38 .globl name; \
39 .align 3; \
40 .ent name, 0; \
41 name/**/: \
42 .frame sp, framesize, ra
43 #endif
44
45 #ifdef __STDC__
46 #define ENTRY(name) \
47 .globl name; \
48 .align 3; \
49 .ent name, 0; \
50 name##: \
51 .frame sp, 0, ra
52 #else
53 #define ENTRY(name) \
54 .globl name; \
55 .align 3; \
56 .ent name, 0; \
57 name/**/: \
58 .frame sp, 0, ra
59 #endif
60
61 /* Mark the end of function SYM. */
62 #undef END
63 #define END(sym) .end sym
64
65 /* Note that PSEUDO/PSEUDO_END use label number 1996---do not use a
66 label of that number between those two macros! */
67
68 #ifdef __STDC__
69 #define PSEUDO(name, syscall_name, args) \
70 .globl name; \
71 .align 3; \
72 .ent name,0; \
73 \
74 name##: \
75 .frame sp, 0, ra \
76 .prologue 1; /* yes, we do use gp */ \
77 ldiq v0, SYS_ify(syscall_name); \
78 .set noat; \
79 call_pal PAL_callsys; \
80 .set at; \
81 bne a3, 1996f; \
82 3:
83 #else
84 #define PSEUDO(name, syscall_name, args) \
85 .globl name; \
86 .align 3; \
87 .ent name,0; \
88 \
89 name/**/: \
90 .frame sp, 0, ra \
91 .prologue 1; /* yes, we do use gp */ \
92 ldiq v0, SYS_ify(syscall_name); \
93 .set noat; \
94 call_pal PAL_callsys; \
95 .set at; \
96 bne a3, 1996f; \
97 3:
98 #endif
99
100 #undef PSEUDO_END
101
102 #ifdef PIC
103 /* When building a shared library, we can use a branch since the text
104 section of the library is much smaller than 4MB. If we ever break
105 this assumption, the linker will tell us. */
106 # define PSEUDO_END(sym) \
107 1996: \
108 br zero, __syscall_error; \
109 END(sym)
110 #else
111 # define PSEUDO_END(sym) \
112 1996: \
113 br gp, 2f; \
114 2: ldgp gp, 0(gp); \
115 jmp zero, __syscall_error; \
116 END(sym)
117 #endif
118
119 #define r0 v0
120 #define r1 a4
121
122 #define MOVE(x,y) mov x,y
123
124 #endif