Module Name:    src
Committed By:   msaitoh
Date:           Mon Jan 18 05:59:37 UTC 2016

Modified Files:
        src/sys/arch/x86/x86: procfs_machdep.c

Log Message:
Add comments. Fix comments. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x86/x86/procfs_machdep.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/arch/x86/x86/procfs_machdep.c
diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.9 src/sys/arch/x86/x86/procfs_machdep.c:1.10
--- src/sys/arch/x86/x86/procfs_machdep.c:1.9	Wed Jan 13 08:05:58 2016
+++ src/sys/arch/x86/x86/procfs_machdep.c	Mon Jan 18 05:59:37 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_machdep.c,v 1.9 2016/01/13 08:05:58 msaitoh Exp $ */
+/*	$NetBSD: procfs_machdep.c,v 1.10 2016/01/18 05:59:37 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.9 2016/01/13 08:05:58 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.10 2016/01/18 05:59:37 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -56,8 +56,12 @@ __KERNEL_RCSID(0, "$NetBSD: procfs_machd
 #include <machine/reg.h>
 #include <machine/specialreg.h>
 
+/*
+ *  The feature table. The order is the saame as Linux's
+ *  x86/include/asm/cpufeatures.h.
+ */
 static const char * const x86_features[][32] = {
-	{ /* Common */
+	{ /* (0) Common */
 	"fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
 	"cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
 	"pat", "pse36", "pn", "clflush", NULL, "dts", "acpi", "mmx",
@@ -69,13 +73,13 @@ static const char * const x86_features[]
 	NULL, NULL, NULL, "mp", "nx", NULL, "mmxext", NULL,
 	NULL, "fxsr_opt", "pdpe1gb", "rdtscp", NULL, "lm", "3dnowext","3dnow"},
 
-	{ /* Transmeta-defined (2) */
+	{ /* (2) Transmeta-defined */
 	"recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 
-	{ /* Linux-defined (3) */
+	{ /* (3) Linux mapping */
 	"cxmmx", NULL, "cyrix_arr", "centaur_mcr", NULL,
 	"constant_tsc", NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -103,7 +107,7 @@ static const char * const x86_features[]
 	NULL, "tbm", "topoext", "perfctr_core",
 	"perfctr_nb", NULL, "bpext", NULL, "perfctr_l2", "mwaitx", NULL, NULL},
 
-	{ /* (7) Linux-defined */
+	{ /* (7) Linux mapping */
 	"ida", "arat", "cpb", "ebp", NULL, "pln", "pts", "dtherm",
 	"hw_pstate", "proc_feedback", "hwp", "hwp_notify", "hwp_act_window",
 	"hwp_epp", "hwp_pkg_req", "intel_pt",
@@ -126,19 +130,19 @@ static const char * const x86_features[]
 	"clwb", NULL, "avx512pf", "avx512er",
 	"avx512cd", "sha_ni", NULL, NULL},
 
-	{ /* (10) 0000000d eax*/
+	{ /* (10) 0000000d eax */
 	"xsaveopt", "xsavec", "xgetbv1", "xsaves", NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 
-	{ /* (11) 0x0000000f:0 edx*/
+	{ /* (11) 0x0000000f:0 edx */
 	NULL, "cqm_llc", NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 
-	{ /* (12) 0x0000000f:1 edx*/
+	{ /* (12) 0x0000000f:1 edx */
 	"cqm_occup_llc", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -200,7 +204,7 @@ procfs_getonefeatreg(uint32_t reg, const
 }
 
 /*
- * Print feature bit. The code assume that unused entry of x86_features[]
+ * Print feature bits. The code assume that unused entry of x86_features[]
  * is zero-cleared.
  *
  * XXX This function will be rewritten when all of linux entries are
@@ -241,6 +245,10 @@ procfs_getonecpufeatures(struct cpu_info
 	    left);
 	diff = last - *left;
 
+	/* (10) 0000000d eax */
+	/* (11) 0x0000000f(ecx=0) edx */
+	/* (12) 0x0000000f(ecx=1) edx */
+
 	return 0; /* XXX */
 }
 

Reply via email to