summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/profile.h
diff options
context:
space:
mode:
authortegge <tegge@FreeBSD.org>1997-12-15 02:18:35 +0000
committertegge <tegge@FreeBSD.org>1997-12-15 02:18:35 +0000
commitba494eff3a511b2f5c5d9bbc02686772b9ed4de7 (patch)
tree6d2e4d72fd7140f16dc511d497a2d2acfcae6f26 /sys/amd64/include/profile.h
parentda6ab2349a36aff5f17c3d322976dace8fa64ac7 (diff)
downloadFreeBSD-src-ba494eff3a511b2f5c5d9bbc02686772b9ed4de7.zip
FreeBSD-src-ba494eff3a511b2f5c5d9bbc02686772b9ed4de7.tar.gz
Add support for low resolution SMP kernel profiling.
- A nonprofiling version of s_lock (called s_lock_np) is used by mcount. - When profiling is active, more registers are clobbered in seemingly simple assembly routines. This means that some callers needed to save/restore extra registers. - The stack pointer must have space for a 'fake' return address in idle, to avoid stack underflow.
Diffstat (limited to 'sys/amd64/include/profile.h')
-rw-r--r--sys/amd64/include/profile.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/amd64/include/profile.h b/sys/amd64/include/profile.h
index d451245..0e6601e 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.11 1997/02/22 09:35:01 peter Exp $
+ * $Id: profile.h,v 1.12 1997/08/30 08:07:50 fsmp Exp $
*/
#ifndef _MACHINE_PROFILE_H_
@@ -62,10 +62,13 @@
#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(); }
#ifdef SMP
-#define MCOUNT_EXIT(s) { MPINTR_UNLOCK(); write_eflags(s); }
+#define MCOUNT_ENTER(s) { s = read_eflags(); \
+ __asm __volatile("cli" : : : "memory"); \
+ s_lock_np(&mcount_lock); }
+#define MCOUNT_EXIT(s) { s_unlock_np(&mcount_lock); write_eflags(s); }
#else
+#define MCOUNT_ENTER(s) { s = read_eflags(); disable_intr(); }
#define MCOUNT_EXIT(s) (write_eflags(s))
#endif
#endif /* GUPROF */
@@ -107,7 +110,7 @@ typedef u_int fptrint_t;
* An unsigned integral type that can hold non-negative difference between
* function pointers.
*/
-typedef int fptrdiff_t;
+typedef u_int fptrdiff_t;
#ifdef KERNEL
OpenPOWER on IntegriCloud