Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys Declare 16 and 8 bit atomic CAS - while it is not us...



details:   https://anonhg.NetBSD.org/src/rev/2861234a5cc2
branches:  trunk
changeset: 793632:2861234a5cc2
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Feb 21 15:52:53 2014 +0000

description:
Declare 16 and 8 bit atomic CAS - while it is not usually sane to expect
these functions to work in MI code, we need them to provide some of the
__sync_* functions gcc and other compilers expect nowadays on some
architectures.

diffstat:

 sys/sys/atomic.h |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r 7f962b9b8344 -r 2861234a5cc2 sys/sys/atomic.h
--- a/sys/sys/atomic.h  Fri Feb 21 15:51:07 2014 +0000
+++ b/sys/sys/atomic.h  Fri Feb 21 15:52:53 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atomic.h,v 1.11 2009/11/20 02:17:07 christos Exp $     */
+/*     $NetBSD: atomic.h,v 1.12 2014/02/21 15:52:53 martin Exp $       */
 
 /*-
  * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
@@ -91,6 +91,13 @@
 uint64_t       atomic_cas_64(volatile uint64_t *, uint64_t, uint64_t);
 
 /*
+ * This operations will be provided for userland, but may not be
+ * implemented efficiently.
+ */
+uint16_t       atomic_cas_16(volatile uint16_t *, uint16_t, uint16_t);
+uint8_t        atomic_cas_8(volatile uint8_t *, uint8_t, uint8_t);
+
+/*
  * Non-interlocked atomic COMPARE-AND-SWAP.
  */
 uint32_t       atomic_cas_32_ni(volatile uint32_t *, uint32_t, uint32_t);



Home | Main Index | Thread Index | Old Index