1 /* Copyright (C) 1996-2015 Free Software Foundation, Inc.
2 Contributed by David Mosberger (davidm@cs.arizona.edu).
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 /* __bb_init_func is invoked at the beginning of each function, before
20 any registers have been saved. It is therefore safe to use any
21 caller-saved (call-used) registers (except for argument registers
27 * These offsets should match with "struct bb" declared in gcc/libgcc2.c.
29 #define ZERO_WORD 0x00
38 ldq t0, ZERO_WORD(a0) /* t0 <- blocks->zero_word */
39 beq t0, init /* not initialized yet -> */
46 .frame sp, 0x38, ra, 0
57 ldl t3, 0(t3) /* t3 = _gmonparam.state */
59 stq t0, ZERO_WORD(a0) /* blocks->zero_word = 1 */
60 stq t2, NEXT(a0) /* blocks->next = __bb_head */
63 beq t3, $leave /* t3 == GMON_PROF_ON? yes -> */
65 /* also need to initialize destructor: */
67 lda a0, __bb_exit_func
82 $leave: ldq pv, 0x30(sp)