Home | History | Annotate | only in /src/common/lib/libc/arch/hppa
History log of /src/common/lib/libc/arch/hppa
RevisionDateAuthorComments
 1.16 29-Oct-2023  skrll Define __HAVE_ATOMIC_CAS_64_UP and provide __sync_val_compare_and_swap_8

The new santizer code in gcc12 needs this.
 1.15 30-Mar-2023  riastradh libc: Define __atomic_is_lock_free.

Limited to architectures where it is actually needed by gcc for any
calls to stdatomic.h atomic_is_lock_free for now.

We should also add it to other architectures too, along with lockful
atomic r/m/w operations for sizes that can't be handled natively, but
that's a lot more work. It is also necessary for -fno-inline-atomics
but we're missing a lot of other symbols for that too, to be fixed.
For now, this should enable the OpenSSL build to complete on these
architectures again after I reverted a local change.

XXX pullup-10
 1.14 28-Feb-2019  isaki branches: 1.14.14;
Add missing atomic_and_{8,16}_nv_cas.c for __sync_and_and_fetch_{1,2}.
XXX why is not only atomic_and_* symmetric unlike the others?
(in common/lib/libc/atomic/)
 1.13 14-Oct-2014  martin branches: 1.13.16;
Provide C++ 2011 <atomic> support functions for hppa and arm.
 1.12 22-Feb-2014  skrll branches: 1.12.4;
Add the missing __sync_* ops to libc
 1.11 22-Feb-2014  skrll Another layout change
 1.10 22-Feb-2014  skrll Layout changes - no functional change.
 1.9 29-Jan-2014  skrll Provide _atomic_cas_8_up and _atomic_cas_16_up functions
 1.8 17-Jan-2011  skrll branches: 1.8.6; 1.8.12;
Tweak layout - no functional change.
 1.7 06-Jan-2009  mjf The .if conditional crosses a line boundary, so add a backslash.

This fixes the kernel build for hppa.
 1.6 04-Jan-2009  pooka allow inclusion of atomic ops in librump
 1.5 29-Sep-2008  ad Allow atomic ops to be built as part of libpthread.
 1.4 11-Aug-2008  skrll Provide assembly _atomic_cas_up() as the compiler cannot be trusted to
generate fully restartable code sequences.
 1.3 11-Feb-2008  ad branches: 1.3.6;
Only build atomic ops for libkern/libc.
 1.2 10-Feb-2008  ad Enable the atomic ops in userspace.
 1.1 29-Nov-2007  ad branches: 1.1.4;
Atomic ops for hppa.
 1.1.4.3 23-Mar-2008  matt sync with HEAD
 1.1.4.2 09-Jan-2008  matt sync with HEAD
 1.1.4.1 29-Nov-2007  matt file Makefile.inc was added on branch matt-armv6 on 2008-01-09 01:20:52 +0000
 1.3.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.8.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.12.4.1 12-Nov-2014  snj Pull up following revision(s) (requested by martin in ticket #218):
common/lib/libc/arch/arm/atomic/Makefile.inc: revision 1.24-1.26
common/lib/libc/arch/hppa/atomic/Makefile.inc: revision 1.13
common/lib/libc/arch/mips/atomic/Makefile.inc: revision 1.13
common/lib/libc/arch/sh3/atomic/Makefile.inc: revision 1.7
common/lib/libc/arch/sparc/atomic/Makefile.inc: revision 1.18
common/lib/libc/arch/vax/atomic/Makefile.inc: revision 1.7
common/lib/libc/atomic/atomic_and_16_nv_cas.c: revision 1.2
common/lib/libc/atomic/atomic_and_8_nv_cas.c: revision 1.2
common/lib/libc/atomic/atomic_c11_compare_exchange_cas_16.c: revision 1.1-1.2
common/lib/libc/atomic/atomic_c11_compare_exchange_cas_32.c: revision 1.1-1.2
common/lib/libc/atomic/atomic_c11_compare_exchange_cas_8.c: revision 1.1-1.2
common/lib/libc/atomic/atomic_cas_by_cas32.c: revision 1.4
common/lib/libc/atomic/atomic_op_namespace.h: revision 1.7
Add __sync_val_compare_and_swap_{1,2} aliases for _atomic_cas_{8,16}
--
Provide __atomic_compare_exchange_N (as needed for the C11 2011 <atomic>
ops) via the corresponding CAS.
--
Hook __atomic_compare_exchange_N into vax libc.
--
Provide __sync_and_and_fetch_2 and __sync_and_and_fetch_1 for pre-ARMv6,
they are needed for the C++ 2011 <atomic> stuff.
--
Add C++ 2011 <atomic> support functions.
--
Move the and_{16,8}_nv sources into the right (libc only) block.
--
Provide <atomic> C++ 2011 support functions for mips and sh3.
--
Provide C++ 2011 <atomic> support functions for hppa and arm.
--
Provide prototypes to fix build with clang.
 1.13.16.2 21-Apr-2020  martin Sync with HEAD
 1.13.16.1 10-Jun-2019  christos Sync with HEAD
 1.14.14.1 31-Jul-2023  martin Pull up following revision(s) (requested by riastradh in ticket #275):

common/lib/libc/arch/sparc/atomic/Makefile.inc: revision 1.24
common/lib/libc/arch/m68k/atomic/Makefile.inc: revision 1.16
common/lib/libc/arch/mips/atomic/Makefile.inc: revision 1.16
common/lib/libc/arch/hppa/atomic/Makefile.inc: revision 1.15
common/lib/libc/arch/vax/atomic/Makefile.inc: revision 1.9
common/lib/libc/atomic/atomic_is_lock_free.c: revision 1.1
common/lib/libc/arch/sh3/atomic/Makefile.inc: revision 1.9

libc: Define __atomic_is_lock_free.

Limited to architectures where it is actually needed by gcc for any
calls to stdatomic.h atomic_is_lock_free for now.

We should also add it to other architectures too, along with lockful
atomic r/m/w operations for sizes that can't be handled natively, but
that's a lot more work. It is also necessary for -fno-inline-atomics
but we're missing a lot of other symbols for that too, to be fixed.

For now, this should enable the OpenSSL build to complete on these
architectures again after I reverted a local change.
 1.4 29-Jan-2014  skrll branches: 1.4.26;
Copyright
 1.3 29-Jan-2014  skrll Provide _atomic_cas_8_up and _atomic_cas_16_up functions
 1.2 16-Jan-2011  skrll branches: 1.2.6; 1.2.12;
Fix RCSId.
 1.1 11-Aug-2008  skrll branches: 1.1.2;
Provide assembly _atomic_cas_up() as the compiler cannot be trusted to
generate fully restartable code sequences.
 1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.2.1 11-Aug-2008  wrstuden file atomic_cas_up.S was added on branch wrstuden-revivesa on 2008-09-18 04:54:18 +0000
 1.2.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.26.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.4.26.1 21-Apr-2020  martin Sync with HEAD
 1.3 09-Apr-2022  riastradh Introduce membar_acquire/release. Deprecate membar_enter/exit.

The names membar_enter/exit were unclear, and the documentation of
membar_enter has disagreed with the implementations on sparc,
powerpc, and even x86(!) for the entire time it has been in NetBSD.

The terms `acquire' and `release' are ubiquitous in the literature
today, and have been adopted in the C and C++ standards to mean
load-before-load/store and load/store-before-store, respectively,
which are exactly the orderings required by acquiring and releasing a
mutex, as well as other useful applications like decrementing a
reference count and then freeing the underlying object if it went to
zero.

Originally I proposed changing one word in the documentation for
membar_enter to make it load-before-load/store instead of
store-before-load/store, i.e., to make it an acquire barrier. I
proposed this on the grounds that

(a) all implementations guarantee load-before-load/store,
(b) some implementations fail to guarantee store-before-load/store,
and
(c) all uses in-tree assume load-before-load/store.

I verified parts (a) and (b) (except, for (a), powerpc didn't even
guarantee load-before-load/store -- isync isn't necessarily enough;
need lwsync in general -- but it _almost_ did, and it certainly didn't
guarantee store-before-load/store).

Part (c) might not be correct, however: under the mistaken assumption
that atomic-r/m/w then membar-w/rw is equivalent to atomic-r/m/w then
membar-r/rw, I only audited the cases of membar_enter that _aren't_
immediately after an atomic-r/m/w. All of those cases assume
load-before-load/store. But my assumption was wrong -- there are
cases of atomic-r/m/w then membar-w/rw that would be broken by
changing to atomic-r/m/w then membar-r/rw:

https://mail-index.netbsd.org/tech-kern/2022/03/29/msg028044.html

Furthermore, the name membar_enter has been adopted in other places
like OpenBSD where it actually does follow the documentation and
guarantee store-before-load/store, even if that order is not useful.
So the name membar_enter currently lives in a bad place where it
means either of two things -- r/rw or w/rw.

With this change, we deprecate membar_enter/exit, introduce
membar_acquire/release as better names for the useful pair (r/rw and
rw/w), and make sure the implementation of membar_enter guarantees
both what was documented _and_ what was implemented, making it an
alias for membar_sync.

While here, rework all of the membar_* definitions and aliases. The
new logic follows a rule to make it easier to audit:

membar_X is defined as an alias for membar_Y iff membar_X is
guaranteed by membar_Y.

The `no stronger than' relation is (the transitive closure of):

- membar_consumer (r/r) is guaranteed by membar_acquire (r/rw)
- membar_producer (w/w) is guaranteed by membar_release (rw/w)
- membar_acquire (r/rw) is guaranteed by membar_sync (rw/rw)
- membar_release (rw/w) is guaranteed by membar_sync (rw/rw)

And, for the deprecated membars:

- membar_enter (whether r/rw, w/rw, or rw/rw) is guaranteed by
membar_sync (rw/rw)
- membar_exit (rw/w) is guaranteed by membar_release (rw/w)

(membar_exit is identical to membar_release, but the name is
deprecated.)

Finally, while here, annotate some of the instructions with their
semantics. For powerpc, leave an essay with citations on the
unfortunate but -- as far as I can tell -- necessary decision to use
lwsync, not isync, for membar_acquire and membar_consumer.

Also add membar(3) and atomic(3) man page links.
 1.2 06-Apr-2022  riastradh Nix trailing whitespace in files of membars, atomics, and lock stubs.

Will be touching many of these files soon for functional changes.

No functional change intended.
 1.1 17-Jan-2011  skrll branches: 1.1.48;
Add an membar_ops.S - not used currently.
 1.1.48.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.1.48.1 21-Apr-2020  martin Sync with HEAD

RSS XML Feed