xref: /original-bsd/sys/sparc/include/profile.h (revision ac773626)
1 /*
2  * Copyright (c) 1992 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This software was developed by the Computer Systems Engineering group
6  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
7  * contributed to Berkeley.
8  *
9  * All advertising materials mentioning features or use of this software
10  * must display the following acknowledgement:
11  *	This product includes software developed by the University of
12  *	California, Lawrence Berkeley Laboratory.
13  *
14  * %sccs.include.redist.c%
15  *
16  *	@(#)profile.h	7.3 (Berkeley) 04/20/93
17  *
18  * from: $Header: profile.h,v 1.8 92/11/26 02:04:41 torek Exp $
19  */
20 
21 #define MCOUNT \
22         asm(".global mcount");\
23         asm("mcount:");\
24         asm("add %i7, 8, %o0");\
25         asm("sethi %hi(__mcount), %o2");\
26         asm("jmpl %o2 + %lo(__mcount), %g0");\
27         asm("add %o7, 8, %o1");
28 
29 #define	_MCOUNT_DECL	static void _mcount
30 
31 #ifdef KERNEL
32 /*
33  * Block interrupts during mcount so that those interrupts can also be
34  * counted (as soon as we get done with the current counting).  On the
35  * SPARC, we just splhigh/splx as those do not recursively invoke mcount.
36  */
37 #define	MCOUNT_ENTER	s = splhigh()
38 #define	MCOUNT_EXIT	splx(s)
39 #endif /* KERNEL */
40