glibc/sysdeps/alpha/_mcount.S
Roland McGrath 510ca033d6 Wed May 22 00:40:50 1996 David Mosberger-Tang <davidm@azstarnet.com>
* sysdeps/unix/sysv/linux/alpha/speed.c (speeds): Add entry for
 	460800 baud.

	* sysdeps/unix/sysv/linux/alpha/statbuf.h: New file.

	* sysdeps/unix/sysv/linux/Makefile (headers): Add
 	alpha/ptrace.h.
	* sysdeps/unix/sysv/linux/alpha/alpha/ptrace.h: New file.

	* sysdeps/libm-ieee754/s_scalbnf.c: Call __scalbnf instead of
 	scalbnf.

	* sysdeps/generic/sigset.h (__sigismember, __sigaddset,
 	__sigdelset): Add declaration to keep ANSI compilers quiet.

	* sysdeps/alpha/__math.h (cabs): Remove underscores from struct
 	__cabs_complex member names in call to __hypot().

	* sysdeps/alpha/copysign.S, sysdeps/alpha/fabs.S: New files.

	* sysdeps/alpha/divrem.h: Renamed from sysdeps/alpha/divrem.S to avoid
 	name collision with math library.

	* sysdeps/alpha/divl.S, sysdeps/alpha/divlu.S, sysdeps/alpha/divq.S,
	sysdeps/alpha/divqu.S, sysdeps/alpha/reml.S, sysdeps/alpha/remlu.S,
	sysdeps/alpha/remq.S, sysdeps/alpha/remqu.S: Include divrem.h instead
	of divrem.S.

	* sysdeps/unix/alpha/sysdep.h: Include regdef.h.  Define LEAF macro
	to simplify declaration of leaf functions.

	* 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".

	* sysdeps/unix/sysv/linux/alpha/sysdep.h (NO_UNDERSCORES): Don't
	define.

	* sysdeps/unix/sysv/linux/alpha/syscalls.list: Added getsockopt,
	ptrace, and sysctl.

	* sysdeps/unix/sysv/linux/alpha/profil-counter.h: File removed.

	* sysdeps/unix/sysv/linux/alpha/ioperm.c: Modify to support
 	dynamic recognition of platform type.
	(_bus_base): New function.

	* sysdeps/unix/sysv/linux/alpha/llseek.S: New file.

	* sunrpc/rpc/rpc.h, sunrpc/rpc/svc.h: Avoid nested comments since
 	they produce ugly warnings by gcc.

	* posix/sys/types.h [__USE_MISC]: Add typedef for ulong.

Wed Mar 27 10:26:21 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* sysdeps/alpha/setjmp.S: Must establish global pointer before
 	address of __sigsetjmp_aux can be loaded.
1996-05-23 05:33:49 +00:00

110 lines
3.0 KiB
ArmAsm

/* Machine-specific calling sequence for `mcount' profiling function. alpha
Copyright (C) 1995 Free Software Foundation, Inc.
Contributed by David Mosberger (davidm@cs.arizona.edu).
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/* Assembly stub to invoke _mcount(). Compiler generated code calls
this stub after executing a function's prologue and without saving any
registers. It is therefore necessary to preserve a0..a5 as they may
contain function arguments. To work correctly with frame- less
functions, it is also necessary to preserve ra. Finally, division
routines are invoked with a special calling convention and the
compiler treats those calls as if they were instructions. In
particular, it doesn't save any of the temporary registers (caller
saved registers). It is therefore necessary to preserve all
caller-saved registers as well
Upon entering _mcount, register $at holds the return address and ra
holds the return address of the function's caller (selfpc and frompc,
respectively in gmon.c language...). */
#include <sysdep.h>
#undef ret /* discard `ret' as defined in sysdep.h */
.set noat
.set noreorder
LEAF(_mcount, 0xb0)
.prologue 0
subq sp, 0xb0, sp
stq a0, 0x00(sp)
mov ra, a0 # a0 = caller-pc
stq a1, 0x08(sp)
mov $at, a1 # a1 = self-pc
stq $at, 0x10(sp)
stq a2, 0x18(sp)
stq a3, 0x20(sp)
stq a4, 0x28(sp)
stq a5, 0x30(sp)
stq ra, 0x38(sp)
stq gp, 0x40(sp)
br gp, 1f
1: ldgp gp, 0(gp)
stq t0, 0x48(sp)
stq t1, 0x50(sp)
stq t2, 0x58(sp)
stq t3, 0x60(sp)
stq t4, 0x68(sp)
stq t5, 0x70(sp)
stq t6, 0x78(sp)
lda pv, __mcount
stq t7, 0x80(sp)
stq t8, 0x88(sp)
stq t9, 0x90(sp)
stq t10, 0x98(sp)
stq t11, 0xa0(sp)
stq v0, 0xa8(sp)
jsr ra, (pv), __mcount
ldq a0, 0x00(sp)
ldq a1, 0x08(sp)
ldq $at, 0x10(sp) # restore self-pc
ldq a2, 0x18(sp)
ldq a3, 0x20(sp)
ldq a4, 0x28(sp)
ldq a5, 0x30(sp)
ldq ra, 0x38(sp)
ldq gp, 0x40(sp)
mov $at, pv # make pv point to return address
ldq t0, 0x48(sp) # this is important under OSF/1 to
ldq t1, 0x50(sp) # ensure that the code that we return
ldq t2, 0x58(sp) # can correctly compute its gp
ldq t3, 0x60(sp)
ldq t4, 0x68(sp)
ldq t5, 0x70(sp)
ldq t6, 0x78(sp)
ldq t7, 0x80(sp)
ldq t8, 0x88(sp)
ldq t9, 0x90(sp)
ldq t10, 0x98(sp)
ldq t11, 0xa0(sp)
ldq v0, 0xa8(sp)
addq sp, 0xb0, sp
ret zero,($at),1
.end _mcount