diff options
author | bde <bde@FreeBSD.org> | 2006-10-28 13:12:06 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2006-10-28 13:12:06 +0000 |
commit | 342dca59e9e4bc6b271da653144235f8c1eb3612 (patch) | |
tree | 70ed94756d403036e926a98315c25aef0be36e53 | |
parent | e80cd771cbf070c71d90d13bb7106e6872bac8ef (diff) | |
download | FreeBSD-src-342dca59e9e4bc6b271da653144235f8c1eb3612.zip FreeBSD-src-342dca59e9e4bc6b271da653144235f8c1eb3612.tar.gz |
In the userland .mcount():
- Don't use a frame pointer. Our callers need a frame pointer, but we
could only use one to support things that aren't supported. (These
things are:
- profiling of profiling
- debugging of profiling. The core ENTRY() macro doesn't support
forcing a frame pointer for debugging, so don't do more here.)
- Ensure that we are in the text section and have normal alignment.
- Use the normal syntax for `.type'.
-rw-r--r-- | sys/amd64/include/profile.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/amd64/include/profile.h b/sys/amd64/include/profile.h index 6f66e45..0083091 100644 --- a/sys/amd64/include/profile.h +++ b/sys/amd64/include/profile.h @@ -114,11 +114,11 @@ static void _mcount #ifdef __GNUCLIKE_ASM #define MCOUNT __asm(" \n\ + .text \n\ + .p2align 4,0x90 \n\ .globl .mcount \n\ - .type .mcount @function \n\ + .type .mcount,@function \n\ .mcount: \n\ - pushq %rbp \n\ - movq %rsp,%rbp \n\ pushq %rdi \n\ pushq %rsi \n\ pushq %rdx \n\ @@ -126,9 +126,8 @@ static void _mcount pushq %r8 \n\ pushq %r9 \n\ pushq %rax \n\ - movq 8(%rbp),%rsi \n\ - movq (%rbp),%rdi \n\ - movq 8(%rdi),%rdi \n\ + movq 8(%rbp),%rdi \n\ + movq 7*8(%rsp),%rsi \n\ call _mcount \n\ popq %rax \n\ popq %r9 \n\ @@ -137,7 +136,6 @@ static void _mcount popq %rdx \n\ popq %rsi \n\ popq %rdi \n\ - leave \n\ ret \n\ .size .mcount, . - .mcount"); #if 0 |