Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Add a KASSERT



details:   https://anonhg.NetBSD.org/src/rev/b25c4a235783
branches:  trunk
changeset: 764226:b25c4a235783
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Apr 14 05:53:53 2011 +0000

description:
Add a KASSERT

diffstat:

 sys/kern/subr_percpu.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r c26432828dc8 -r b25c4a235783 sys/kern/subr_percpu.c
--- a/sys/kern/subr_percpu.c    Thu Apr 14 05:51:27 2011 +0000
+++ b/sys/kern/subr_percpu.c    Thu Apr 14 05:53:53 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_percpu.c,v 1.10 2009/10/21 21:12:06 rmind Exp $   */
+/*     $NetBSD: subr_percpu.c,v 1.11 2011/04/14 05:53:53 matt Exp $    */
 
 /*-
  * Copyright (c)2007,2008 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_percpu.c,v 1.10 2009/10/21 21:12:06 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_percpu.c,v 1.11 2011/04/14 05:53:53 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -90,10 +90,11 @@
        percpu_cpu_t * const newpcc = p2;
        percpu_cpu_t * const pcc = cpu_percpu(ci);
 
+       KASSERT(ci == curcpu());
+
        /*
         * swap *pcc and *newpcc unless anyone has beaten us.
         */
-
        rw_enter(&percpu_swap_lock, RW_WRITER);
        if (newpcc->pcc_size > pcc->pcc_size) {
                percpu_cpu_t tmp;



Home | Main Index | Thread Index | Old Index