xref: /illumos-gate/usr/src/uts/common/sys/atomic.h (revision 1dc4a592)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
52b616c6cSwesolows  * Common Development and Distribution License (the "License").
62b616c6cSwesolows  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
212b616c6cSwesolows 
227c478bd9Sstevel@tonic-gate /*
23ba3594baSGarrett D'Amore  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24ba3594baSGarrett D'Amore  *
257c478bd9Sstevel@tonic-gate  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
267c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
277c478bd9Sstevel@tonic-gate  */
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #ifndef	_SYS_ATOMIC_H
307c478bd9Sstevel@tonic-gate #define	_SYS_ATOMIC_H
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #include <sys/types.h>
337c478bd9Sstevel@tonic-gate #include <sys/inttypes.h>
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
367c478bd9Sstevel@tonic-gate extern "C" {
377c478bd9Sstevel@tonic-gate #endif
387c478bd9Sstevel@tonic-gate 
392b616c6cSwesolows #if defined(_KERNEL) && defined(__GNUC__) && defined(_ASM_INLINES) && \
402b616c6cSwesolows 	(defined(__i386) || defined(__amd64))
417c478bd9Sstevel@tonic-gate #include <asm/atomic.h>
427c478bd9Sstevel@tonic-gate #endif
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate /*
457c478bd9Sstevel@tonic-gate  * Increment target.
467c478bd9Sstevel@tonic-gate  */
477c478bd9Sstevel@tonic-gate extern void atomic_inc_8(volatile uint8_t *);
487c478bd9Sstevel@tonic-gate extern void atomic_inc_uchar(volatile uchar_t *);
497c478bd9Sstevel@tonic-gate extern void atomic_inc_16(volatile uint16_t *);
507c478bd9Sstevel@tonic-gate extern void atomic_inc_ushort(volatile ushort_t *);
517c478bd9Sstevel@tonic-gate extern void atomic_inc_32(volatile uint32_t *);
527c478bd9Sstevel@tonic-gate extern void atomic_inc_uint(volatile uint_t *);
537c478bd9Sstevel@tonic-gate extern void atomic_inc_ulong(volatile ulong_t *);
547c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_INT64_TYPE)
557c478bd9Sstevel@tonic-gate extern void atomic_inc_64(volatile uint64_t *);
56*1dc4a592SRobert Mustacchi #endif
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate /*
597c478bd9Sstevel@tonic-gate  * Decrement target
607c478bd9Sstevel@tonic-gate  */
617c478bd9Sstevel@tonic-gate extern void atomic_dec_8(volatile uint8_t *);
627c478bd9Sstevel@tonic-gate extern void atomic_dec_uchar(volatile uchar_t *);
637c478bd9Sstevel@tonic-gate extern void atomic_dec_16(volatile uint16_t *);
647c478bd9Sstevel@tonic-gate extern void atomic_dec_ushort(volatile ushort_t *);
657c478bd9Sstevel@tonic-gate extern void atomic_dec_32(volatile uint32_t *);
667c478bd9Sstevel@tonic-gate extern void atomic_dec_uint(volatile uint_t *);
677c478bd9Sstevel@tonic-gate extern void atomic_dec_ulong(volatile ulong_t *);
687c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_INT64_TYPE)
697c478bd9Sstevel@tonic-gate extern void atomic_dec_64(volatile uint64_t *);
707c478bd9Sstevel@tonic-gate #endif
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate /*
737c478bd9Sstevel@tonic-gate  * Add delta to target
747c478bd9Sstevel@tonic-gate  */
757c478bd9Sstevel@tonic-gate extern void atomic_add_8(volatile uint8_t *, int8_t);
767c478bd9Sstevel@tonic-gate extern void atomic_add_char(volatile uchar_t *, signed char);
777c478bd9Sstevel@tonic-gate extern void atomic_add_16(volatile uint16_t *, int16_t);
787c478bd9Sstevel@tonic-gate extern void atomic_add_short(volatile ushort_t *, short);
797c478bd9Sstevel@tonic-gate extern void atomic_add_32(volatile uint32_t *, int32_t);
807c478bd9Sstevel@tonic-gate extern void atomic_add_int(volatile uint_t *, int);
817c478bd9Sstevel@tonic-gate extern void atomic_add_ptr(volatile void *, ssize_t);
827c478bd9Sstevel@tonic-gate extern void atomic_add_long(volatile ulong_t *, long);
837c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_INT64_TYPE)
847c478bd9Sstevel@tonic-gate extern void atomic_add_64(volatile uint64_t *, int64_t);
857c478bd9Sstevel@tonic-gate #endif
867c478bd9Sstevel@tonic-gate 
877c478bd9Sstevel@tonic-gate /*
887c478bd9Sstevel@tonic-gate  * logical OR bits with target
897c478bd9Sstevel@tonic-gate  */
907c478bd9Sstevel@tonic-gate extern void atomic_or_8(volatile uint8_t *, uint8_t);
917c478bd9Sstevel@tonic-gate extern void atomic_or_uchar(volatile uchar_t *, uchar_t);
927c478bd9Sstevel@tonic-gate extern void atomic_or_16(volatile uint16_t *, uint16_t);
937c478bd9Sstevel@tonic-gate extern void atomic_or_ushort(volatile ushort_t *, ushort_t);
947c478bd9Sstevel@tonic-gate extern void atomic_or_32(volatile uint32_t *, uint32_t);
957c478bd9Sstevel@tonic-gate extern void atomic_or_uint(volatile uint_t *, uint_t);
967c478bd9Sstevel@tonic-gate extern void atomic_or_ulong(volatile ulong_t *, ulong_t);
977c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_INT64_TYPE)
987c478bd9Sstevel@tonic-gate extern void atomic_or_64(volatile uint64_t *, uint64_t);
997c478bd9Sstevel@tonic-gate #endif
1007c478bd9Sstevel@tonic-gate 
1017c478bd9Sstevel@tonic-gate /*
1027c478bd9Sstevel@tonic-gate  * logical AND bits with target
1037c478bd9Sstevel@tonic-gate  */
1047c478bd9Sstevel@tonic-gate extern void atomic_and_8(volatile uint8_t *, uint8_t);
1057c478bd9Sstevel@tonic-gate extern void atomic_and_uchar(volatile uchar_t *, uchar_t);
1067c478bd9Sstevel@tonic-gate extern void atomic_and_16(volatile uint16_t *, uint16_t);
1077c478bd9Sstevel@tonic-gate extern void atomic_and_ushort(volatile ushort_t *, ushort_t);
1087c478bd9Sstevel@tonic-gate extern void atomic_and_32(volatile uint32_t *, uint32_t);
1097c478bd9Sstevel@tonic-gate extern void atomic_and_uint(volatile uint_t *, uint_t);
1107c478bd9Sstevel@tonic-gate extern void atomic_and_ulong(volatile ulong_t *, ulong_t);
1117c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_INT64_TYPE)
1127c478bd9Sstevel@tonic-gate extern void atomic_and_64(volatile uint64_t *, uint64_t);
1137c478bd9Sstevel@tonic-gate #endif
1147c478bd9Sstevel@tonic-gate 
1157c478bd9Sstevel@tonic-gate /*
1167c478bd9Sstevel@tonic-gate  * As above, but return the new value.  Note that these _nv() variants are
1177c478bd9Sstevel@tonic-gate  * substantially more expensive on some platforms than the no-return-value
1187c478bd9Sstevel@tonic-gate  * versions above, so don't use them unless you really need to know the
1197c478bd9Sstevel@tonic-gate  * new value *atomically* (e.g. when decrementing a reference count and
1207c478bd9Sstevel@tonic-gate  * checking whether it went to zero).
1217c478bd9Sstevel@tonic-gate  */
1227c478bd9Sstevel@tonic-gate 
1237c478bd9Sstevel@tonic-gate /*
1247c478bd9Sstevel@tonic-gate  * Increment target and return new value.
1257c478bd9Sstevel@tonic-gate  */
1267c478bd9Sstevel@tonic-gate extern uint8_t atomic_inc_8_nv(volatile uint8_t *);
1277c478bd9Sstevel@tonic-gate extern uchar_t atomic_inc_uchar_nv(volatile uchar_t *);
1287c478bd9Sstevel@tonic-gate extern uint16_t atomic_inc_16_nv(volatile uint16_t *);
1297c478bd9Sstevel@tonic-gate extern ushort_t atomic_inc_ushort_nv(volatile ushort_t *);
1307c478bd9Sstevel@tonic-gate extern uint32_t atomic_inc_32_nv(volatile uint32_t *);
1317c478bd9Sstevel@tonic-gate extern uint_t atomic_inc_uint_nv(volatile uint_t *);
1327c478bd9Sstevel@tonic-gate extern ulong_t atomic_inc_ulong_nv(volatile ulong_t *);
1337c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_INT64_TYPE)
1347c478bd9Sstevel@tonic-gate extern uint64_t atomic_inc_64_nv(volatile uint64_t *);
1357c478bd9Sstevel@tonic-gate #endif
1367c478bd9Sstevel@tonic-gate 
1377c478bd9Sstevel@tonic-gate /*
1387c478bd9Sstevel@tonic-gate  * Decrement target and return new value.
1397c478bd9Sstevel@tonic-gate  */
1407c478bd9Sstevel@tonic-gate extern uint8_t atomic_dec_8_nv(volatile uint8_t *);
1417c478bd9Sstevel@tonic-gate extern uchar_t atomic_dec_uchar_nv(volatile uchar_t *);
1427c478bd9Sstevel@tonic-gate extern uint16_t atomic_dec_16_nv(volatile uint16_t *);
1437c478bd9Sstevel@tonic-gate extern ushort_t atomic_dec_ushort_nv(volatile ushort_t *);
1447c478bd9Sstevel@tonic-gate extern uint32_t atomic_dec_32_nv(volatile uint32_t *);
1457c478bd9Sstevel@tonic-gate extern uint_t atomic_dec_uint_nv(volatile uint_t *);
1467c478bd9Sstevel@tonic-gate extern ulong_t atomic_dec_ulong_nv(volatile ulong_t *);
1477c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_INT64_TYPE)
1487c478bd9Sstevel@tonic-gate extern uint64_t atomic_dec_64_nv(volatile uint64_t *);
1497c478bd9Sstevel@tonic-gate #endif
1507c478bd9Sstevel@tonic-gate 
1517c478bd9Sstevel@tonic-gate /*
1527c478bd9Sstevel@tonic-gate  * Add delta to target
1537c478bd9Sstevel@tonic-gate  */
1547c478bd9Sstevel@tonic-gate extern uint8_t atomic_add_8_nv(volatile uint8_t *, int8_t);
1557c478bd9Sstevel@tonic-gate extern uchar_t atomic_add_char_nv(volatile uchar_t *, signed char);
1567c478bd9Sstevel@tonic-gate extern uint16_t atomic_add_16_nv(volatile uint16_t *, int16_t);
1577c478bd9Sstevel@tonic-gate extern ushort_t atomic_add_short_nv(volatile ushort_t *, short);
1587c478bd9Sstevel@tonic-gate extern uint32_t atomic_add_32_nv(volatile uint32_t *, int32_t);
1597c478bd9Sstevel@tonic-gate extern uint_t atomic_add_int_nv(volatile uint_t *, int);
1607c478bd9Sstevel@tonic-gate extern void *atomic_add_ptr_nv(volatile void *, ssize_t);
1617c478bd9Sstevel@tonic-gate extern ulong_t atomic_add_long_nv(volatile ulong_t *, long);
1627c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_INT64_TYPE)
1637c478bd9Sstevel@tonic-gate extern uint64_t atomic_add_64_nv(volatile uint64_t *, int64_t);
1647c478bd9Sstevel@tonic-gate #endif
1657c478bd9Sstevel@tonic-gate 
1667c478bd9Sstevel@tonic-gate /*
1677c478bd9Sstevel@tonic-gate  * logical OR bits with target and return new value.
1687c478bd9Sstevel@tonic-gate  */
1697c478bd9Sstevel@tonic-gate extern uint8_t atomic_or_8_nv(volatile uint8_t *, uint8_t);
1707c478bd9Sstevel@tonic-gate extern uchar_t atomic_or_uchar_nv(volatile uchar_t *, uchar_t);
1717c478bd9Sstevel@tonic-gate extern uint16_t atomic_or_16_nv(volatile uint16_t *, uint16_t);
1727c478bd9Sstevel@tonic-gate extern ushort_t atomic_or_ushort_nv(volatile ushort_t *, ushort_t);
1737c478bd9Sstevel@tonic-gate extern uint32_t atomic_or_32_nv(volatile uint32_t *, uint32_t);
1747c478bd9Sstevel@tonic-gate extern uint_t atomic_or_uint_nv(volatile uint_t *, uint_t);
1757c478bd9Sstevel@tonic-gate extern ulong_t atomic_or_ulong_nv(volatile ulong_t *, ulong_t);
1767c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_INT64_TYPE)
1777c478bd9Sstevel@tonic-gate extern uint64_t atomic_or_64_nv(volatile uint64_t *, uint64_t);
1787c478bd9Sstevel@tonic-gate #endif
1797c478bd9Sstevel@tonic-gate 
1807c478bd9Sstevel@tonic-gate /*
1817c478bd9Sstevel@tonic-gate  * logical AND bits with target and return new value.
1827c478bd9Sstevel@tonic-gate  */
1837c478bd9Sstevel@tonic-gate extern uint8_t atomic_and_8_nv(volatile uint8_t *, uint8_t);
1847c478bd9Sstevel@tonic-gate extern uchar_t atomic_and_uchar_nv(volatile uchar_t *, uchar_t);
1857c478bd9Sstevel@tonic-gate extern uint16_t atomic_and_16_nv(volatile uint16_t *, uint16_t);
1867c478bd9Sstevel@tonic-gate extern ushort_t atomic_and_ushort_nv(volatile ushort_t *, ushort_t);
1877c478bd9Sstevel@tonic-gate extern uint32_t atomic_and_32_nv(volatile uint32_t *, uint32_t);
1887c478bd9Sstevel@tonic-gate extern uint_t atomic_and_uint_nv(volatile uint_t *, uint_t);
1897c478bd9Sstevel@tonic-gate extern ulong_t atomic_and_ulong_nv(volatile ulong_t *, ulong_t);
1907c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_INT64_TYPE)
1917c478bd9Sstevel@tonic-gate extern uint64_t atomic_and_64_nv(volatile uint64_t *, uint64_t);
1927c478bd9Sstevel@tonic-gate #endif
1937c478bd9Sstevel@tonic-gate 
1947c478bd9Sstevel@tonic-gate /*
1957c478bd9Sstevel@tonic-gate  * If *arg1 == arg2, set *arg1 = arg3; return old value
1967c478bd9Sstevel@tonic-gate  */
1977c478bd9Sstevel@tonic-gate extern uint8_t atomic_cas_8(volatile uint8_t *, uint8_t, uint8_t);
1987c478bd9Sstevel@tonic-gate extern uchar_t atomic_cas_uchar(volatile uchar_t *, uchar_t, uchar_t);
1997c478bd9Sstevel@tonic-gate extern uint16_t atomic_cas_16(volatile uint16_t *, uint16_t, uint16_t);
2007c478bd9Sstevel@tonic-gate extern ushort_t atomic_cas_ushort(volatile ushort_t *, ushort_t, ushort_t);
2017c478bd9Sstevel@tonic-gate extern uint32_t atomic_cas_32(volatile uint32_t *, uint32_t, uint32_t);
2027c478bd9Sstevel@tonic-gate extern uint_t atomic_cas_uint(volatile uint_t *, uint_t, uint_t);
2037c478bd9Sstevel@tonic-gate extern void *atomic_cas_ptr(volatile void *, void *, void *);
2047c478bd9Sstevel@tonic-gate extern ulong_t atomic_cas_ulong(volatile ulong_t *, ulong_t, ulong_t);
2057c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_INT64_TYPE)
2067c478bd9Sstevel@tonic-gate extern uint64_t atomic_cas_64(volatile uint64_t *, uint64_t, uint64_t);
2077c478bd9Sstevel@tonic-gate #endif
2087c478bd9Sstevel@tonic-gate 
2097c478bd9Sstevel@tonic-gate /*
2107c478bd9Sstevel@tonic-gate  * Swap target and return old value
2117c478bd9Sstevel@tonic-gate  */
2127c478bd9Sstevel@tonic-gate extern uint8_t atomic_swap_8(volatile uint8_t *, uint8_t);
2137c478bd9Sstevel@tonic-gate extern uchar_t atomic_swap_uchar(volatile uchar_t *, uchar_t);
2147c478bd9Sstevel@tonic-gate extern uint16_t atomic_swap_16(volatile uint16_t *, uint16_t);
2157c478bd9Sstevel@tonic-gate extern ushort_t atomic_swap_ushort(volatile ushort_t *, ushort_t);
2167c478bd9Sstevel@tonic-gate extern uint32_t atomic_swap_32(volatile uint32_t *, uint32_t);
2177c478bd9Sstevel@tonic-gate extern uint_t atomic_swap_uint(volatile uint_t *, uint_t);
2187c478bd9Sstevel@tonic-gate extern void *atomic_swap_ptr(volatile void *, void *);
2197c478bd9Sstevel@tonic-gate extern ulong_t atomic_swap_ulong(volatile ulong_t *, ulong_t);
2207c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_INT64_TYPE)
2217c478bd9Sstevel@tonic-gate extern uint64_t atomic_swap_64(volatile uint64_t *, uint64_t);
2227c478bd9Sstevel@tonic-gate #endif
2237c478bd9Sstevel@tonic-gate 
2247c478bd9Sstevel@tonic-gate /*
2257c478bd9Sstevel@tonic-gate  * Perform an exclusive atomic bit set/clear on a target.
2267c478bd9Sstevel@tonic-gate  * Returns 0 if bit was sucessfully set/cleared, or -1
2277c478bd9Sstevel@tonic-gate  * if the bit was already set/cleared.
2287c478bd9Sstevel@tonic-gate  */
2297c478bd9Sstevel@tonic-gate extern int atomic_set_long_excl(volatile ulong_t *, uint_t);
2307c478bd9Sstevel@tonic-gate extern int atomic_clear_long_excl(volatile ulong_t *, uint_t);
2317c478bd9Sstevel@tonic-gate 
2327c478bd9Sstevel@tonic-gate /*
2337c478bd9Sstevel@tonic-gate  * Generic memory barrier used during lock entry, placed after the
2347c478bd9Sstevel@tonic-gate  * memory operation that acquires the lock to guarantee that the lock
2357c478bd9Sstevel@tonic-gate  * protects its data.  No stores from after the memory barrier will
2367c478bd9Sstevel@tonic-gate  * reach visibility, and no loads from after the barrier will be
2377c478bd9Sstevel@tonic-gate  * resolved, before the lock acquisition reaches global visibility.
2387c478bd9Sstevel@tonic-gate  */
2397c478bd9Sstevel@tonic-gate extern void membar_enter(void);
2407c478bd9Sstevel@tonic-gate 
2417c478bd9Sstevel@tonic-gate /*
2427c478bd9Sstevel@tonic-gate  * Generic memory barrier used during lock exit, placed before the
2437c478bd9Sstevel@tonic-gate  * memory operation that releases the lock to guarantee that the lock
2447c478bd9Sstevel@tonic-gate  * protects its data.  All loads and stores issued before the barrier
2457c478bd9Sstevel@tonic-gate  * will be resolved before the subsequent lock update reaches visibility.
2467c478bd9Sstevel@tonic-gate  */
2477c478bd9Sstevel@tonic-gate extern void membar_exit(void);
2487c478bd9Sstevel@tonic-gate 
2497c478bd9Sstevel@tonic-gate /*
2507c478bd9Sstevel@tonic-gate  * Arrange that all stores issued before this point in the code reach
2517c478bd9Sstevel@tonic-gate  * global visibility before any stores that follow; useful in producer
2527c478bd9Sstevel@tonic-gate  * modules that update a data item, then set a flag that it is available.
2537c478bd9Sstevel@tonic-gate  * The memory barrier guarantees that the available flag is not visible
2547c478bd9Sstevel@tonic-gate  * earlier than the updated data, i.e. it imposes store ordering.
2557c478bd9Sstevel@tonic-gate  */
2567c478bd9Sstevel@tonic-gate extern void membar_producer(void);
2577c478bd9Sstevel@tonic-gate 
2587c478bd9Sstevel@tonic-gate /*
2597c478bd9Sstevel@tonic-gate  * Arrange that all loads issued before this point in the code are
2607c478bd9Sstevel@tonic-gate  * completed before any subsequent loads; useful in consumer modules
2617c478bd9Sstevel@tonic-gate  * that check to see if data is available and read the data.
2627c478bd9Sstevel@tonic-gate  * The memory barrier guarantees that the data is not sampled until
2637c478bd9Sstevel@tonic-gate  * after the available flag has been seen, i.e. it imposes load ordering.
2647c478bd9Sstevel@tonic-gate  */
2657c478bd9Sstevel@tonic-gate extern void membar_consumer(void);
2667c478bd9Sstevel@tonic-gate 
2677c478bd9Sstevel@tonic-gate #if defined(_KERNEL)
2687c478bd9Sstevel@tonic-gate 
2697c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_ILP32)
2707c478bd9Sstevel@tonic-gate #define	atomic_add_ip		atomic_add_long
2717c478bd9Sstevel@tonic-gate #define	atomic_add_ip_nv	atomic_add_long_nv
2727c478bd9Sstevel@tonic-gate #define	casip			atomic_cas_ulong
2737c478bd9Sstevel@tonic-gate #endif
2747c478bd9Sstevel@tonic-gate 
2757c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
2767c478bd9Sstevel@tonic-gate 
2777c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
2787c478bd9Sstevel@tonic-gate }
2797c478bd9Sstevel@tonic-gate #endif
2807c478bd9Sstevel@tonic-gate 
2817c478bd9Sstevel@tonic-gate #endif	/* _SYS_ATOMIC_H */
282