xref: /csrg-svn/sys/pmax/include/profile.h (revision 58281)
155711Sbostic /*
255711Sbostic  * Copyright (c) 1992 Regents of the University of California.
355711Sbostic  * All rights reserved.
455711Sbostic  *
555711Sbostic  * This code is derived from software contributed to Berkeley by
655711Sbostic  * Ralph Campbell.
755711Sbostic  *
855711Sbostic  * %sccs.include.redist.c%
955711Sbostic  *
10*58281Sralph  *	@(#)profile.h	7.3 (Berkeley) 02/26/93
1155711Sbostic  */
1255711Sbostic 
13*58281Sralph #define	_MCOUNT_DECL static void __mcount
1455711Sbostic 
1558130Sralph #define	MCOUNT \
16*58281Sralph 	asm(".globl _mcount;" \
17*58281Sralph 	"_mcount:;" \
18*58281Sralph 	".set noreorder;" \
19*58281Sralph 	".set noat;" \
20*58281Sralph 	"sw $4,8($29);" \
21*58281Sralph 	"sw $5,12($29);" \
22*58281Sralph 	"sw $6,16($29);" \
23*58281Sralph 	"sw $7,20($29);" \
24*58281Sralph 	"sw $1,0($29);" \
25*58281Sralph 	"sw $31,4($29);" \
26*58281Sralph 	"move $5,$31;" \
27*58281Sralph 	"jal __mcount;" \
28*58281Sralph 	"move $4,$1;" \
29*58281Sralph 	"lw $4,8($29);" \
30*58281Sralph 	"lw $5,12($29);" \
31*58281Sralph 	"lw $6,16($29);" \
32*58281Sralph 	"lw $7,20($29);" \
33*58281Sralph 	"lw $31,4($29);" \
34*58281Sralph 	"lw $1,0($29);" \
35*58281Sralph 	"addu $29,$29,8;" \
36*58281Sralph 	"j $31;" \
37*58281Sralph 	"move $31,$1;" \
38*58281Sralph 	".set reorder;" \
39*58281Sralph 	".set at");
4055711Sbostic 
4155711Sbostic #ifdef KERNEL
4255711Sbostic /*
4355711Sbostic  * The following two macros do splhigh and splx respectively.
4455711Sbostic  * They have to be defined this way because these are real
4555711Sbostic  * functions on the PMAX, and we do not want to invoke mcount
4655711Sbostic  * recursively.
4755711Sbostic  */
4855711Sbostic #define	MCOUNT_ENTER
4955711Sbostic 
5055711Sbostic #define	MCOUNT_EXIT
5155711Sbostic #endif /* KERNEL */
52