Annotation of sys/arch/mips64/include/atomic.h, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: atomic.h,v 1.3 2007/03/23 21:07:36 miod Exp $ */
2:
3: /* Public Domain */
4:
5: #ifndef __MIPS64_ATOMIC_H__
6: #define __MIPS64_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 tmp;
14:
15: __asm__ __volatile__ (
16: "1: ll %0, 0(%1)\n"
17: " or %0, %2, %0\n"
18: " sc %0, 0(%1)\n"
19: " beqz %0, 1b\n"
20: " nop\n" :
21: "+r"(tmp) :
22: "r"(uip), "r"(v) : "memory");
23: }
24:
25: static __inline void
26: atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
27: {
28: unsigned int tmp;
29:
30: __asm__ __volatile__ (
31: "1: ll %0, 0(%1)\n"
32: " and %0, %2, %0\n"
33: " sc %0, 0(%1)\n"
34: " beqz %0, 1b\n"
35: " nop\n" :
36: "+r"(tmp) :
37: "r"(uip), "r"(~v) : "memory");
38: }
39:
40: #endif /* defined(_KERNEL) */
41: #endif /* __MIPS64_ATOMIC_H__ */
CVSweb