Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/amd64/amd64 Do not check more than 32 bits against ...



details:   https://anonhg.NetBSD.org/src/rev/ddc4ca8ef65f
branches:  trunk
changeset: 750922:ddc4ca8ef65f
user:      njoly <njoly%NetBSD.org@localhost>
date:      Mon Jan 18 21:55:40 2010 +0000

description:
Do not check more than 32 bits against ci_feature_flags, to avoid printing
bogus data on /proc/cpuinfo flags line.

diffstat:

 sys/arch/amd64/amd64/procfs_machdep.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 082f9d08a2e3 -r ddc4ca8ef65f sys/arch/amd64/amd64/procfs_machdep.c
--- a/sys/arch/amd64/amd64/procfs_machdep.c     Mon Jan 18 21:48:15 2010 +0000
+++ b/sys/arch/amd64/amd64/procfs_machdep.c     Mon Jan 18 21:55:40 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs_machdep.c,v 1.12 2009/08/16 11:04:48 yamt Exp $ */
+/*     $NetBSD: procfs_machdep.c,v 1.13 2010/01/18 21:55:40 njoly Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.12 2009/08/16 11:04:48 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.13 2010/01/18 21:55:40 njoly Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -151,7 +151,7 @@
 
        p = featurebuf;
        left = sizeof featurebuf;
-       for (i = 0; i < sizeof(i386_features)/sizeof(*i386_features); i++) {
+       for (i = 0; i < 32; i++) {
                if ((ci->ci_feature_flags & (1 << i)) &&
                    (i386_features[i] != NULL)) {
                        l = snprintf(p, left, "%s ", i386_features[i]);



Home | Main Index | Thread Index | Old Index