blob: 4ff15e2e49ceed9113761cd6d585f4cde1f56d9c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
/* $OpenBSD: atomic.h,v 1.5 2011/03/23 16:54:37 pirofti Exp $ */
/* Public Domain */
#ifndef _MACHINE_ATOMIC_H_
#define _MACHINE_ATOMIC_H_
#if defined(_KERNEL)
#include <machine/mtpr.h>
#include <machine/intr.h>
static __inline void
atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
{
int s;
s = splhigh();
*uip |= v;
splx(s);
}
static __inline void
atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
{
int s;
s = splhigh();
*uip &= ~v;
splx(s);
}
#endif /* defined(_KERNEL) */
#endif /* _MACHINE_ATOMIC_H_ */
|