]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/generic/sysdep.h
Update.
[thirdparty/glibc.git] / sysdeps / generic / sysdep.h
CommitLineData
e75154a6 1/* Generic asm macros used on many machines.
29d9a17d 2 Copyright (C) 1991,92,93,96,98,2002,2003 Free Software Foundation, Inc.
2c6fe0bd 3 This file is part of the GNU C Library.
e75154a6 4
2c6fe0bd 5 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
e75154a6 9
2c6fe0bd
UD
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
41bdb6e2 13 Lesser General Public License for more details.
e75154a6 14
41bdb6e2
AJ
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
e75154a6
RM
19
20#ifndef C_LABEL
21
22/* Define a macro we can use to construct the asm name for a C symbol. */
23#ifdef NO_UNDERSCORES
24#ifdef __STDC__
25#define C_LABEL(name) name##:
26#else
27#define C_LABEL(name) name/**/:
28#endif
29#else
30#ifdef __STDC__
31#define C_LABEL(name) _##name##:
32#else
33#define C_LABEL(name) _/**/name/**/:
34#endif
35#endif
36
37#endif
6ed0492f 38
c2afe833 39#ifdef __ASSEMBLER__
6ed0492f
UD
40/* Mark the end of function named SYM. This is used on some platforms
41 to generate correct debugging information. */
2c6fe0bd 42#ifndef END
6ed0492f 43#define END(sym)
2c6fe0bd 44#endif
29d9a17d
UD
45
46#ifndef JUMPTARGET
47#define JUMPTARGET(sym) sym
48#endif
50189569
AJ
49
50/* Makros to generate eh_frame unwind information. */
51# ifdef HAVE_ASM_CFI_DIRECTIVES
f212e8dc
RH
52# define cfi_startproc .cfi_startproc
53# define cfi_endproc .cfi_endproc
54# define cfi_def_cfa(reg, off) .cfi_def_cfa reg, off
50189569
AJ
55# define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg
56# define cfi_def_cfa_offset(off) .cfi_def_cfa_offset off
57# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
f212e8dc 58# define cfi_offset(reg, off) .cfi_offset reg, off
a29f0509 59# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
f212e8dc
RH
60# define cfi_register(r1, r2) .cfi_register r1, r2
61# define cfi_return_column(reg) .cfi_return_column reg
62# define cfi_restore(reg) .cfi_restore reg
63# define cfi_undefined(reg) .cfi_undefined reg
64# define cfi_remember_state .cfi_remember_state
65# define cfi_restore_state .cfi_restore_state
50189569
AJ
66# else
67# define cfi_startproc
68# define cfi_endproc
69# define cfi_def_cfa(reg, off)
70# define cfi_def_cfa_register(reg)
71# define cfi_def_cfa_offset(off)
72# define cfi_adjust_cfa_offset(off)
73# define cfi_offset(reg, off)
a29f0509 74# define cfi_rel_offset(reg, off)
f212e8dc
RH
75# define cfi_register(r1, r2)
76# define cfi_return_column(reg)
77# define cfi_restore(reg)
78# define cfi_undefined(reg)
79# define cfi_remember_state
80# define cfi_restore_state
50189569
AJ
81# endif
82
2b1c0eea
AJ
83#else /* ! ASSEMBLER */
84# ifdef HAVE_ASM_CFI_DIRECTIVES
85# define CFI_STRINGIFY(Name) CFI_STRINGIFY2 (Name)
86# define CFI_STRINGIFY2(Name) #Name
87# define CFI_STARTPROC ".cfi_startproc"
88# define CFI_ENDPROC ".cfi_endproc"
89# define CFI_DEF_CFA(reg, off) \
90 ".cfi_def_cfa " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
91# define CFI_DEF_CFA_REGISTER(reg) \
92 ".cfi_def_cfa_register " CFI_STRINGIFY(reg)
93# define CFI_DEF_CFA_OFFSET(off) \
94 ".cfi_def_cfa_offset " CFI_STRINGIFY(off)
95# define CFI_ADJUST_CFA_OFFSET(off) \
96 ".cfi_adjust_cfa_offset " CFI_STRINGIFY(off)
97# define CFI_OFFSET(reg, off) \
98 ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
a29f0509
UD
99# define CFI_REL_OFFSET(reg, off) \
100 ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
f212e8dc
RH
101# define CFI_REGISTER(r1, r2) \
102 ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2)
103# define CFI_RETURN_COLUMN(reg) \
104 ".cfi_return_column " CFI_STRINGIFY(reg)
105# define CFI_RESTORE(reg) \
106 ".cfi_restore " CFI_STRINGIFY(reg)
107# define CFI_UNDEFINED(reg) \
108 ".cfi_undefined " CFI_STRINGIFY(reg)
109# define CFI_REMEMBER_STATE \
110 ".cfi_remember_state"
111# define CFI_RESTORE_STATE \
112 ".cfi_restore_state"
2b1c0eea
AJ
113# else
114# define CFI_STARTPROC
115# define CFI_ENDPROC
116# define CFI_DEF_CFA(reg, off)
117# define CFI_DEF_CFA_REGISTER(reg)
118# define CFI_DEF_CFA_OFFSET(off)
119# define CFI_ADJUST_CFA_OFFSET(off)
120# define CFI_OFFSET(reg, off)
a29f0509 121# define CFI_REL_OFFSET(reg, off)
f212e8dc
RH
122# define CFI_REGISTER(r1, r2)
123# define CFI_RETURN_COLUMN(reg)
124# define CFI_RESTORE(reg)
125# define CFI_UNDEFINED(reg)
126# define CFI_REMEMBER_STATE
127# define CFI_RESTORE_STATE
2b1c0eea 128# endif
50189569 129
c2afe833 130#endif /* __ASSEMBLER__ */