diff options
author | bde <bde@FreeBSD.org> | 1997-02-13 10:47:29 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1997-02-13 10:47:29 +0000 |
commit | 9f7ccdfa286497d62f1253a7fa172381f2f37c53 (patch) | |
tree | 74327105423fdc4aca556a119eaf1da1dd6f7740 /sys/i386 | |
parent | 56bd74b4351a33dfac39902725ad343e8f55868b (diff) | |
download | FreeBSD-src-9f7ccdfa286497d62f1253a7fa172381f2f37c53.zip FreeBSD-src-9f7ccdfa286497d62f1253a7fa172381f2f37c53.tar.gz |
Moved definition of FUNCTION_ALIGNMENT to a machine-dependent place.
Changed it from 4 to 16 for i386's. It can be anything for i386's,
but compiler options limit it to a power of 2, and assembler and
linker deficiencies limit it to a small power of 2 (<= 16).
We use 16 in the kernel to get smaller tables (see Makefile.i386 and
<machine/asmacros.h>). We still use the default of 4 in user mode.
Use HISTCOUNTER instead of (*kcount) in the definition of KCOUNT()
for consistency with other macros.
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/include/profile.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/i386/include/profile.h b/sys/i386/include/profile.h index 2dc78d9..3247d14 100644 --- a/sys/i386/include/profile.h +++ b/sys/i386/include/profile.h @@ -39,6 +39,12 @@ #ifdef KERNEL /* + * Config generates something to tell the compiler to align functions on 16 + * byte boundaries. A strict alignment is good for keeping the tables small. + */ +#define FUNCTION_ALIGNMENT 16 + +/* * The kernel uses assembler stubs instead of unportable inlines. * This is mainly to save a little time when profiling is not enabled, * which is the usual case for the kernel. @@ -49,7 +55,7 @@ #ifdef GUPROF #define CALIB_SCALE 1000 #define KCOUNT(p,index) ((p)->kcount[(index) \ - / (HISTFRACTION * sizeof(*(p)->kcount))]) + / (HISTFRACTION * sizeof(HISTCOUNTER))]) #define MCOUNT_DECL(s) #define MCOUNT_ENTER(s) #define MCOUNT_EXIT(s) @@ -62,6 +68,8 @@ #else /* !KERNEL */ +#define FUNCTION_ALIGNMENT 4 + #define _MCOUNT_DECL static __inline void _mcount #define MCOUNT \ |