diff options
author | Ulrich Drepper <drepper@redhat.com> | 2006-10-11 09:01:52 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2006-10-11 09:01:52 +0000 |
commit | 8099361ecd23167ddbb8585a375cbacbcffb64c4 (patch) | |
tree | 09ec44fc8e4facd3a8dec55c77450d368ccefff4 /elf | |
parent | 2a6ee54934756720c5e93a4f09e85929c49596dc (diff) | |
download | glibc-8099361ecd23167ddbb8585a375cbacbcffb64c4.zip glibc-8099361ecd23167ddbb8585a375cbacbcffb64c4.tar.gz glibc-8099361ecd23167ddbb8585a375cbacbcffb64c4.tar.bz2 |
* include/atomic.c: Define catomic_* operations.
* sysdeps/x86_64/bits/atomic.h: Likewise. Fix a few minor problems.
* stdlib/cxa_finalize.c: Use catomic_* operations instead of atomic_*.
* malloc/memusage.c: Likewise.
* gmon/mcount.c: Likewise.
* elf/dl-close.c: Likewise.
* elf/dl-open.c: Likewise.
* elf/dl-profile.c: Likewise.
* elf/dl-sym.c: Likewise.
* elf/dl-runtime.c: Likewise.
* elf/dl-fptr.c: Likewise.
* resolv/res_libc.c: Likewise.
Diffstat (limited to 'elf')
-rw-r--r-- | elf/dl-close.c | 4 | ||||
-rw-r--r-- | elf/dl-fptr.c | 4 | ||||
-rw-r--r-- | elf/dl-open.c | 4 | ||||
-rw-r--r-- | elf/dl-profile.c | 14 | ||||
-rw-r--r-- | elf/dl-runtime.c | 8 | ||||
-rw-r--r-- | elf/dl-sym.c | 4 |
6 files changed, 19 insertions, 19 deletions
diff --git a/elf/dl-close.c b/elf/dl-close.c index 2e7c506..84e57e0 100644 --- a/elf/dl-close.c +++ b/elf/dl-close.c @@ -423,11 +423,11 @@ _dl_close (void *_map) imap->l_scoperec = newp; __rtld_mrlock_done (imap->l_scoperec_lock); - if (atomic_increment_val (&old->nusers) != 1) + if (catomic_increment_val (&old->nusers) != 1) { old->remove_after_use = true; old->notify = true; - if (atomic_decrement_val (&old->nusers) != 0) + if (catomic_decrement_val (&old->nusers) != 0) __rtld_waitzero (old->nusers); } diff --git a/elf/dl-fptr.c b/elf/dl-fptr.c index 78beecf..e068124 100644 --- a/elf/dl-fptr.c +++ b/elf/dl-fptr.c @@ -1,5 +1,5 @@ /* Manage function descriptors. Generic version. - Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + Copyright (C) 1999-2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -40,7 +40,7 @@ #ifndef COMPARE_AND_SWAP # define COMPARE_AND_SWAP(ptr, old, new) \ - (atomic_compare_and_exchange_bool_acq (ptr, new, old) == 0) + (catomic_compare_and_exchange_bool_acq (ptr, new, old) == 0) #endif ElfW(Addr) _dl_boot_fptr_table [ELF_MACHINE_BOOT_FPTR_TABLE_LEN]; diff --git a/elf/dl-open.c b/elf/dl-open.c index 5c90e06..35712b5 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -429,9 +429,9 @@ dl_open_worker (void *a) imap->l_scoperec = newp; __rtld_mrlock_done (imap->l_scoperec_lock); - atomic_increment (&old->nusers); + catomic_increment (&old->nusers); old->remove_after_use = true; - if (atomic_decrement_val (&old->nusers) == 0) + if (catomic_decrement_val (&old->nusers) == 0) /* No user, we can free it here and now. */ free (old); } diff --git a/elf/dl-profile.c b/elf/dl-profile.c index 41214c1..47033f3 100644 --- a/elf/dl-profile.c +++ b/elf/dl-profile.c @@ -1,5 +1,5 @@ /* Profiling of shared libraries. - Copyright (C) 1997-2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1997-2002, 2003, 2004, 2006 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. @@ -509,24 +509,24 @@ _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc) size_t newfromidx; to_index = (data[narcs].self_pc / (HASHFRACTION * sizeof (*tos))); - newfromidx = atomic_exchange_and_add (&fromidx, 1) + 1; + newfromidx = catomic_exchange_and_add (&fromidx, 1) + 1; froms[newfromidx].here = &data[narcs]; froms[newfromidx].link = tos[to_index]; tos[to_index] = newfromidx; - atomic_increment (&narcs); + catomic_increment (&narcs); } /* If we still have no entry stop searching and insert. */ if (*topcindex == 0) { - uint_fast32_t newarc = atomic_exchange_and_add (narcsp, 1); + uint_fast32_t newarc = catomic_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 = atomic_exchange_and_add (&fromidx, 1) + 1; + *topcindex = catomic_exchange_and_add (&fromidx, 1) + 1; fromp = &froms[*topcindex]; fromp->here = &data[newarc]; @@ -534,7 +534,7 @@ _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc) data[newarc].self_pc = selfpc; data[newarc].count = 0; fromp->link = 0; - atomic_increment (&narcs); + catomic_increment (&narcs); break; } @@ -547,7 +547,7 @@ _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc) } /* Increment the counter. */ - atomic_increment (&fromp->here->count); + catomic_increment (&fromp->here->count); done: ; diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c index 83d565a..05fd974 100644 --- a/elf/dl-runtime.c +++ b/elf/dl-runtime.c @@ -97,7 +97,7 @@ _dl_fixup ( { __rtld_mrlock_lock (l->l_scoperec_lock); scoperec = l->l_scoperec; - atomic_increment (&scoperec->nusers); + catomic_increment (&scoperec->nusers); __rtld_mrlock_unlock (l->l_scoperec_lock); } @@ -107,7 +107,7 @@ _dl_fixup ( DL_LOOKUP_ADD_DEPENDENCY, NULL); if (l->l_type == lt_loaded - && atomic_decrement_val (&scoperec->nusers) == 0 + && catomic_decrement_val (&scoperec->nusers) == 0 && __builtin_expect (scoperec->remove_after_use, 0)) { if (scoperec->notify) @@ -199,7 +199,7 @@ _dl_profile_fixup ( { __rtld_mrlock_lock (l->l_scoperec_lock); scoperec = l->l_scoperec; - atomic_increment (&scoperec->nusers); + catomic_increment (&scoperec->nusers); __rtld_mrlock_unlock (l->l_scoperec_lock); } @@ -209,7 +209,7 @@ _dl_profile_fixup ( DL_LOOKUP_ADD_DEPENDENCY, NULL); if (l->l_type == lt_loaded - && atomic_decrement_val (&scoperec->nusers) == 0 + && catomic_decrement_val (&scoperec->nusers) == 0 && __builtin_expect (scoperec->remove_after_use, 0)) { if (scoperec->notify) diff --git a/elf/dl-sym.c b/elf/dl-sym.c index 1c66310..4393346 100644 --- a/elf/dl-sym.c +++ b/elf/dl-sym.c @@ -124,7 +124,7 @@ do_sym (void *handle, const char *name, void *who, { __rtld_mrlock_lock (match->l_scoperec_lock); struct r_scoperec *scoperec = match->l_scoperec; - atomic_increment (&scoperec->nusers); + catomic_increment (&scoperec->nusers); __rtld_mrlock_unlock (match->l_scoperec_lock); struct call_dl_lookup_args args; @@ -141,7 +141,7 @@ do_sym (void *handle, const char *name, void *who, int err = GLRO(dl_catch_error) (&objname, &errstring, &malloced, call_dl_lookup, &args); - if (atomic_decrement_val (&scoperec->nusers) == 0 + if (catomic_decrement_val (&scoperec->nusers) == 0 && __builtin_expect (scoperec->remove_after_use, 0)) { if (scoperec->notify) |