aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/pcpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sys/pcpu.h')
-rw-r--r--sys/sys/pcpu.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h
index afccd9ec26f2..f859d09554c0 100644
--- a/sys/sys/pcpu.h
+++ b/sys/sys/pcpu.h
@@ -256,6 +256,24 @@ extern struct pcpu *cpuid_to_pcpu[];
_old; \
})
+#define zpcpu_set_protected(base, val) ({ \
+ MPASS(curthread->td_critnest > 0); \
+ __typeof(val) *_ptr = zpcpu_get(base); \
+ *_ptr = (val); \
+})
+
+#define zpcpu_add_protected(base, val) ({ \
+ MPASS(curthread->td_critnest > 0); \
+ __typeof(val) *_ptr = zpcpu_get(base); \
+ *_ptr += (val); \
+})
+
+#define zpcpu_sub_protected(base, val) ({ \
+ MPASS(curthread->td_critnest > 0); \
+ __typeof(val) *_ptr = zpcpu_get(base); \
+ *_ptr -= (val); \
+})
+
/*
* Machine dependent callouts. cpu_pcpu_init() is responsible for
* initializing machine dependent fields of struct pcpu, and