aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/pcpu.h
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2014-02-10 19:47:14 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2014-02-10 19:47:14 +0000
commit9188e408cc9fd503e23dd1c7ed5d797c8bc57abd (patch)
treef37cfea99e1ec6764d5a510084bf0f13e234a7e1 /sys/sys/pcpu.h
parent2ccd462b167bb32d114d3d8a32cf45db6a4a6a9b (diff)
downloadsrc-9188e408cc9fd503e23dd1c7ed5d797c8bc57abd.tar.gz
src-9188e408cc9fd503e23dd1c7ed5d797c8bc57abd.zip
Add zpcpu_get_cpu() that converts base pointer of UMA_ZPCPU_ZONE
to a pointer private to a given cpuid. Sponsored by: Nginx, Inc.
Notes
Notes: svn path=/head/; revision=261722
Diffstat (limited to 'sys/sys/pcpu.h')
-rw-r--r--sys/sys/pcpu.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h
index c73cc5364a62..57ffdb0372d0 100644
--- a/sys/sys/pcpu.h
+++ b/sys/sys/pcpu.h
@@ -210,6 +210,13 @@ zpcpu_get(void *base)
return ((char *)(base) + sizeof(struct pcpu) * curcpu);
}
+static inline void *
+zpcpu_get_cpu(void *base, int cpu)
+{
+
+ return ((char *)(base) + sizeof(struct pcpu) * cpu);
+}
+
/*
* Machine dependent callouts. cpu_pcpu_init() is responsible for
* initializing machine dependent fields of struct pcpu, and