OSDN Git Service

Ok, this commit is _huge_ and its gonna change the world. I've
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / sh / sysdep.h
1 /* Assembler macros for SH.
2    Copyright (C) 1999, 2000 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 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.
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    Library General Public License for more details.
14
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.  */
19
20 #define __need_uClibc_config_h 1
21 #include <bits/uClibc_config.h>
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 /* Mark the end of function named SYM.  This is used on some platforms
39    to generate correct debugging information.  */
40 #ifndef END
41 #define END(sym)
42 #endif
43
44 #ifndef ASM_GLOBAL_DIRECTIVE
45 #define ASM_GLOBAL_DIRECTIVE .global
46 #endif
47
48 #ifndef C_SYMBOL_NAME
49 #define C_SYMBOL_NAME(name)     name
50 #endif
51
52 #ifdef  __ASSEMBLER__
53
54 /* Syntactic details of assembler.  */
55
56 #ifdef __HAVE_ELF__
57
58 #define ALIGNARG(log2) log2
59 /* For ELF we need the `.type' directive to make shared libs work right.  */
60 #define ASM_TYPE_DIRECTIVE(name,typearg) .type name,@##typearg;
61 #define ASM_SIZE_DIRECTIVE(name) .size name,.-name
62
63 #ifdef SHARED
64 #define PLTJMP(_x)      _x##@PLT
65 #else
66 #define PLTJMP(_x)      _x
67 #endif
68
69 #else
70
71 #define ALIGNARG(log2) log2
72 #define ASM_TYPE_DIRECTIVE(name,type)   /* Nothing is specified.  */
73 #define ASM_SIZE_DIRECTIVE(name)        /* Nothing is specified.  */
74 #define C_SYMBOL_NAME(name) name        /* Nothing is specified.  */
75 #define PLTJMP(_x)      _x
76
77 #endif
78
79 /* Define an entry point visible from C.  */
80 #define ENTRY(name)                                                           \
81   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);                                   \
82   ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function)                           \
83   .align ALIGNARG(5);                                                         \
84   C_LABEL(name)                                                               \
85   CALL_MCOUNT
86
87 #undef  END
88 #define END(name)                                                             \
89   ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(name))
90
91 /* If compiled for profiling, call `mcount' at the start of each function.  */
92 #ifdef  PROF
93 #define CALL_MCOUNT     /* NOTYET */
94 #else
95 #define CALL_MCOUNT             /* Do nothing.  */
96 #endif
97
98 #ifdef  __NO_UNDERSCORES__
99 /* Since C identifiers are not normally prefixed with an underscore
100    on this system, the asm identifier `syscall_error' intrudes on the
101    C name space.  Make sure we use an innocuous name.  */
102 #define syscall_error   __syscall_error
103 #define mcount          _mcount
104 #endif
105
106 #endif  /* __ASSEMBLER__ */