xref: /original-bsd/sys/hp300/include/profile.h (revision 3705696b)
1 /*
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)profile.h	8.1 (Berkeley) 06/10/93
8  */
9 
10 #define	_MCOUNT_DECL static inline void _mcount
11 
12 #define	MCOUNT \
13 extern void mcount() asm("mcount"); void mcount() { \
14 	int selfpc, frompcindex; \
15 	asm("movl a6@(4),%0" : "=r" (selfpc)); \
16 	asm("movl a6@(0)@(4),%0" : "=r" (frompcindex)); \
17 	_mcount(frompcindex, selfpc); \
18 }
19 
20 #ifdef KERNEL
21 /*
22  * The following two macros do splhigh and splx respectively.
23  * They have to be defined this way because these are real
24  * functions on the HP, and we do not want to invoke mcount
25  * recursively.
26  */
27 #define MCOUNT_ENTER \
28 	asm("movw	sr,%0" : "=g" (s)); \
29 	asm("movw	#0x2700,sr")
30 
31 #define MCOUNT_EXIT \
32 	asm("movw	%0,sr" : : "g" (s))
33 #endif /* KERNEL */
34