Annotation of sys/arch/sparc/include/atomic.h, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: atomic.h,v 1.3 2007/04/27 19:22:47 miod Exp $ */
! 2:
! 3: /* Public Domain */
! 4:
! 5: #ifndef __SPARC_ATOMIC_H__
! 6: #define __SPARC_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: int psr;
! 14:
! 15: psr = getpsr();
! 16: setpsr(psr | PSR_PIL);
! 17: *uip |= v;
! 18: setpsr(psr);
! 19: }
! 20:
! 21: static __inline void
! 22: atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
! 23: {
! 24: int psr;
! 25:
! 26: psr = getpsr();
! 27: setpsr(psr | PSR_PIL);
! 28: *uip &= ~v;
! 29: setpsr(psr);
! 30: }
! 31:
! 32: #endif /* defined(_KERNEL) */
! 33: #endif /* __SPARC_ATOMIC_H__ */
CVSweb