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 * %sccs.include.redist.c% 10 * 11 * @(#)profile.h 7.1 (Berkeley) 07/13/92 12 * 13 * from: $Header: profile.h,v 1.7 92/07/09 01:34:21 mccanne Exp $ 14 */ 15 16 #define MCOUNT \ 17 asm(".global mcount");\ 18 asm("mcount:");\ 19 asm("add %i7, 8, %o0");\ 20 asm("sethi %hi(__mcount), %o2");\ 21 asm("jmpl %o2 + %lo(__mcount), %g0");\ 22 asm("add %o7, 8, %o1"); 23 24 #define _MCOUNT_DECL static void _mcount 25 26 #ifdef KERNEL 27 /* 28 * Block interrupts during mcount so that those interrupts can also be 29 * counted (as soon as we get done with the current counting). On the 30 * SPARC, we just splhigh/splx as those do not recursively invoke mcount. 31 */ 32 #define MCOUNT_ENTER s = splhigh() 33 #define MCOUNT_EXIT splx(s) 34 #endif /* KERNEL */ 35