1 /* Machine-specific calling sequence for `mcount' profiling function. alpha
2 Copyright (C) 1995-2023 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 <https://www.gnu.org/licenses/>. */
19 /* Assembly stub to invoke _mcount(). Compiler generated code calls
20 this stub after executing a function's prologue and without saving any
21 registers. It is therefore necessary to preserve a0..a5 as they may
22 contain function arguments. To work correctly with frame- less
23 functions, it is also necessary to preserve ra. Finally, division
24 routines are invoked with a special calling convention and the
25 compiler treats those calls as if they were instructions. In
26 particular, it doesn't save any of the temporary registers (caller
27 saved registers). It is therefore necessary to preserve all
28 caller-saved registers as well.
30 Upon entering _mcount, register $at holds the return address and ra
31 holds the return address of the function's caller (selfpc and frompc,
32 respectively in gmon.c language...). */
43 mov ra, a0 # a0 = caller-pc
45 mov $at, a1 # a1 = self-pc
77 ldq $at, 0x10(sp) # restore self-pc
84 mov $at, pv # make pv point to return address
85 ldq t0, 0x48(sp) # this is important under OSF/1 to
86 ldq t1, 0x50(sp) # ensure that the code that we return
87 ldq t2, 0x58(sp) # can correctly compute its gp
104 weak_alias (_mcount, mcount)