[BACK]Return to atomic.h CVS log [TXT][DIR] Up to [local] / sys / arch / m68k / include

Annotation of sys/arch/m68k/include/atomic.h, Revision 1.1

1.1     ! nbrk        1: /*     $OpenBSD: atomic.h,v 1.3 2007/03/21 05:28:20 miod Exp $ */
        !             2:
        !             3: /* Public Domain */
        !             4:
        !             5: #ifndef __M68K_ATOMIC_H__
        !             6: #define __M68K_ATOMIC_H__
        !             7:
        !             8: #if defined(_KERNEL)
        !             9:
        !            10: static __inline void
        !            11: atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
        !            12: {
        !            13:        unsigned int witness, old, new;
        !            14:
        !            15:        do {
        !            16:                witness = old = *uip;
        !            17:                new = old | v;
        !            18:                __asm__ __volatile__ (
        !            19:                        "casl %0, %2, %1" : "+d"(old), "=m"(*uip) : "d"(new));
        !            20:        } while (old != witness);
        !            21: }
        !            22:
        !            23: static __inline void
        !            24: atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
        !            25: {
        !            26:        unsigned int witness, old, new;
        !            27:
        !            28:        do {
        !            29:                witness = old = *uip;
        !            30:                new = old & ~v;
        !            31:                __asm__ __volatile__ (
        !            32:                        "casl %0, %2, %1" : "+d"(old), "=m"(*uip) : "d"(new));
        !            33:        } while (old != witness);
        !            34: }
        !            35:
        !            36: #endif /* defined(_KERNEL) */
        !            37: #endif /* __M68K_ATOMIC_H__ */

CVSweb