1 /* Machine-specific calling sequence for `mcount' profiling function. alpha
2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
3 Contributed by David Mosberger (davidm@cs.arizona.edu).
4 This file is part of the GNU C Library.
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.
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.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 /* Assembly stub to invoke _mcount(). Compiler generated code calls
22 this stub after executing a function's prologue and without saving any
23 registers. It is therefore necessary to preserve a0..a5 as they may
24 contain function arguments. To work correctly with frame- less
25 functions, it is also necessary to preserve ra. Finally, division
26 routines are invoked with a special calling convention and the
27 compiler treats those calls as if they were instructions. In
28 particular, it doesn't save any of the temporary registers (caller
29 saved registers). It is therefore necessary to preserve all
30 caller-saved registers as well.
32 Upon entering _mcount, register $at holds the return address and ra
33 holds the return address of the function's caller (selfpc and frompc,
34 respectively in gmon.c language...). */
46 mov ra, a0 # a0 = caller-pc
48 mov $at, a1 # a1 = self-pc
80 ldq $at, 0x10(sp) # restore self-pc
87 mov $at, pv # make pv point to return address
88 ldq t0, 0x48(sp) # this is important under OSF/1 to
89 ldq t1, 0x50(sp) # ensure that the code that we return
90 ldq t2, 0x58(sp) # can correctly compute its gp
107 weak_alias (_mcount, mcount)