diff options
| author | Mark Murray <markm@FreeBSD.org> | 2002-04-21 10:49:00 +0000 |
|---|---|---|
| committer | Mark Murray <markm@FreeBSD.org> | 2002-04-21 10:49:00 +0000 |
| commit | db8f2e326c7fc65b79f0078c9b78e4d953987b4e (patch) | |
| tree | 7bf1b9624a22d7150bcc6e4cf2b31b575390b6e9 /sys/amd64/include | |
| parent | 1a924d72132e7e4d9ed7b27a7e432efd986e42f0 (diff) | |
Notes
Diffstat (limited to 'sys/amd64/include')
| -rw-r--r-- | sys/amd64/include/profile.h | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/sys/amd64/include/profile.h b/sys/amd64/include/profile.h index a00f475ede28..0c0744416974 100644 --- a/sys/amd64/include/profile.h +++ b/sys/amd64/include/profile.h @@ -82,28 +82,35 @@ extern int mcount_lock; #define _MCOUNT_DECL static __inline void _mcount -#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("movl 4(%%ebp),%0" : "=r" (selfpc)); \ - /* \ - * frompc = pc pushed by call to mcount's caller. \ - * The caller's stack frame has already been built, so %ebp 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("movl (%%ebp),%0" : "=r" (frompc)); \ - frompc = ((uintfptr_t *)frompc)[1]; \ - _mcount(frompc, selfpc); \ +#ifdef __GNUC__ +#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("movl 4(%%ebp),%0" : "=r" (selfpc)); \ + /* \ + * frompc = pc pushed by call to mcount's caller. \ + * The caller's stack frame has already been built, so %ebp 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("movl (%%ebp),%0" : "=r" (frompc)); \ + frompc = ((uintfptr_t *)frompc)[1]; \ + _mcount(frompc, selfpc); \ } +#else /* __GNUC__ */ +void \ +mcount() \ +{ \ +} +#endif /* __GNUC__ */ typedef unsigned int uintfptr_t; |
