OSDN Git Service

Replace FSF snail mail address with URLs
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / common / sysdep.h
1 /* Generic asm macros used on many machines.
2    Copyright (C) 1991,92,93,96,98,2002,2003 Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
4
5    The GNU C Library is free software; you can redistribute it and/or
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.
9
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    Lesser General Public License for more details.
14
15    You should have received a copy of the GNU Lesser General Public
16    License along with the GNU C Library; if not, see
17    <http://www.gnu.org/licenses/>.  */
18
19 #include <sys/syscall.h>
20
21 #ifndef C_LABEL
22
23 /* Define a macro we can use to construct the asm name for a C symbol.  */
24 #ifndef __UCLIBC_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
51 /* Macros to generate eh_frame unwind information.  */
52 # ifdef HAVE_ASM_CFI_DIRECTIVES
53 #  define cfi_sections(sect...)         .cfi_sections sect
54 #  define cfi_startproc                 .cfi_startproc
55 #  define cfi_endproc                   .cfi_endproc
56 #  define cfi_def_cfa(reg, off)         .cfi_def_cfa reg, off
57 #  define cfi_def_cfa_register(reg)     .cfi_def_cfa_register reg
58 #  define cfi_def_cfa_offset(off)       .cfi_def_cfa_offset off
59 #  define cfi_adjust_cfa_offset(off)    .cfi_adjust_cfa_offset off
60 #  define cfi_offset(reg, off)          .cfi_offset reg, off
61 #  define cfi_rel_offset(reg, off)      .cfi_rel_offset reg, off
62 #  define cfi_register(r1, r2)          .cfi_register r1, r2
63 #  define cfi_return_column(reg)        .cfi_return_column reg
64 #  define cfi_restore(reg)              .cfi_restore reg
65 #  define cfi_same_value(reg)           .cfi_same_value reg
66 #  define cfi_undefined(reg)            .cfi_undefined reg
67 #  define cfi_remember_state            .cfi_remember_state
68 #  define cfi_restore_state             .cfi_restore_state
69 #  define cfi_window_save               .cfi_window_save
70 #  define cfi_personality(enc, exp)     .cfi_personality enc, exp
71 #  define cfi_lsda(enc, exp)            .cfi_lsda enc, exp
72
73 # else
74 #  define cfi_sections(sect...)
75 #  define cfi_startproc
76 #  define cfi_endproc
77 #  define cfi_def_cfa(reg, off)
78 #  define cfi_def_cfa_register(reg)
79 #  define cfi_def_cfa_offset(off)
80 #  define cfi_adjust_cfa_offset(off)
81 #  define cfi_offset(reg, off)
82 #  define cfi_rel_offset(reg, off)
83 #  define cfi_register(r1, r2)
84 #  define cfi_return_column(reg)
85 #  define cfi_restore(reg)
86 #  define cfi_same_value(reg)
87 #  define cfi_undefined(reg)
88 #  define cfi_remember_state
89 #  define cfi_restore_state
90 #  define cfi_window_save
91 #  define cfi_personality(enc, exp)
92 #  define cfi_lsda(enc, exp)
93 # endif
94
95 #else /* ! ASSEMBLER */
96 # ifdef HAVE_ASM_CFI_DIRECTIVES
97 #  define CFI_STRINGIFY(Name) CFI_STRINGIFY2 (Name)
98 #  define CFI_STRINGIFY2(Name) #Name
99 #  define CFI_SECTIONS(sect...) \
100    ".cfi_sections " CFI_STRINGIFY(sect)
101 #  define CFI_STARTPROC ".cfi_startproc"
102 #  define CFI_ENDPROC   ".cfi_endproc"
103 #  define CFI_DEF_CFA(reg, off) \
104    ".cfi_def_cfa " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
105 #  define CFI_DEF_CFA_REGISTER(reg) \
106    ".cfi_def_cfa_register " CFI_STRINGIFY(reg)
107 #  define CFI_DEF_CFA_OFFSET(off) \
108    ".cfi_def_cfa_offset " CFI_STRINGIFY(off)
109 #  define CFI_ADJUST_CFA_OFFSET(off) \
110    ".cfi_adjust_cfa_offset " CFI_STRINGIFY(off)
111 #  define CFI_OFFSET(reg, off) \
112    ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
113 #  define CFI_REL_OFFSET(reg, off) \
114    ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
115 #  define CFI_REGISTER(r1, r2) \
116    ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2)
117 #  define CFI_RETURN_COLUMN(reg) \
118    ".cfi_return_column " CFI_STRINGIFY(reg)
119 #  define CFI_RESTORE(reg) \
120    ".cfi_restore " CFI_STRINGIFY(reg)
121 #  define CFI_UNDEFINED(reg) \
122    ".cfi_undefined " CFI_STRINGIFY(reg)
123 #  define CFI_REMEMBER_STATE \
124    ".cfi_remember_state"
125 #  define CFI_RESTORE_STATE \
126    ".cfi_restore_state"
127 #  define CFI_WINDOW_SAVE \
128    ".cfi_window_save"
129 #  define CFI_PERSONALITY(enc, exp) \
130    ".cfi_personality " CFI_STRINGIFY(enc) "," CFI_STRINGIFY(exp)
131 #  define CFI_LSDA(enc, exp) \
132    ".cfi_lsda " CFI_STRINGIFY(enc) "," CFI_STRINGIFY(exp)
133 # else
134 #  define CFI_SECTIONS(sect...)
135 #  define CFI_STARTPROC
136 #  define CFI_ENDPROC
137 #  define CFI_DEF_CFA(reg, off)
138 #  define CFI_DEF_CFA_REGISTER(reg)
139 #  define CFI_DEF_CFA_OFFSET(off)
140 #  define CFI_ADJUST_CFA_OFFSET(off)
141 #  define CFI_OFFSET(reg, off)
142 #  define CFI_REL_OFFSET(reg, off)
143 #  define CFI_REGISTER(r1, r2)
144 #  define CFI_RETURN_COLUMN(reg)
145 #  define CFI_RESTORE(reg)
146 #  define CFI_UNDEFINED(reg)
147 #  define CFI_REMEMBER_STATE
148 #  define CFI_RESTORE_STATE
149 #  define CFI_WINDOW_SAVE
150 #  define CFI_PERSONALITY(enc, exp)
151 #  define CFI_LSDA(enc, exp)
152 # endif
153
154 #endif /* __ASSEMBLER__ */
155
156 /* Values used for encoding parameter of cfi_personality and cfi_lsda.  */
157 #define DW_EH_PE_absptr         0x00
158 #define DW_EH_PE_omit           0xff
159 #define DW_EH_PE_uleb128        0x01
160 #define DW_EH_PE_udata2         0x02
161 #define DW_EH_PE_udata4         0x03
162 #define DW_EH_PE_udata8         0x04
163 #define DW_EH_PE_sleb128        0x09
164 #define DW_EH_PE_sdata2         0x0a
165 #define DW_EH_PE_sdata4         0x0b
166 #define DW_EH_PE_sdata8         0x0c
167 #define DW_EH_PE_signed         0x08
168 #define DW_EH_PE_pcrel          0x10
169 #define DW_EH_PE_textrel        0x20
170 #define DW_EH_PE_datarel        0x30
171 #define DW_EH_PE_funcrel        0x40
172 #define DW_EH_PE_aligned        0x50
173 #define DW_EH_PE_indirect       0x80
174