1 /* Copyright (C) 1996, 1997 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, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 /* __bb_init_func is invoked at the beginning of each function, before
21 any registers have been saved. It is therefore safe to use any
22 caller-saved (call-used) registers (except for argument registers
28 * These offsets should match with "struct bb" declared in gcc/libgcc2.c.
30 #define ZERO_WORD 0x00
39 ldq t0, ZERO_WORD(a0) /* t0 <- blocks->zero_word */
40 beq t0, init /* not initialized yet -> */
47 .frame sp, 0x38, ra, 0
58 ldl t3, 0(t3) /* t3 = _gmonparam.state */
60 stq t0, ZERO_WORD(a0) /* blocks->zero_word = 1 */
61 stq t2, NEXT(a0) /* blocks->next = __bb_head */
64 beq t3, $leave /* t3 == GMON_PROF_ON? yes -> */
66 /* also need to initialize destructor: */
68 lda a0, __bb_exit_func
83 $leave: ldq pv, 0x30(sp)