PERFORCE change 104860 for review
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Wed Aug 23 21:37:14 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=104860
Change 104860 by gonzo at gonzo_hideout on 2006/08/23 21:36:41
o Throw away amd64 profiling code.
o Replace profiling codes with stubs.
Affected files ...
.. //depot/projects/mips2/src/sys/mips/include/profile.h#2 edit
Differences ...
==== //depot/projects/mips2/src/sys/mips/include/profile.h#2 (text+ko) ====
@@ -57,19 +57,7 @@
#define MCOUNT_DECL(s)
#define MCOUNT_ENTER(s)
#define MCOUNT_EXIT(s)
-#ifdef __GNUCLIKE_ASM
-#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)
+#if defined(lint)
#define MCOUNT_OVERHEAD(label)
#define MEXITCOUNT_OVERHEAD()
#define MEXITCOUNT_OVERHEAD_GETLABEL()
@@ -112,71 +100,11 @@
static void _mcount(uintfptr_t frompc, uintfptr_t selfpc) __used; \
static void _mcount
-#ifdef __GNUCLIKE_ASM
-#define MCOUNT __asm(" \n\
- .globl .mcount \n\
- .type .mcount @function \n\
-.mcount: \n\
- pushq %rbp \n\
- movq %rsp,%rbp \n\
- pushq %rdi \n\
- pushq %rsi \n\
- pushq %rdx \n\
- pushq %rcx \n\
- pushq %r8 \n\
- pushq %r9 \n\
- pushq %rax \n\
- movq 8(%rbp),%rsi \n\
- movq (%rbp),%rdi \n\
- movq 8(%rdi),%rdi \n\
- call _mcount \n\
- popq %rax \n\
- popq %r9 \n\
- popq %r8 \n\
- popq %rcx \n\
- popq %rdx \n\
- popq %rsi \n\
- popq %rdi \n\
- leave \n\
- ret \n\
- .size .mcount, . - .mcount");
-#if 0
-/*
- * We could use this, except it doesn't preserve the registers that were
- * being passed with arguments to the function that we were inserted
- * into. I've left it here as documentation of what the code above is
- * supposed to do.
- */
#define MCOUNT \
void \
mcount() \
{ \
- uintfptr_t selfpc, frompc; \
- /* \
- * Find the return address for mcount, \
- * and the return address for mcount's caller. \
- * \
- * selfpc = pc pushed by call to mcount \
- */ \
- __asm("movq 8(%%rbp),%0" : "=r" (selfpc)); \
- /* \
- * frompc = pc pushed by call to mcount's caller. \
- * The caller's stack frame has already been built, so %rbp is \
- * the caller's frame pointer. The caller's raddr is in the \
- * caller's frame following the caller's caller's frame pointer.\
- */ \
- __asm("movq (%%rbp),%0" : "=r" (frompc)); \
- frompc = ((uintfptr_t *)frompc)[1]; \
- _mcount(frompc, selfpc); \
}
-#endif
-#else /* !__GNUCLIKE_ASM */
-#define MCOUNT \
-void \
-mcount() \
-{ \
-}
-#endif /* __GNUCLIKE_ASM */
typedef u_long uintfptr_t;
More information about the p4-projects
mailing list