From 5e189e571af1bd789a219f7a12ed73e9ec01f5d4 Mon Sep 17 00:00:00 2001 From: bde Date: Thu, 20 May 2004 16:22:57 +0000 Subject: MFi386 (1.37: GUPROF calibration macros; only routine adjustments needed). --- sys/amd64/include/profile.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'sys') diff --git a/sys/amd64/include/profile.h b/sys/amd64/include/profile.h index 0cf12de..555e2f1 100644 --- a/sys/amd64/include/profile.h +++ b/sys/amd64/include/profile.h @@ -53,7 +53,26 @@ #define MCOUNT_DECL(s) #define MCOUNT_ENTER(s) #define MCOUNT_EXIT(s) +#ifdef __GNUC__ +#define MCOUNT_OVERHEAD(label) \ + __asm __volatile("pushq %0; call __mcount; popq %%rcx" \ + : \ + : "i" (profil) \ + : "ax", "dx", "cx", "di", "si", "r8", "r9", "memory") +#define MEXITCOUNT_OVERHEAD() \ + __asm __volatile("call .mexitcount; 1:" \ + : : \ + : "ax", "dx", "cx", "di", "si", "r8", "r9", "memory") +#define MEXITCOUNT_OVERHEAD_GETLABEL(labelp) \ + __asm __volatile("movq $1b,%0" : "=rm" (labelp)) +#elif defined(lint) +#define MCOUNT_OVERHEAD(label) +#define MEXITCOUNT_OVERHEAD() +#define MEXITCOUNT_OVERHEAD_GETLABEL() #else +#error +#endif /* __GNUC */ +#else /* !GUPROF */ #define MCOUNT_DECL(s) u_long s; #ifdef SMP extern int mcount_lock; -- cgit v1.1