Update.
[glibc.git] / sysdeps / unix / alpha / sysdep.h
blobf43c7f8edf37a6d3d4b02a2e6c4c3a57180331d9
1 /* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Brendan Kehoe (brendan@zen.org).
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
20 #include <sysdeps/unix/sysdep.h>
22 #ifdef __ASSEMBLER__
24 #ifdef __linux__
25 # include <alpha/regdef.h>
26 #else
27 # include <regdef.h>
28 #endif
30 #ifdef __STDC__
31 #define __LABEL(x) x##:
32 #else
33 #define __LABEL(x) x/**/:
34 #endif
36 #define LEAF(name, framesize) \
37 .globl name; \
38 .align 3; \
39 .ent name, 0; \
40 __LABEL(name) \
41 .frame sp, framesize, ra
43 #define ENTRY(name) \
44 .globl name; \
45 .align 3; \
46 .ent name, 0; \
47 __LABEL(name) \
48 .frame sp, 0, ra
50 /* Mark the end of function SYM. */
51 #undef END
52 #define END(sym) .end sym
54 /* Note that PSEUDO/PSEUDO_END use label number 1996---do not use a
55 label of that number between those two macros! */
57 #ifdef PROF
58 #define PSEUDO(name, syscall_name, args) \
59 .globl name; \
60 .align 3; \
61 .ent name,0; \
62 __LABEL(name) \
63 .frame sp, 0, ra; \
64 ldgp gp,0(pv); \
65 .set noat; \
66 lda AT,_mcount; \
67 jsr AT,(AT),_mcount; \
68 .set at; \
69 .prologue 1; \
70 ldiq v0, SYS_ify(syscall_name); \
71 .set noat; \
72 call_pal PAL_callsys; \
73 .set at; \
74 bne a3, 1996f; \
76 #else
77 #define PSEUDO(name, syscall_name, args) \
78 .globl name; \
79 .align 3; \
80 .ent name,0; \
81 __LABEL(name) \
82 .frame sp, 0, ra \
83 .prologue 0; \
84 ldiq v0, SYS_ify(syscall_name); \
85 .set noat; \
86 call_pal PAL_callsys; \
87 .set at; \
88 bne a3, 1996f; \
90 #endif
92 #undef PSEUDO_END
93 #ifdef PROF
94 #define PSEUDO_END(sym) \
95 1996: \
96 jmp zero, __syscall_error; \
97 END(sym)
98 #else
99 #define PSEUDO_END(sym) \
100 1996: \
101 br gp, 2f; \
102 2: ldgp gp, 0(gp); \
103 jmp zero, __syscall_error; \
104 END(sym)
105 #endif
107 #define r0 v0
108 #define r1 a4
110 #define MOVE(x,y) mov x,y
112 #endif