The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/arm/include/atomic.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* $NetBSD: atomic.h,v 1.1 2002/10/19 12:22:34 bsh Exp $ */
    2 
    3 /*-
    4  * Copyright (C) 2003-2004 Olivier Houchard
    5  * Copyright (C) 1994-1997 Mark Brinicombe
    6  * Copyright (C) 1994 Brini
    7  * All rights reserved.
    8  *
    9  * This code is derived from software written for Brini by Mark Brinicombe
   10  *
   11  * Redistribution and use in source and binary forms, with or without
   12  * modification, are permitted provided that the following conditions
   13  * are met:
   14  * 1. Redistributions of source code must retain the above copyright
   15  *    notice, this list of conditions and the following disclaimer.
   16  * 2. Redistributions in binary form must reproduce the above copyright
   17  *    notice, this list of conditions and the following disclaimer in the
   18  *    documentation and/or other materials provided with the distribution.
   19  * 3. All advertising materials mentioning features or use of this software
   20  *    must display the following acknowledgement:
   21  *      This product includes software developed by Brini.
   22  * 4. The name of Brini may not be used to endorse or promote products
   23  *    derived from this software without specific prior written permission.
   24  *
   25  * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR
   26  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   27  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   28  * IN NO EVENT SHALL BRINI BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   29  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
   30  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
   31  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
   32  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
   33  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
   34  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   35  *
   36  * $FreeBSD: releng/11.1/sys/arm/include/atomic.h 315371 2017-03-16 06:00:27Z mjg $
   37  */
   38 
   39 #ifndef _MACHINE_ATOMIC_H_
   40 #define _MACHINE_ATOMIC_H_
   41 
   42 #include <machine/armreg.h>
   43 
   44 #ifndef _KERNEL
   45 #include <machine/sysarch.h>
   46 #endif
   47 
   48 #if __ARM_ARCH >= 6
   49 #include <machine/atomic-v6.h>
   50 #else /* < armv6 */
   51 #include <machine/atomic-v4.h>
   52 #endif /* Arch >= v6 */
   53 
   54 static __inline int
   55 atomic_load_32(volatile uint32_t *v)
   56 {
   57 
   58         return (*v);
   59 }
   60 
   61 static __inline void
   62 atomic_store_32(volatile uint32_t *dst, uint32_t src)
   63 {
   64         *dst = src;
   65 }
   66 
   67 static __inline int
   68 atomic_load_long(volatile u_long *v)
   69 {
   70 
   71         return (*v);
   72 }
   73 
   74 static __inline void
   75 atomic_store_long(volatile u_long *dst, u_long src)
   76 {
   77         *dst = src;
   78 }
   79 
   80 #define atomic_clear_ptr                atomic_clear_32
   81 #define atomic_set_ptr                  atomic_set_32
   82 #define atomic_fcmpset_ptr              atomic_fcmpset_32
   83 #define atomic_fcmpset_rel_ptr          atomic_fcmpset_rel_32
   84 #define atomic_fcmpset_acq_ptr          atomic_fcmpset_acq_32
   85 #define atomic_cmpset_ptr               atomic_cmpset_32
   86 #define atomic_cmpset_rel_ptr           atomic_cmpset_rel_32
   87 #define atomic_cmpset_acq_ptr           atomic_cmpset_acq_32
   88 #define atomic_store_ptr                atomic_store_32
   89 #define atomic_store_rel_ptr            atomic_store_rel_32
   90 
   91 #define atomic_add_int                  atomic_add_32
   92 #define atomic_add_acq_int              atomic_add_acq_32
   93 #define atomic_add_rel_int              atomic_add_rel_32
   94 #define atomic_subtract_int             atomic_subtract_32
   95 #define atomic_subtract_acq_int         atomic_subtract_acq_32
   96 #define atomic_subtract_rel_int         atomic_subtract_rel_32
   97 #define atomic_clear_int                atomic_clear_32
   98 #define atomic_clear_acq_int            atomic_clear_acq_32
   99 #define atomic_clear_rel_int            atomic_clear_rel_32
  100 #define atomic_set_int                  atomic_set_32
  101 #define atomic_set_acq_int              atomic_set_acq_32
  102 #define atomic_set_rel_int              atomic_set_rel_32
  103 #define atomic_fcmpset_int              atomic_fcmpset_32
  104 #define atomic_fcmpset_acq_int          atomic_fcmpset_acq_32
  105 #define atomic_fcmpset_rel_int          atomic_fcmpset_rel_32
  106 #define atomic_cmpset_int               atomic_cmpset_32
  107 #define atomic_cmpset_acq_int           atomic_cmpset_acq_32
  108 #define atomic_cmpset_rel_int           atomic_cmpset_rel_32
  109 #define atomic_fetchadd_int             atomic_fetchadd_32
  110 #define atomic_readandclear_int         atomic_readandclear_32
  111 #define atomic_load_acq_int             atomic_load_acq_32
  112 #define atomic_store_rel_int            atomic_store_rel_32
  113 #define atomic_swap_int                 atomic_swap_32
  114 
  115 #endif /* _MACHINE_ATOMIC_H_ */

Cache object: 9fc09d913c99b84cb9c0760eca3e6a3a


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.