2017-01-01 01:14:16 +01:00
|
|
|
/* Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
1996-03-19 20:53:15 +01:00
|
|
|
Contributed by David Mosberger (davidm@cs.arizona.edu).
|
1997-06-27 00:16:52 +02:00
|
|
|
This file is part of the GNU C Library.
|
1996-03-19 20:53:15 +01:00
|
|
|
|
1997-06-27 00:16:52 +02:00
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 06:56:23 +02:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
1996-03-19 20:53:15 +01:00
|
|
|
|
1997-06-27 00:16:52 +02:00
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 06:56:23 +02:00
|
|
|
Lesser General Public License for more details.
|
1996-03-19 20:53:15 +01:00
|
|
|
|
2001-07-06 06:56:23 +02:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-03-10 00:56:38 +01:00
|
|
|
License along with the GNU C Library. If not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
1996-03-19 20:53:15 +01:00
|
|
|
|
|
|
|
/* __bb_init_func is invoked at the beginning of each function, before
|
1997-06-27 00:16:52 +02:00
|
|
|
any registers have been saved. It is therefore safe to use any
|
|
|
|
caller-saved (call-used) registers (except for argument registers
|
|
|
|
a1-a5). */
|
1996-03-19 20:53:15 +01:00
|
|
|
|
|
|
|
#include <sysdep.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* These offsets should match with "struct bb" declared in gcc/libgcc2.c.
|
|
|
|
*/
|
|
|
|
#define ZERO_WORD 0x00
|
|
|
|
#define NEXT 0x20
|
|
|
|
|
|
|
|
.set noat
|
|
|
|
.set noreorder
|
|
|
|
|
|
|
|
ENTRY(__bb_init_func)
|
Wed May 22 00:40:50 1996 David Mosberger-Tang <davidm@azstarnet.com>
* sysdeps/alpha/_mcount.S, sysdeps/alpha/bb_init_func.S,
sysdeps/alpha/bsd-setjmp.S, sysdeps/alpha/ffs.S,
sysdeps/alpha/htonl.S, sysdeps/alpha/htons.S, sysdeps/alpha/memchr.S,
sysdeps/alpha/setjmp.S, sysdeps/alpha/strlen.S,
sysdeps/alpha/udiv_qrnnd.S, sysdeps/unix/sysv/linux/alpha/brk.S,
sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S,
sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S,
sysdeps/unix/sysv/linux/alpha/pipe.S,
sysdeps/unix/sysv/linux/sigsuspend.S,
sysdeps/unix/sysv/linux/alpha/syscall.S,
sysdeps/unix/sysv/linux/alpha/sysdep.S: Remove include of regdef.h.
sysdep.h includes it now. Replace ENTRY by LEAF with appropriate
framesize declaration. Replace "lda pv,sym/jsr pv" by "jsr sym".
1996-05-23 07:32:12 +02:00
|
|
|
.prologue 0
|
|
|
|
|
1996-03-19 20:53:15 +01:00
|
|
|
ldq t0, ZERO_WORD(a0) /* t0 <- blocks->zero_word */
|
|
|
|
beq t0, init /* not initialized yet -> */
|
|
|
|
ret
|
1996-08-08 02:35:28 +02:00
|
|
|
|
Wed May 29 00:57:37 1996 David Mosberger-Tang <davidm@azstarnet.com>
* sysdeps/alpha/_mcount.S, sysdeps/alpha/bb_init_func.S,
sysdeps/alpha/bsd-_setjmp.S, sysdeps/alpha/bsd-setjmp.S,
sysdeps/alpha/copysign.S, sysdeps/alpha/divrem.h,
sysdeps/alpha/fabs.S, sysdeps/alpha/ffs.S, sysdeps/alpha/htonl.S,
sysdeps/alpha/htons.S, sysdeps/alpha/memchr.S,
sysdeps/alpha/setjmp.S, sysdeps/alpha/strlen.S,
sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S,
sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S,
sysdeps/unix/sysv/linux/alpha/llseek.S,
sysdeps/unix/sysv/linux/alpha/pipe.S,
sysdeps/unix/sysv/linux/alpha/sigsuspend.S,
sysdeps/unix/sysv/linux/alpha/sysdep.S: Use END macro instead of
.end directive.
Tue May 28 10:46:04 1996 Richard Henderson <rth@tamu.edu>
* sysdeps/alpha/bb_init_func.S: Don't make `init' an external symbol.
1996-06-02 20:48:30 +02:00
|
|
|
END(__bb_init_func)
|
Wed May 22 00:40:50 1996 David Mosberger-Tang <davidm@azstarnet.com>
* sysdeps/alpha/_mcount.S, sysdeps/alpha/bb_init_func.S,
sysdeps/alpha/bsd-setjmp.S, sysdeps/alpha/ffs.S,
sysdeps/alpha/htonl.S, sysdeps/alpha/htons.S, sysdeps/alpha/memchr.S,
sysdeps/alpha/setjmp.S, sysdeps/alpha/strlen.S,
sysdeps/alpha/udiv_qrnnd.S, sysdeps/unix/sysv/linux/alpha/brk.S,
sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S,
sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S,
sysdeps/unix/sysv/linux/alpha/pipe.S,
sysdeps/unix/sysv/linux/sigsuspend.S,
sysdeps/unix/sysv/linux/alpha/syscall.S,
sysdeps/unix/sysv/linux/alpha/sysdep.S: Remove include of regdef.h.
sysdep.h includes it now. Replace ENTRY by LEAF with appropriate
framesize declaration. Replace "lda pv,sym/jsr pv" by "jsr sym".
1996-05-23 07:32:12 +02:00
|
|
|
|
1996-08-08 02:35:28 +02:00
|
|
|
.ent init
|
Wed May 29 00:57:37 1996 David Mosberger-Tang <davidm@azstarnet.com>
* sysdeps/alpha/_mcount.S, sysdeps/alpha/bb_init_func.S,
sysdeps/alpha/bsd-_setjmp.S, sysdeps/alpha/bsd-setjmp.S,
sysdeps/alpha/copysign.S, sysdeps/alpha/divrem.h,
sysdeps/alpha/fabs.S, sysdeps/alpha/ffs.S, sysdeps/alpha/htonl.S,
sysdeps/alpha/htons.S, sysdeps/alpha/memchr.S,
sysdeps/alpha/setjmp.S, sysdeps/alpha/strlen.S,
sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S,
sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S,
sysdeps/unix/sysv/linux/alpha/llseek.S,
sysdeps/unix/sysv/linux/alpha/pipe.S,
sysdeps/unix/sysv/linux/alpha/sigsuspend.S,
sysdeps/unix/sysv/linux/alpha/sysdep.S: Use END macro instead of
.end directive.
Tue May 28 10:46:04 1996 Richard Henderson <rth@tamu.edu>
* sysdeps/alpha/bb_init_func.S: Don't make `init' an external symbol.
1996-06-02 20:48:30 +02:00
|
|
|
init:
|
|
|
|
.frame sp, 0x38, ra, 0
|
Wed May 22 00:40:50 1996 David Mosberger-Tang <davidm@azstarnet.com>
* sysdeps/alpha/_mcount.S, sysdeps/alpha/bb_init_func.S,
sysdeps/alpha/bsd-setjmp.S, sysdeps/alpha/ffs.S,
sysdeps/alpha/htonl.S, sysdeps/alpha/htons.S, sysdeps/alpha/memchr.S,
sysdeps/alpha/setjmp.S, sysdeps/alpha/strlen.S,
sysdeps/alpha/udiv_qrnnd.S, sysdeps/unix/sysv/linux/alpha/brk.S,
sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S,
sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S,
sysdeps/unix/sysv/linux/alpha/pipe.S,
sysdeps/unix/sysv/linux/sigsuspend.S,
sysdeps/unix/sysv/linux/alpha/syscall.S,
sysdeps/unix/sysv/linux/alpha/sysdep.S: Remove include of regdef.h.
sysdep.h includes it now. Replace ENTRY by LEAF with appropriate
framesize declaration. Replace "lda pv,sym/jsr pv" by "jsr sym".
1996-05-23 07:32:12 +02:00
|
|
|
subq sp, 0x38, sp
|
|
|
|
.prologue 0
|
1996-03-19 20:53:15 +01:00
|
|
|
|
|
|
|
stq pv, 0x30(sp)
|
|
|
|
br pv, 1f
|
|
|
|
1: ldgp gp, 0(pv)
|
|
|
|
|
1996-06-19 08:38:49 +02:00
|
|
|
ldiq t1, __bb_head
|
1996-03-19 20:53:15 +01:00
|
|
|
lda t3, _gmonparam
|
|
|
|
ldq t2, 0(t1)
|
|
|
|
ldl t3, 0(t3) /* t3 = _gmonparam.state */
|
1996-06-19 08:38:49 +02:00
|
|
|
lda t0, 1
|
1996-03-19 20:53:15 +01:00
|
|
|
stq t0, ZERO_WORD(a0) /* blocks->zero_word = 1 */
|
|
|
|
stq t2, NEXT(a0) /* blocks->next = __bb_head */
|
|
|
|
stq a0, 0(t1)
|
1996-08-08 02:35:28 +02:00
|
|
|
bne t2, $leave
|
|
|
|
beq t3, $leave /* t3 == GMON_PROF_ON? yes -> */
|
1996-03-19 20:53:15 +01:00
|
|
|
|
|
|
|
/* also need to initialize destructor: */
|
|
|
|
stq ra, 0x00(sp)
|
|
|
|
lda a0, __bb_exit_func
|
|
|
|
stq a1, 0x08(sp)
|
|
|
|
lda pv, atexit
|
|
|
|
stq a2, 0x10(sp)
|
|
|
|
stq a3, 0x18(sp)
|
|
|
|
stq a4, 0x20(sp)
|
|
|
|
stq a5, 0x28(sp)
|
|
|
|
jsr ra, (pv), atexit
|
|
|
|
ldq ra, 0x00(sp)
|
|
|
|
ldq a1, 0x08(sp)
|
|
|
|
ldq a2, 0x10(sp)
|
|
|
|
ldq a3, 0x18(sp)
|
|
|
|
ldq a4, 0x20(sp)
|
|
|
|
ldq a5, 0x28(sp)
|
|
|
|
|
1996-08-08 02:35:28 +02:00
|
|
|
$leave: ldq pv, 0x30(sp)
|
1996-03-19 20:53:15 +01:00
|
|
|
addq sp, 0x38, sp
|
|
|
|
ret
|
Wed May 22 00:40:50 1996 David Mosberger-Tang <davidm@azstarnet.com>
* sysdeps/alpha/_mcount.S, sysdeps/alpha/bb_init_func.S,
sysdeps/alpha/bsd-setjmp.S, sysdeps/alpha/ffs.S,
sysdeps/alpha/htonl.S, sysdeps/alpha/htons.S, sysdeps/alpha/memchr.S,
sysdeps/alpha/setjmp.S, sysdeps/alpha/strlen.S,
sysdeps/alpha/udiv_qrnnd.S, sysdeps/unix/sysv/linux/alpha/brk.S,
sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S,
sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S,
sysdeps/unix/sysv/linux/alpha/pipe.S,
sysdeps/unix/sysv/linux/sigsuspend.S,
sysdeps/unix/sysv/linux/alpha/syscall.S,
sysdeps/unix/sysv/linux/alpha/sysdep.S: Remove include of regdef.h.
sysdep.h includes it now. Replace ENTRY by LEAF with appropriate
framesize declaration. Replace "lda pv,sym/jsr pv" by "jsr sym".
1996-05-23 07:32:12 +02:00
|
|
|
|
1996-08-08 02:35:28 +02:00
|
|
|
.end init
|