Fix incomplete edit in last patch
[platform/upstream/glibc.git] / sysdeps / generic / sysdep.h
1 /* Generic asm macros used on many machines.
2    Copyright (C) 1991-1993,96,98,2002,2003,2009,2011
3    Free Software Foundation, Inc.
4    This file is part of the GNU C Library.
5
6    The GNU C Library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10
11    The GNU C Library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser General Public
17    License along with the GNU C Library; if not, write to the Free
18    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19    02111-1307 USA.  */
20
21 #ifndef C_LABEL
22
23 /* Define a macro we can use to construct the asm name for a C symbol.  */
24 # ifdef NO_UNDERSCORES
25 #  ifdef __STDC__
26 #   define C_LABEL(name)        name##:
27 #  else
28 #   define C_LABEL(name)        name/**/:
29 #  endif
30 # else
31 #  ifdef __STDC__
32 #   define C_LABEL(name)        _##name##:
33 #  else
34 #   define C_LABEL(name)        _/**/name/**/:
35 #  endif
36 # endif
37
38 #endif
39
40 #ifdef __ASSEMBLER__
41 /* Mark the end of function named SYM.  This is used on some platforms
42    to generate correct debugging information.  */
43 # ifndef END
44 #  define END(sym)
45 # endif
46
47 # ifndef JUMPTARGET
48 #  define JUMPTARGET(sym)       sym
49 # endif
50 #endif
51
52 /* Makros to generate eh_frame unwind information.  */
53 #ifdef HAVE_ASM_CFI_DIRECTIVES
54 # ifdef __ASSEMBLER__
55 #  define cfi_startproc                 .cfi_startproc
56 #  define cfi_endproc                   .cfi_endproc
57 #  define cfi_def_cfa(reg, off)         .cfi_def_cfa reg, off
58 #  define cfi_def_cfa_register(reg)     .cfi_def_cfa_register reg
59 #  define cfi_def_cfa_offset(off)       .cfi_def_cfa_offset off
60 #  define cfi_adjust_cfa_offset(off)    .cfi_adjust_cfa_offset off
61 #  define cfi_offset(reg, off)          .cfi_offset reg, off
62 #  define cfi_rel_offset(reg, off)      .cfi_rel_offset reg, off
63 #  define cfi_register(r1, r2)          .cfi_register r1, r2
64 #  define cfi_return_column(reg)        .cfi_return_column reg
65 #  define cfi_restore(reg)              .cfi_restore reg
66 #  define cfi_same_value(reg)           .cfi_same_value reg
67 #  define cfi_undefined(reg)            .cfi_undefined reg
68 #  define cfi_remember_state            .cfi_remember_state
69 #  define cfi_restore_state             .cfi_restore_state
70 #  define cfi_window_save               .cfi_window_save
71 #  define cfi_personality(enc, exp)     .cfi_personality enc, exp
72 #  define cfi_lsda(enc, exp)            .cfi_lsda enc, exp
73
74 # else /* ! ASSEMBLER */
75
76 #  define CFI_STRINGIFY(Name) CFI_STRINGIFY2 (Name)
77 #  define CFI_STRINGIFY2(Name) #Name
78 #  define CFI_STARTPROC ".cfi_startproc"
79 #  define CFI_ENDPROC   ".cfi_endproc"
80 #  define CFI_DEF_CFA(reg, off) \
81    ".cfi_def_cfa " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
82 #  define CFI_DEF_CFA_REGISTER(reg) \
83    ".cfi_def_cfa_register " CFI_STRINGIFY(reg)
84 #  define CFI_DEF_CFA_OFFSET(off) \
85    ".cfi_def_cfa_offset " CFI_STRINGIFY(off)
86 #  define CFI_ADJUST_CFA_OFFSET(off) \
87    ".cfi_adjust_cfa_offset " CFI_STRINGIFY(off)
88 #  define CFI_OFFSET(reg, off) \
89    ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
90 #  define CFI_REL_OFFSET(reg, off) \
91    ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
92 #  define CFI_REGISTER(r1, r2) \
93    ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2)
94 #  define CFI_RETURN_COLUMN(reg) \
95    ".cfi_return_column " CFI_STRINGIFY(reg)
96 #  define CFI_RESTORE(reg) \
97    ".cfi_restore " CFI_STRINGIFY(reg)
98 #  define CFI_UNDEFINED(reg) \
99    ".cfi_undefined " CFI_STRINGIFY(reg)
100 #  define CFI_REMEMBER_STATE \
101    ".cfi_remember_state"
102 #  define CFI_RESTORE_STATE \
103    ".cfi_restore_state"
104 #  define CFI_WINDOW_SAVE \
105    ".cfi_window_save"
106 #  define CFI_PERSONALITY(enc, exp) \
107    ".cfi_personality " CFI_STRINGIFY(enc) "," CFI_STRINGIFY(exp)
108 #  define CFI_LSDA(enc, exp) \
109    ".cfi_lsda " CFI_STRINGIFY(enc) "," CFI_STRINGIFY(exp)
110 # endif
111
112 #else
113
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)
121 # define CFI_REL_OFFSET(reg, off)
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
128 # define CFI_WINDOW_SAVE
129 # define CFI_PERSONALITY(enc, exp)
130 # define CFI_LSDA(enc, exp)
131 #endif
132
133 #include "dwarf2.h"