PERFORCE change 95764 for review

John Birrell jb at FreeBSD.org
Fri Apr 21 07:05:41 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=95764

Change 95764 by jb at jb_freebsd2 on 2006/04/21 07:04:52

	Add a new system header for CPU variables. This file is named
	the same way as Sun's file and it has their license. It has to
	exist as a separate file so that it can retain their license.
	I don't think it's possible to add CDDL restricted code to
	BSD licensed files.
	
	The array of cpu_core structures is explicitly for DTrace. The
	entire array must be mapped across all processors so that 
	DTrace running on one processor can trace a process running on
	a different processor. The array exists as a global variable
	because that's how Sun's code accesses it.

Affected files ...

.. //depot/projects/dtrace/src/sys/kern/subr_pcpu.c#2 edit
.. //depot/projects/dtrace/src/sys/sys/cpuvar.h#1 add

Differences ...

==== //depot/projects/dtrace/src/sys/kern/subr_pcpu.c#2 (text+ko) ====

@@ -46,6 +46,7 @@
 __FBSDID("$FreeBSD: src/sys/kern/subr_pcpu.c,v 1.8 2005/11/03 21:06:29 jhb Exp $");
 
 #include "opt_ddb.h"
+#include "opt_kdtrace.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -59,6 +60,12 @@
 static struct pcpu *cpuid_to_pcpu[MAXCPU];
 struct cpuhead cpuhead = SLIST_HEAD_INITIALIZER(cpuhead);
 
+#ifdef KDTRACE
+#include <sys/cpuvar.h>
+
+cpu_core_t	cpu_core[MAXCPU];
+#endif
+
 /*
  * Initialize the MI portions of a struct pcpu.
  */


More information about the p4-projects mailing list