/* $OpenBSD: atomic.h,v 1.6 2014/03/29 18:09:30 guenther Exp $ */ /* Public Domain */ #ifndef _MACHINE_ATOMIC_H_ #define _MACHINE_ATOMIC_H_ #if defined(_KERNEL) #include static __inline void atomic_setbits_int(volatile unsigned int *uip, unsigned int v) { int psr; psr = getpsr(); setpsr(psr | PSR_PIL); *uip |= v; setpsr(psr); } static __inline void atomic_clearbits_int(volatile unsigned int *uip, unsigned int v) { int psr; psr = getpsr(); setpsr(psr | PSR_PIL); *uip &= ~v; setpsr(psr); } #endif /* defined(_KERNEL) */ #endif /* _MACHINE_ATOMIC_H_ */