xref: /original-bsd/sys/pmax/include/profile.h (revision 3705696b)
1 /*
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Ralph Campbell.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)profile.h	8.1 (Berkeley) 06/10/93
11  */
12 
13 #define	_MCOUNT_DECL static void __mcount
14 
15 #define	MCOUNT \
16 	asm(".globl _mcount;" \
17 	"_mcount:;" \
18 	".set noreorder;" \
19 	".set noat;" \
20 	"sw $4,8($29);" \
21 	"sw $5,12($29);" \
22 	"sw $6,16($29);" \
23 	"sw $7,20($29);" \
24 	"sw $1,0($29);" \
25 	"sw $31,4($29);" \
26 	"move $5,$31;" \
27 	"jal __mcount;" \
28 	"move $4,$1;" \
29 	"lw $4,8($29);" \
30 	"lw $5,12($29);" \
31 	"lw $6,16($29);" \
32 	"lw $7,20($29);" \
33 	"lw $31,4($29);" \
34 	"lw $1,0($29);" \
35 	"addu $29,$29,8;" \
36 	"j $31;" \
37 	"move $31,$1;" \
38 	".set reorder;" \
39 	".set at");
40 
41 #ifdef KERNEL
42 /*
43  * The following two macros do splhigh and splx respectively.
44  * They have to be defined this way because these are real
45  * functions on the PMAX, and we do not want to invoke mcount
46  * recursively.
47  */
48 #define	MCOUNT_ENTER	s = _splhigh()
49 
50 #define	MCOUNT_EXIT	_splx(s)
51 #endif /* KERNEL */
52