glibc/sysdeps/mips/machine-gmon.h

69 lines
2.2 KiB
C
Raw Normal View History

1997-06-21 02:02:21 +00:00
/* Machine-specific calling sequence for `mcount' profiling function. MIPS
Copyright (C) 1996, 1997, 2000, 2001, 2002 Free Software Foundation, Inc.
1997-06-21 02:02:21 +00:00
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
2001-07-06 04:56:23 +00: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.
1997-06-21 02:02:21 +00: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 04:56:23 +00:00
Lesser General Public License for more details.
1997-06-21 02:02:21 +00:00
2001-07-06 04:56:23 +00:00
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
1997-06-21 02:02:21 +00:00
#define _MCOUNT_DECL(frompc,selfpc) \
static void __attribute_used__ __mcount (u_long frompc, u_long selfpc)
1997-06-21 02:02:21 +00:00
/* Call __mcount with our the return PC for our caller,
and the return PC our caller will return to. */
2000-03-31 05:44:27 +00:00
#ifdef __PIC__
1997-06-21 02:02:21 +00:00
#define CPLOAD ".cpload $25;"
#define CPRESTORE ".cprestore 44\n\t"
1997-06-21 02:02:21 +00:00
#else
#define CPLOAD
#define CPRESTORE
1997-06-21 02:02:21 +00:00
#endif
#define MCOUNT asm(\
".globl _mcount;\n\t" \
".align 2;\n\t" \
".type _mcount,@function;\n\t" \
".ent _mcount\n\t" \
"_mcount:\n\t" \
".frame $sp,44,$31\n\t" \
".set noreorder;\n\t" \
".set noat;\n\t" \
1997-06-21 02:02:21 +00:00
CPLOAD \
"subu $29,$29,48;\n\t" \
CPRESTORE \
"sw $4,24($29);\n\t" \
"sw $5,28($29);\n\t" \
"sw $6,32($29);\n\t" \
"sw $7,36($29);\n\t" \
"sw $2,40($29);\n\t" \
"sw $1,16($29);\n\t" \
"sw $31,20($29);\n\t" \
"move $5,$31;\n\t" \
"move $4,$1;\n\t" \
"jal __mcount;\n\t" \
"nop;\n\t" \
"lw $4,24($29);\n\t" \
"lw $5,28($29);\n\t" \
"lw $6,32($29);\n\t" \
"lw $7,36($29);\n\t" \
"lw $2,40($29);\n\t" \
"lw $31,20($29);\n\t" \
"lw $1,16($29);\n\t" \
"addu $29,$29,56;\n\t" \
"j $31;\n\t" \
"move $31,$1;\n\t" \
".set reorder;\n\t" \
".set at\n\t" \
".end _mcount");