From db8f2e326c7fc65b79f0078c9b78e4d953987b4e Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Sun, 21 Apr 2002 10:49:00 +0000 Subject: [PATCH] Stylify (mainly line up macro EOL-continuation \'s), and add a dummy alternative for lint. --- sys/amd64/include/profile.h | 49 +++++++++++++++++++++---------------- sys/i386/include/profile.h | 49 +++++++++++++++++++++---------------- 2 files changed, 56 insertions(+), 42 deletions(-) diff --git a/sys/amd64/include/profile.h b/sys/amd64/include/profile.h index a00f475ede2..0c074441697 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; diff --git a/sys/i386/include/profile.h b/sys/i386/include/profile.h index a00f475ede2..0c074441697 100644 --- a/sys/i386/include/profile.h +++ b/sys/i386/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;