xref: /original-bsd/sys/tahoe/include/profile.h (revision 60e1d6e0)
1 /*
2  * Copyright (c) 1992 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)profile.h	7.1 (Berkeley) 07/16/92
8  */
9 
10 #define	_MCOUNT_DECL static inline void _mcount
11 
12 #define	MCOUNT \
13 extern void mcount(cntpa) asm("mcount"); void mcount(cntpa) long **cntpa; { \
14 	int selfpc, frompcindex; \
15 	/* \
16 	 * Find the return address for mcount, \
17 	 * and address of counter pointer. \
18 	 */ \
19 	selfpc = *((char **)&cntpa-3);	/* -8(fp) */ \
20 	frompcindex = \
21 	    (unsigned short *)(*((((long *)*((char **)&cntpa-1)))-2)); \
22 	_mcount(frompcindex, selfpc); \
23 }
24