1*55123Storek /* 2*55123Storek * Copyright (c) 1992 The Regents of the University of California. 3*55123Storek * All rights reserved. 4*55123Storek * 5*55123Storek * This software was developed by the Computer Systems Engineering group 6*55123Storek * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 7*55123Storek * contributed to Berkeley. 8*55123Storek * 9*55123Storek * %sccs.include.redist.c% 10*55123Storek * 11*55123Storek * @(#)profile.h 7.1 (Berkeley) 07/13/92 12*55123Storek * 13*55123Storek * from: $Header: profile.h,v 1.7 92/07/09 01:34:21 mccanne Exp $ 14*55123Storek */ 15*55123Storek 16*55123Storek #define MCOUNT \ 17*55123Storek asm(".global mcount");\ 18*55123Storek asm("mcount:");\ 19*55123Storek asm("add %i7, 8, %o0");\ 20*55123Storek asm("sethi %hi(__mcount), %o2");\ 21*55123Storek asm("jmpl %o2 + %lo(__mcount), %g0");\ 22*55123Storek asm("add %o7, 8, %o1"); 23*55123Storek 24*55123Storek #define _MCOUNT_DECL static void _mcount 25*55123Storek 26*55123Storek #ifdef KERNEL 27*55123Storek /* 28*55123Storek * Block interrupts during mcount so that those interrupts can also be 29*55123Storek * counted (as soon as we get done with the current counting). On the 30*55123Storek * SPARC, we just splhigh/splx as those do not recursively invoke mcount. 31*55123Storek */ 32*55123Storek #define MCOUNT_ENTER s = splhigh() 33*55123Storek #define MCOUNT_EXIT splx(s) 34*55123Storek #endif /* KERNEL */ 35