static char sccsid[] = "@(#)mcount.c 8.1 (Berkeley) 6/4/93";
#endif
+#include <unistd.h>
#include <sys/param.h>
#include <sys/gmon.h>
/* This file provides the machine-dependent definitions of the _MCOUNT_DECL
and MCOUNT macros. */
-#include "machine-gmon.h"
+#include <machine-gmon.h>
-#include <atomicity.h>
+#include <atomic.h>
/*
* mcount is called on entry to each function compiled with the profiling
*/
_MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */
{
- register u_short *frompcindex;
- register struct tostruct *top, *prevtop;
- register struct gmonparam *p;
- register long toindex;
+ ARCINDEX *frompcindex;
+ struct tostruct *top, *prevtop;
+ struct gmonparam *p;
+ ARCINDEX toindex;
int i;
p = &_gmonparam;
* check that we are profiling
* and that we aren't recursively invoked.
*/
- if (! compare_and_swap (&p->state, GMON_PROF_ON, GMON_PROF_BUSY))
+ if (atomic_compare_and_exchange_bool_acq (&p->state, GMON_PROF_BUSY,
+ GMON_PROF_ON))
return;
/*