155123Storek /* 255123Storek * Copyright (c) 1992 The Regents of the University of California. 355123Storek * All rights reserved. 455123Storek * 555123Storek * This software was developed by the Computer Systems Engineering group 655123Storek * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 755123Storek * contributed to Berkeley. 855123Storek * 9*55501Sbostic * All advertising materials mentioning features or use of this software 10*55501Sbostic * must display the following acknowledgement: 11*55501Sbostic * This product includes software developed by the University of 12*55501Sbostic * California, Lawrence Berkeley Laboratories. 13*55501Sbostic * 1455123Storek * %sccs.include.redist.c% 1555123Storek * 16*55501Sbostic * @(#)profile.h 7.2 (Berkeley) 07/21/92 1755123Storek * 1855123Storek * from: $Header: profile.h,v 1.7 92/07/09 01:34:21 mccanne Exp $ 1955123Storek */ 2055123Storek 2155123Storek #define MCOUNT \ 2255123Storek asm(".global mcount");\ 2355123Storek asm("mcount:");\ 2455123Storek asm("add %i7, 8, %o0");\ 2555123Storek asm("sethi %hi(__mcount), %o2");\ 2655123Storek asm("jmpl %o2 + %lo(__mcount), %g0");\ 2755123Storek asm("add %o7, 8, %o1"); 2855123Storek 2955123Storek #define _MCOUNT_DECL static void _mcount 3055123Storek 3155123Storek #ifdef KERNEL 3255123Storek /* 3355123Storek * Block interrupts during mcount so that those interrupts can also be 3455123Storek * counted (as soon as we get done with the current counting). On the 3555123Storek * SPARC, we just splhigh/splx as those do not recursively invoke mcount. 3655123Storek */ 3755123Storek #define MCOUNT_ENTER s = splhigh() 3855123Storek #define MCOUNT_EXIT splx(s) 3955123Storek #endif /* KERNEL */ 40