mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Update.
2003-03-19 Ulrich Drepper <drepper@redhat.com> * Makefile (distribute): Add include/atomic.h and bits/atomic.h. * include/atomic.h: New file. * sysdeps/i386/i486/bits/atomic.h: New file. * sysdeps/x86_64/bits/atomic.h: New file. * sysdeps/s390/bits/atomic.h: New file. * sysdeps/sh/bits/atomic.h: New file. * sysdeps/ia64/bits/atomic.h: New file. * sysdeps/powerpc/bits/atomic.h: New file. * sysdeps/generic/bits/atomic.h: New file. * sysdeps/i386/i486/atomicity.h: Removed. * sysdeps/x86_64/atomicity.h: Removed. * sysdeps/s390/s390-32/atomicity.h: Removed. * sysdeps/s390/s390-64/atomicity.h: Removed. * sysdeps/ia64/atomicity.h: Removed. * sysdeps/powerpc/powerpc32/atomicity.h: Removed. * sysdeps/powerpc/powerpc64/atomicity.h: Removed. * elf/dl-profile.c: Use atomic.h instead of atomicity.h. Adjust use of macros from atomicity.h to new names and semantics. * gmon_mcount.c: Likewise. * malloc/set-freeres.c: Likewise. * nscd/cache.c: Likewise. * stdlib/cxa_finalize.c: Likewise. * sysdeps/unix/sysv/linux/getsysstats.c: Likewise. * sysdeps/mips/ieee754.h: New file, suitable to replace both * stdlib/strtod.c (INTERNAL): While eating trailing zeros handle
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* Profiling of shared libraries.
|
||||
Copyright (C) 1997,1998,1999,2000,2001,2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
Based on the BSD mcount implementation.
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <sys/mman.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <atomicity.h>
|
||||
#include <atomic.h>
|
||||
|
||||
/* The LD_PROFILE feature has to be implemented different to the
|
||||
normal profiling using the gmon/ functions. The problem is that an
|
||||
@@ -516,24 +516,24 @@ _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc)
|
||||
size_t newfromidx;
|
||||
to_index = (data[narcs].self_pc
|
||||
/ (hashfraction * sizeof (*tos)));
|
||||
newfromidx = exchange_and_add (&fromidx, 1) + 1;
|
||||
newfromidx = atomic_exchange_and_add (&fromidx, 1) + 1;
|
||||
froms[newfromidx].here = &data[narcs];
|
||||
froms[newfromidx].link = tos[to_index];
|
||||
tos[to_index] = newfromidx;
|
||||
atomic_add (&narcs, 1);
|
||||
atomic_increment (&narcs);
|
||||
}
|
||||
|
||||
/* If we still have no entry stop searching and insert. */
|
||||
if (*topcindex == 0)
|
||||
{
|
||||
uint_fast32_t newarc = exchange_and_add (narcsp, 1);
|
||||
uint_fast32_t newarc = atomic_exchange_and_add (narcsp, 1);
|
||||
|
||||
/* In rare cases it could happen that all entries in FROMS are
|
||||
occupied. So we cannot count this anymore. */
|
||||
if (newarc >= fromlimit)
|
||||
goto done;
|
||||
|
||||
*topcindex = exchange_and_add (&fromidx, 1) + 1;
|
||||
*topcindex = atomic_exchange_and_add (&fromidx, 1) + 1;
|
||||
fromp = &froms[*topcindex];
|
||||
|
||||
fromp->here = &data[newarc];
|
||||
@@ -541,7 +541,7 @@ _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc)
|
||||
data[newarc].self_pc = selfpc;
|
||||
data[newarc].count = 0;
|
||||
fromp->link = 0;
|
||||
atomic_add (&narcs, 1);
|
||||
atomic_increment (&narcs);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -554,7 +554,7 @@ _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc)
|
||||
}
|
||||
|
||||
/* Increment the counter. */
|
||||
atomic_add (&fromp->here->count, 1);
|
||||
atomic_increment (&fromp->here->count);
|
||||
|
||||
done:
|
||||
;
|
||||
|
Reference in New Issue
Block a user