Module Name:    src
Committed By:   matt
Date:           Wed Dec 22 02:43:23 UTC 2010

Modified Files:
        src/sys/kern: kern_cpu.c

Log Message:
Add CTASSERT to verify __HAVE_CPU_DATA_FIRST is correct defined or undefined.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/kern/kern_cpu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_cpu.c
diff -u src/sys/kern/kern_cpu.c:1.44 src/sys/kern/kern_cpu.c:1.45
--- src/sys/kern/kern_cpu.c:1.44	Sun Apr 25 15:57:59 2010
+++ src/sys/kern/kern_cpu.c	Wed Dec 22 02:43:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_cpu.c,v 1.44 2010/04/25 15:57:59 ad Exp $	*/
+/*	$NetBSD: kern_cpu.c,v 1.45 2010/12/22 02:43:23 matt Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.44 2010/04/25 15:57:59 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.45 2010/12/22 02:43:23 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -79,6 +79,17 @@
 
 #include <uvm/uvm_extern.h>
 
+/*
+ * If the port has state that cpu_data is the first thing in cpu_info,
+ * verify the claim is true.  This will prevent the from getting out
+ * of sync.
+ */
+#ifdef __HAVE_CPU_DATA_FIRST
+CTASSERT(offsetof(struct cpu_info, ci_data) == 0);
+#else
+CTASSERT(offsetof(struct cpu_info, ci_data) != 0);
+#endif
+
 void	cpuctlattach(int);
 
 static void	cpu_xc_online(struct cpu_info *);

Reply via email to