]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/sh/_mcount.S
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / sh / _mcount.S
CommitLineData
2bfe5fd1 1/* Machine-specific calling sequence for `mcount' profiling function. SuperH
b168057a 2 Copyright (C) 2001-2015 Free Software Foundation, Inc.
2bfe5fd1
UD
3 Contributed by NIIBE Yutaka <gniibe@m17n.org>
4 This file is part of the GNU C Library.
5
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
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 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
59ba27a6
PE
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
2bfe5fd1
UD
19
20#include <sysdep.h>
21
7b8e0d49 22 .globl C_SYMBOL_NAME(_mcount)
b67e9372 23 .type C_SYMBOL_NAME(_mcount),@function
db0a00d3 24 cfi_startproc
2bfe5fd1
UD
25 .align 5
26C_LABEL(_mcount)
27 /* Save registers. */
28 mov.l r4,@-r15
db0a00d3
UD
29 cfi_adjust_cfa_offset (4)
30 cfi_rel_offset (r4, 0)
2bfe5fd1 31 mov.l r5,@-r15
db0a00d3
UD
32 cfi_adjust_cfa_offset (4)
33 cfi_rel_offset (r5, 0)
2bfe5fd1 34 mov.l r6,@-r15
db0a00d3
UD
35 cfi_adjust_cfa_offset (4)
36 cfi_rel_offset (r6, 0)
2bfe5fd1 37 mov.l r7,@-r15
db0a00d3
UD
38 cfi_adjust_cfa_offset (4)
39 cfi_rel_offset (r7, 0)
2bfe5fd1 40 sts.l pr,@-r15
db0a00d3
UD
41 cfi_adjust_cfa_offset (4)
42 cfi_rel_offset (pr, 0)
2bfe5fd1
UD
43
44 mov.l @(20,r15),r4
45 sts pr,r5
46
47#ifdef SHARED
48 mov.l 0f,r1
49 mova 0f,r0
50 add r1,r0
51 mov.l 1f,r1
52 mov.l @(r0,r1),r1
53#else
54 mov.l 1f,r1
55#endif
56 jsr @r1
57 nop
58
59 /* Pop the saved registers. */
60 lds.l @r15+,pr
65a4de4e
CLT
61 cfi_adjust_cfa_offset (-4)
62 cfi_restore (pr)
2bfe5fd1 63 mov.l @r15+,r7
65a4de4e
CLT
64 cfi_adjust_cfa_offset (-4)
65 cfi_restore (r7)
2bfe5fd1 66 mov.l @r15+,r6
65a4de4e
CLT
67 cfi_adjust_cfa_offset (-4)
68 cfi_restore (r6)
2bfe5fd1 69 mov.l @r15+,r5
65a4de4e
CLT
70 cfi_adjust_cfa_offset (-4)
71 cfi_restore (r5)
2bfe5fd1
UD
72 rts
73 mov.l @r15+,r4
65a4de4e 74 /* Omit CFI for restore in delay slot. */
2bfe5fd1
UD
75
76 .align 2
77#ifdef SHARED
780: .long _GLOBAL_OFFSET_TABLE_
791: .long C_SYMBOL_NAME(__mcount_internal)@GOT
80#else
811: .long C_SYMBOL_NAME(__mcount_internal)
82#endif
db0a00d3 83 cfi_endproc
2bfe5fd1
UD
84ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(_mcount))
85
86#undef mcount
87weak_alias (_mcount, mcount)