Module Name:    src
Committed By:   christos
Date:           Thu Jan  8 16:13:07 UTC 2015

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

Log Message:
PR/49104: Jarle Greipsland: Don't use cpu_counter32() unconditionally.
XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/kern/kern_rndq.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_rndq.c
diff -u src/sys/kern/kern_rndq.c:1.28 src/sys/kern/kern_rndq.c:1.29
--- src/sys/kern/kern_rndq.c:1.28	Sun Oct 26 14:22:32 2014
+++ src/sys/kern/kern_rndq.c	Thu Jan  8 11:13:07 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndq.c,v 1.28 2014/10/26 18:22:32 tls Exp $	*/
+/*	$NetBSD: kern_rndq.c,v 1.29 2015/01/08 16:13:07 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_rndq.c,v 1.28 2014/10/26 18:22:32 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_rndq.c,v 1.29 2015/01/08 16:13:07 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -222,7 +222,8 @@ rnd_counter(void)
 	uint32_t ret;
 
 #if defined(__HAVE_CPU_COUNTER)
-	return (cpu_counter32());
+	if (cpu_hascounter())
+		return cpu_counter32();
 #endif
 	if (rnd_ready) {
 		nanouptime(&ts);

Reply via email to