]>
Commit | Line | Data |
---|---|---|
b20e47cb RM |
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 | ||
510ca033 RM |
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 | ||
b20e47cb RM |
45 | #ifdef __STDC__ |
46 | #define ENTRY(name) \ | |
47 | .globl name; \ | |
48 | .align 3; \ | |
510ca033 | 49 | .ent name, 0; \ |
b20e47cb | 50 | name##: \ |
510ca033 | 51 | .frame sp, 0, ra |
b20e47cb RM |
52 | #else |
53 | #define ENTRY(name) \ | |
54 | .globl name; \ | |
55 | .align 3; \ | |
510ca033 | 56 | .ent name, 0; \ |
b20e47cb | 57 | name/**/: \ |
510ca033 | 58 | .frame sp, 0, ra |
b20e47cb RM |
59 | #endif |
60 | ||
a1470b6f RM |
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 | ||
b20e47cb RM |
68 | #ifdef __STDC__ |
69 | #define PSEUDO(name, syscall_name, args) \ | |
70 | .globl name; \ | |
71 | .align 3; \ | |
72 | .ent name,0; \ | |
73 | \ | |
b20e47cb | 74 | name##: \ |
a1470b6f RM |
75 | .frame sp, 0, ra \ |
76 | .prologue 1; /* yes, we do use gp */ \ | |
77 | ldiq v0, SYS_ify(syscall_name); \ | |
b20e47cb RM |
78 | .set noat; \ |
79 | call_pal PAL_callsys; \ | |
80 | .set at; \ | |
a1470b6f | 81 | bne a3, 1996f; \ |
b20e47cb RM |
82 | 3: |
83 | #else | |
84 | #define PSEUDO(name, syscall_name, args) \ | |
85 | .globl name; \ | |
86 | .align 3; \ | |
87 | .ent name,0; \ | |
88 | \ | |
b20e47cb | 89 | name/**/: \ |
a1470b6f RM |
90 | .frame sp, 0, ra \ |
91 | .prologue 1; /* yes, we do use gp */ \ | |
92 | ldiq v0, SYS_ify(syscall_name); \ | |
b20e47cb RM |
93 | .set noat; \ |
94 | call_pal PAL_callsys; \ | |
95 | .set at; \ | |
a1470b6f | 96 | bne a3, 1996f; \ |
b20e47cb RM |
97 | 3: |
98 | #endif | |
99 | ||
a1470b6f RM |
100 | #undef PSEUDO_END |
101 | ||
3776d592 | 102 | #define PSEUDO_END(sym) \ |
a1470b6f RM |
103 | 1996: \ |
104 | br gp, 2f; \ | |
105 | 2: ldgp gp, 0(gp); \ | |
106 | jmp zero, __syscall_error; \ | |
107 | END(sym) | |
84724245 | 108 | |
b20e47cb RM |
109 | #define r0 v0 |
110 | #define r1 a4 | |
111 | ||
112 | #define MOVE(x,y) mov x,y | |
113 | ||
114 | #endif |