aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/ndis/subr_ntoskrnl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/ndis/subr_ntoskrnl.c')
-rw-r--r--sys/compat/ndis/subr_ntoskrnl.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/compat/ndis/subr_ntoskrnl.c b/sys/compat/ndis/subr_ntoskrnl.c
index 5278bc2752da..72f1f11904f3 100644
--- a/sys/compat/ndis/subr_ntoskrnl.c
+++ b/sys/compat/ndis/subr_ntoskrnl.c
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
#include <sys/callout.h>
#include <sys/kernel.h>
+#include <machine/atomic.h>
#include <machine/clock.h>
#include <machine/bus_memio.h>
#include <machine/bus_pio.h>
@@ -578,10 +579,7 @@ ntoskrnl_interlock_inc(/*addend*/ void)
__asm__ __volatile__ ("" : "=c" (addend));
- mtx_lock(&ntoskrnl_interlock);
- (*addend)++;
- mtx_unlock(&ntoskrnl_interlock);
-
+ atomic_add_long((volatile u_long *)addend, 1);
return(*addend);
}
@@ -592,10 +590,7 @@ ntoskrnl_interlock_dec(/*addend*/ void)
__asm__ __volatile__ ("" : "=c" (addend));
- mtx_lock(&ntoskrnl_interlock);
- (*addend)--;
- mtx_unlock(&ntoskrnl_interlock);
-
+ atomic_subtract_long((volatile u_long *)addend, 1);
return(*addend);
}