Annotation of sys/arch/arm/include/atomic.h, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: atomic.h,v 1.5 2007/03/17 23:42:06 drahn Exp $ */
2:
3: /* Public Domain */
4:
5: #ifndef __ARM_ATOMIC_H__
6: #define __ARM_ATOMIC_H__
7:
8: #if defined(_KERNEL)
9:
10: /*
11: * on pre-v6 arm processors, it is necessary to disable interrupts if
12: * in the kernel and atomic updates are necessary without full mutexes
13: */
14:
15: static __inline void
16: atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
17: {
18: int oldirqstate;
19: oldirqstate = disable_interrupts(I32_bit|F32_bit);
20: *uip |= v;
21: restore_interrupts(oldirqstate);
22: }
23:
24: static __inline void
25: atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
26: {
27: int oldirqstate;
28: oldirqstate = disable_interrupts(I32_bit|F32_bit);
29: *uip &= ~v;
30: restore_interrupts(oldirqstate);
31: }
32:
33: #endif /* defined(_KERNEL) */
34: #endif /* __ARM_ATOMIC_H__ */
CVSweb