Add Changelog ...
[glibc.git] / sysdeps / m68k / sysdep.h
blob980cae5b846121d6fa1a2b27072f557af817cd18
1 /* Assembler macros for m68k.
2 Copyright (C) 1998, 2003, 2010, 2012 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
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.
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.
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/>. */
19 #include <sysdeps/generic/sysdep.h>
21 #ifdef __ASSEMBLER__
23 /* Syntactic details of assembler. */
25 /* ELF uses byte-counts for .align, most others use log2 of count of bytes. */
26 # define ALIGNARG(log2) 1<<log2
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 /* Define an entry point visible from C.
33 There is currently a bug in gdb which prevents us from specifying
34 incomplete stabs information. Fake some entries here which specify
35 the current source file. */
36 # define ENTRY(name) \
37 .globl C_SYMBOL_NAME(name); \
38 ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function); \
39 .align ALIGNARG(2); \
40 C_LABEL(name) \
41 cfi_startproc; \
42 CALL_MCOUNT
44 # undef END
45 # define END(name) \
46 cfi_endproc; \
47 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 move.l %fp, -(%sp); \
56 cfi_adjust_cfa_offset (4); cfi_rel_offset (%fp, 0); \
57 move.l %sp, %fp; \
58 jbsr JUMPTARGET (_mcount); \
59 move.l (%sp)+, %fp; \
60 cfi_adjust_cfa_offset (-4); cfi_restore (%fp);
61 # else
62 # define CALL_MCOUNT /* Do nothing. */
63 # endif
65 # define PSEUDO(name, syscall_name, args) \
66 .globl __syscall_error; \
67 ENTRY (name) \
68 DO_CALL (syscall_name, args); \
69 jcc JUMPTARGET(__syscall_error)
71 # undef PSEUDO_END
72 # define PSEUDO_END(name) \
73 END (name)
75 # undef JUMPTARGET
76 # ifdef PIC
77 # define JUMPTARGET(name) name##@PLTPC
78 # else
79 # define JUMPTARGET(name) name
80 # endif
82 #endif /* __ASSEMBLER__ */