xref: /netbsd-src/sys/arch/hppa/include/profile.h (revision c1e4ee94bea7f4be2b1c86eefe5132d10cfdaff6)
1*c1e4ee94Sskrll /*	$NetBSD: profile.h,v 1.8 2007/11/12 12:58:11 skrll Exp $	*/
2f4f0d8a3Sfredette 
3f4f0d8a3Sfredette /*	$OpenBSD: profile.h,v 1.1 1998/12/05 17:25:55 mickey Exp $	*/
4f4f0d8a3Sfredette 
5f4f0d8a3Sfredette /*
6f4f0d8a3Sfredette  * Copyright (c) 1992, 1993
7f4f0d8a3Sfredette  *	The Regents of the University of California.  All rights reserved.
8f4f0d8a3Sfredette  *
9f4f0d8a3Sfredette  * Redistribution and use in source and binary forms, with or without
10f4f0d8a3Sfredette  * modification, are permitted provided that the following conditions
11f4f0d8a3Sfredette  * are met:
12f4f0d8a3Sfredette  * 1. Redistributions of source code must retain the above copyright
13f4f0d8a3Sfredette  *    notice, this list of conditions and the following disclaimer.
14f4f0d8a3Sfredette  * 2. Redistributions in binary form must reproduce the above copyright
15f4f0d8a3Sfredette  *    notice, this list of conditions and the following disclaimer in the
16f4f0d8a3Sfredette  *    documentation and/or other materials provided with the distribution.
17aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
18f4f0d8a3Sfredette  *    may be used to endorse or promote products derived from this software
19f4f0d8a3Sfredette  *    without specific prior written permission.
20f4f0d8a3Sfredette  *
21f4f0d8a3Sfredette  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22f4f0d8a3Sfredette  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23f4f0d8a3Sfredette  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24f4f0d8a3Sfredette  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25f4f0d8a3Sfredette  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26f4f0d8a3Sfredette  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27f4f0d8a3Sfredette  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28f4f0d8a3Sfredette  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29f4f0d8a3Sfredette  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30f4f0d8a3Sfredette  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31f4f0d8a3Sfredette  * SUCH DAMAGE.
32f4f0d8a3Sfredette  *
33f4f0d8a3Sfredette  *	@(#)profile.h	8.1 (Berkeley) 6/11/93
34f4f0d8a3Sfredette  */
35f4f0d8a3Sfredette 
36*c1e4ee94Sskrll #define	_MCOUNT_DECL	void _mcount
37*c1e4ee94Sskrll #define _MCOUNT_FUNC	mcount
38f4f0d8a3Sfredette 
39f4f0d8a3Sfredette #ifdef _KERNEL
40*c1e4ee94Sskrll #define	MCOUNT_ENTER			\
41*c1e4ee94Sskrll         __asm volatile (		\
42*c1e4ee94Sskrll 	    "mfctl %%eiem, %0\n\t"	\
43*c1e4ee94Sskrll 	    "mtctl %%r0, %%eiem"	\
44*c1e4ee94Sskrll 	    : "=r"(s) /* output */	\
45*c1e4ee94Sskrll 	    : /* no inputs */);
46*c1e4ee94Sskrll 
47*c1e4ee94Sskrll #define	MCOUNT_EXIT	\
48*c1e4ee94Sskrll 	__asm volatile("mtctl %0, %%eiem" : /* no outputs */ : "r" (s))
49*c1e4ee94Sskrll 
50f4f0d8a3Sfredette #endif /* _KERNEL */
51