2 * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
5 * Author: Chris G. Demetriou
7 * Permission to use, copy, modify and distribute this software and
8 * its documentation is hereby granted, provided that both the copyright
9 * notice and this permission notice appear in all copies of the
10 * software, derivative works or modified versions, and any portions
11 * thereof, and that both notices appear in supporting documentation.
13 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
14 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
15 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 * Carnegie Mellon requests users of this software to return to
19 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
20 * School of Computer Science
21 * Carnegie Mellon University
22 * Pittsburgh PA 15213-3890
24 * any improvements or extensions that they make and grant Carnegie the
25 * rights to redistribute these changes.
27 * from: NetBSD: profile.h,v 1.9 1997/04/06 08:47:37 cgd Exp
28 * from: FreeBSD: src/sys/alpha/include/profile.h,v 1.4 1999/12/29
32 #ifndef _MACHINE_PROFILE_H_
33 #define _MACHINE_PROFILE_H_
35 #if !defined(_KERNEL) && !defined(_SYS_CDEFS_H_)
36 #error this file needs sys/cdefs.h as a prerequisite
39 #define FUNCTION_ALIGNMENT 32
41 typedef u_long fptrdiff_t;
45 #include <machine/cpufunc.h>
47 #define _MCOUNT_DECL void mcount
50 #define MCOUNT_DECL(s) register_t s;
51 #define MCOUNT_ENTER(s) {s = intr_disable(); }
52 #define MCOUNT_EXIT(s) {intr_restore(s); }
59 #define MCOUNT_FROMPC_USER(pc) \
60 ((pc < (uintfptr_t)VM_MAXUSER_ADDRESS) ? (uintfptr_t)user : pc)
62 #define MCOUNT_FROMPC_INTR(pc) \
63 ((pc >= (uintfptr_t)btrap && pc < (uintfptr_t)eintr) ? \
64 ((pc >= (uintfptr_t)bintr) ? (uintfptr_t)bintr : \
65 (uintfptr_t)btrap) : ~0UL)
67 void mcount(uintfptr_t frompc, uintfptr_t selfpc);
71 typedef unsigned long long uintfptr_t;
73 #define _MCOUNT_DECL void mcount
78 #endif /* !_MACHINE_PROFILE_H_ */