summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/profile.h
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1996-08-28 20:15:32 +0000
committerbde <bde@FreeBSD.org>1996-08-28 20:15:32 +0000
commitdc064fbaf3e7a79fe80c06259fbf0ffed69bb936 (patch)
tree65451cc1b368594d593c24934e438019b440be70 /sys/amd64/include/profile.h
parentf79b9d498c61f152a80a65d2fc786f75c74aac4a (diff)
downloadFreeBSD-src-dc064fbaf3e7a79fe80c06259fbf0ffed69bb936.zip
FreeBSD-src-dc064fbaf3e7a79fe80c06259fbf0ffed69bb936.tar.gz
Cleaned up interrupt masking by declaring the state variable in a
machine-dependent macro and passing it to all machine-dependent macros. Eliminated the state variable for the GUPROF case.
Diffstat (limited to 'sys/amd64/include/profile.h')
-rw-r--r--sys/amd64/include/profile.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/sys/amd64/include/profile.h b/sys/amd64/include/profile.h
index d912c40..4b9d51b 100644
--- a/sys/amd64/include/profile.h
+++ b/sys/amd64/include/profile.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)profile.h 8.1 (Berkeley) 6/11/93
- * $Id: profile.h,v 1.5 1995/12/29 15:28:54 bde Exp $
+ * $Id: profile.h,v 1.6 1996/01/01 17:11:21 bde Exp $
*/
#ifndef _MACHINE_PROFILE_H_
@@ -46,6 +46,20 @@
#define _MCOUNT_DECL void mcount
#define MCOUNT
+#ifdef GUPROF
+#define CALIB_SCALE 1000
+#define KCOUNT(p,index) ((p)->kcount[(index) \
+ / (HISTFRACTION * sizeof(*(p)->kcount))])
+#define MCOUNT_DECL(s)
+#define MCOUNT_ENTER(s)
+#define MCOUNT_EXIT(s)
+#define PC_TO_I(p, pc) ((fptrint_t)(pc) - (fptrint_t)(p)->lowpc)
+#else
+#define MCOUNT_DECL(s) u_long s;
+#define MCOUNT_ENTER(s) { s = read_eflags(); disable_intr(); }
+#define MCOUNT_EXIT(s) (write_eflags(s))
+#endif /* GUPROF */
+
#else /* !KERNEL */
#define _MCOUNT_DECL static __inline void _mcount
@@ -74,15 +88,6 @@ mcount() \
}
#endif /* KERNEL */
-#ifdef KERNEL
-#define CALIB_SCALE 1000
-#define KCOUNT(p,index) ((p)->kcount[(index) \
- / (HISTFRACTION * sizeof(*(p)->kcount))])
-#define MCOUNT_ENTER { save_eflags = read_eflags(); disable_intr(); }
-#define MCOUNT_EXIT (write_eflags(save_eflags))
-#define PC_TO_I(p, pc) ((fptrint_t)(pc) - (fptrint_t)(p)->lowpc)
-#endif
-
/* An unsigned integral type that can hold function pointers. */
typedef u_int fptrint_t;
OpenPOWER on IntegriCloud