Back to index

glibc  2.9
sysdep.h
Go to the documentation of this file.
00001 /* Generic asm macros used on many machines.
00002    Copyright (C) 1991,92,93,96,98,2002,2003 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef C_LABEL
00021 
00022 /* Define a macro we can use to construct the asm name for a C symbol.  */
00023 #ifdef NO_UNDERSCORES
00024 #ifdef __STDC__
00025 #define C_LABEL(name)              name##:
00026 #else
00027 #define C_LABEL(name)              name:
00028 #endif
00029 #else
00030 #ifdef __STDC__
00031 #define C_LABEL(name)              _##name##:
00032 #else
00033 #define C_LABEL(name)              _name:
00034 #endif
00035 #endif
00036 
00037 #endif
00038 
00039 #ifdef __ASSEMBLER__
00040 /* Mark the end of function named SYM.  This is used on some platforms
00041    to generate correct debugging information.  */
00042 #ifndef END
00043 #define END(sym)
00044 #endif
00045 
00046 #ifndef JUMPTARGET
00047 #define JUMPTARGET(sym)            sym
00048 #endif
00049 
00050 /* Makros to generate eh_frame unwind information.  */
00051 # ifdef HAVE_ASM_CFI_DIRECTIVES
00052 #  define cfi_startproc                   .cfi_startproc
00053 #  define cfi_endproc                     .cfi_endproc
00054 #  define cfi_def_cfa(reg, off)           .cfi_def_cfa reg, off
00055 #  define cfi_def_cfa_register(reg)       .cfi_def_cfa_register reg
00056 #  define cfi_def_cfa_offset(off)  .cfi_def_cfa_offset off
00057 #  define cfi_adjust_cfa_offset(off)      .cfi_adjust_cfa_offset off
00058 #  define cfi_offset(reg, off)            .cfi_offset reg, off
00059 #  define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
00060 #  define cfi_register(r1, r2)            .cfi_register r1, r2
00061 #  define cfi_return_column(reg)   .cfi_return_column reg
00062 #  define cfi_restore(reg)         .cfi_restore reg
00063 #  define cfi_same_value(reg)             .cfi_same_value reg
00064 #  define cfi_undefined(reg)              .cfi_undefined reg
00065 #  define cfi_remember_state              .cfi_remember_state
00066 #  define cfi_restore_state        .cfi_restore_state
00067 #  define cfi_window_save          .cfi_window_save
00068 # else
00069 #  define cfi_startproc
00070 #  define cfi_endproc
00071 #  define cfi_def_cfa(reg, off)
00072 #  define cfi_def_cfa_register(reg)
00073 #  define cfi_def_cfa_offset(off)
00074 #  define cfi_adjust_cfa_offset(off)
00075 #  define cfi_offset(reg, off)
00076 #  define cfi_rel_offset(reg, off)
00077 #  define cfi_register(r1, r2)
00078 #  define cfi_return_column(reg)
00079 #  define cfi_restore(reg)
00080 #  define cfi_same_value(reg)
00081 #  define cfi_undefined(reg)
00082 #  define cfi_remember_state
00083 #  define cfi_restore_state
00084 #  define cfi_window_save
00085 # endif
00086 
00087 #else /* ! ASSEMBLER */
00088 # ifdef HAVE_ASM_CFI_DIRECTIVES
00089 #  define CFI_STRINGIFY(Name) CFI_STRINGIFY2 (Name)
00090 #  define CFI_STRINGIFY2(Name) #Name
00091 #  define CFI_STARTPROC     ".cfi_startproc"
00092 #  define CFI_ENDPROC       ".cfi_endproc"
00093 #  define CFI_DEF_CFA(reg, off)    \
00094    ".cfi_def_cfa " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
00095 #  define CFI_DEF_CFA_REGISTER(reg) \
00096    ".cfi_def_cfa_register " CFI_STRINGIFY(reg)
00097 #  define CFI_DEF_CFA_OFFSET(off) \
00098    ".cfi_def_cfa_offset " CFI_STRINGIFY(off)
00099 #  define CFI_ADJUST_CFA_OFFSET(off) \
00100    ".cfi_adjust_cfa_offset " CFI_STRINGIFY(off)
00101 #  define CFI_OFFSET(reg, off) \
00102    ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
00103 #  define CFI_REL_OFFSET(reg, off) \
00104    ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
00105 #  define CFI_REGISTER(r1, r2) \
00106    ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2)
00107 #  define CFI_RETURN_COLUMN(reg) \
00108    ".cfi_return_column " CFI_STRINGIFY(reg)
00109 #  define CFI_RESTORE(reg) \
00110    ".cfi_restore " CFI_STRINGIFY(reg)
00111 #  define CFI_UNDEFINED(reg) \
00112    ".cfi_undefined " CFI_STRINGIFY(reg)
00113 #  define CFI_REMEMBER_STATE \
00114    ".cfi_remember_state"
00115 #  define CFI_RESTORE_STATE \
00116    ".cfi_restore_state"
00117 #  define CFI_WINDOW_SAVE \
00118    ".cfi_window_save"
00119 # else
00120 #  define CFI_STARTPROC
00121 #  define CFI_ENDPROC
00122 #  define CFI_DEF_CFA(reg, off)
00123 #  define CFI_DEF_CFA_REGISTER(reg)
00124 #  define CFI_DEF_CFA_OFFSET(off)
00125 #  define CFI_ADJUST_CFA_OFFSET(off)
00126 #  define CFI_OFFSET(reg, off)
00127 #  define CFI_REL_OFFSET(reg, off)
00128 #  define CFI_REGISTER(r1, r2)
00129 #  define CFI_RETURN_COLUMN(reg)
00130 #  define CFI_RESTORE(reg)
00131 #  define CFI_UNDEFINED(reg)
00132 #  define CFI_REMEMBER_STATE
00133 #  define CFI_RESTORE_STATE
00134 #  define CFI_WINDOW_SAVE
00135 # endif
00136 
00137 #endif /* __ASSEMBLER__ */