svn commit: r261722 - head/sys/sys

Gleb Smirnoff glebius at FreeBSD.org
Mon Feb 10 19:47:15 UTC 2014


Author: glebius
Date: Mon Feb 10 19:47:14 2014
New Revision: 261722
URL: http://svnweb.freebsd.org/changeset/base/261722

Log:
  Add zpcpu_get_cpu() that converts base pointer of UMA_ZPCPU_ZONE
  to a pointer private to a given cpuid.
  
  Sponsored by:	Nginx, Inc.

Modified:
  head/sys/sys/pcpu.h

Modified: head/sys/sys/pcpu.h
==============================================================================
--- head/sys/sys/pcpu.h	Mon Feb 10 17:41:40 2014	(r261721)
+++ head/sys/sys/pcpu.h	Mon Feb 10 19:47:14 2014	(r261722)
@@ -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


More information about the svn-src-all mailing list