Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Feb 2014 19:47:14 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r261722 - head/sys/sys
Message-ID:  <201402101947.s1AJlE9Q083760@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402101947.s1AJlE9Q083760>