Update copyright notices with scripts/update-copyrights
[glibc.git] / ports / sysdeps / am33 / sysdep.h
blob70303e3277c26e21d48f2907cc79a8e547b51efb
1 /* Copyright 2001-2014 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Alexandre Oliva <aoliva@redhat.com>.
4 Based on ../i386/sysdep.h.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public License as
8 published by the Free Software Foundation; either version 2 of the
9 License, or (at your option) any later version.
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 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public
17 License along with the GNU C Library. If not, see
18 <http://www.gnu.org/licenses/>. */
20 #include <sysdeps/generic/sysdep.h>
22 #ifdef __ASSEMBLER__
24 /* Syntactic details of assembler. */
26 #ifdef HAVE_ELF
27 /* For ELF we need the `.type' directive to make shared libs work right. */
28 #define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg;
29 #define ASM_SIZE_DIRECTIVE(name) .size name,.-name;
31 /* In ELF C symbols are asm symbols. */
32 #undef NO_UNDERSCORES
33 #define NO_UNDERSCORES
34 #else
35 #define ASM_TYPE_DIRECTIVE(name,type) /* Nothing is specified. */
36 #define ASM_SIZE_DIRECTIVE(name) /* Nothing is specified. */
37 #endif
39 /* Define an entry point visible from C. */
40 #define ENTRY(name) \
41 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
42 ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
43 C_LABEL(name) \
44 CALL_MCOUNT
46 #undef END
47 #define END(name) \
48 ASM_SIZE_DIRECTIVE(name) \
50 /* If compiled for profiling, call `mcount' at the start of each function. */
51 #ifdef PROF
52 /* The mcount code relies on a normal frame pointer being on the stack
53 to locate our caller, so push one just for its benefit. */
54 #define CALL_MCOUNT \
55 movm [a3],(sp); mov sp,a3; add -12,sp; \
56 call JUMPTARGET(mcount),[],0; add 12,sp; movm (sp),[a3];
57 #else
58 #define CALL_MCOUNT /* Do nothing. */
59 #endif
61 #ifdef NO_UNDERSCORES
62 /* Since C identifiers are not normally prefixed with an underscore
63 on this system, the asm identifier `syscall_error' intrudes on the
64 C name space. Make sure we use an innocuous name. */
65 #define syscall_error __syscall_error
66 #define mcount _mcount
67 #endif
69 #undef JUMPTARGET
70 #ifdef PIC
71 #define JUMPTARGET(name) name##@PLT
72 #else
73 #define JUMPTARGET(name) name
74 #endif
76 /* Local label name for asm code. */
77 #ifndef L
78 #define L(name) name
79 #endif
81 #endif /* __ASSEMBLER__ */