1 /* Copyright (C) 1996 Free Software Foundation, Inc.
2 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 Library General Public License as
8 published by the Free Software Foundation; either version 2 of the
9 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 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public
17 License along with the GNU C Library; see the file COPYING.LIB. If
18 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
19 Cambridge, MA 02139, USA. */
21 /* __bb_init_func is invoked at the beginning of each function, before
22 any registers have been saved. It is therefore safe to use any
23 caller-saved (call-used) registers (except for argument registers
29 * These offsets should match with "struct bb" declared in gcc/libgcc2.c.
31 #define ZERO_WORD 0x00
40 ldq t0, ZERO_WORD(a0) /* t0 <- blocks->zero_word */
41 beq t0, init /* not initialized yet -> */
48 .frame sp, 0x38, ra, 0
59 ldl t3, 0(t3) /* t3 = _gmonparam.state */
61 stq t0, ZERO_WORD(a0) /* blocks->zero_word = 1 */
62 stq t2, NEXT(a0) /* blocks->next = __bb_head */
65 beq t3, $leave /* t3 == GMON_PROF_ON? yes -> */
67 /* also need to initialize destructor: */
69 lda a0, __bb_exit_func
84 $leave: ldq pv, 0x30(sp)