Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/i386/include/profile.h,v rcsdiff: /ftp/cvs/cvsroot/src/sys/arch/i386/include/profile.h,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.19 retrieving revision 1.19.6.1 diff -u -p -r1.19 -r1.19.6.1 --- src/sys/arch/i386/include/profile.h 2004/05/24 14:01:10 1.19 +++ src/sys/arch/i386/include/profile.h 2005/03/19 08:33:04 1.19.6.1 @@ -1,4 +1,4 @@ -/* $NetBSD: profile.h,v 1.19 2004/05/24 14:01:10 yamt Exp $ */ +/* $NetBSD: profile.h,v 1.19.6.1 2005/03/19 08:33:04 yamt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -31,6 +31,10 @@ * @(#)profile.h 8.1 (Berkeley) 6/11/93 */ +#ifdef _KERNEL_OPT +#include "opt_multiprocessor.h" +#endif + #include #define _MCOUNT_DECL static __inline void _mcount @@ -66,6 +70,26 @@ mcount() \ } #ifdef _KERNEL -#define MCOUNT_ENTER do { s = (int)read_psl(); disable_intr(); } while (0) -#define MCOUNT_EXIT do { write_psl(s); } while (0) +#ifdef MULTIPROCESSOR +__cpu_simple_lock_t __mcount_lock; + +#define MCOUNT_ENTER_MP \ + __cpu_simple_lock(&__mcount_lock); +#define MCOUNT_EXIT_MP \ + __cpu_simple_unlock(&__mcount_lock); + +#else +#define MCOUNT_ENTER_MP +#define MCOUNT_EXIT_MP +#endif + +#define MCOUNT_ENTER \ + s = (int)read_psl(); \ + disable_intr(); \ + MCOUNT_ENTER_MP + +#define MCOUNT_EXIT \ + MCOUNT_EXIT_MP \ + write_psl(s); + #endif /* _KERNEL */