? vi.core
Index: arch/i386.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/cpuctl/arch/i386.c,v
retrieving revision 1.14
diff -p -r1.14 i386.c
*** arch/i386.c	16 Dec 2008 22:44:51 -0000	1.14
--- arch/i386.c	23 Feb 2009 01:34:21 -0000
*************** struct cpu_cpuid_nameclass {
*** 133,139 ****
  		void (*cpu_setup)(struct cpu_info *);
  		void (*cpu_probe)(struct cpu_info *);
  		void (*cpu_info)(struct cpu_info *);
! 	} cpu_family[CPU_MAXFAMILY - CPU_MINFAMILY + 1];
  };
  
  static const struct x86_cache_info intel_cpuid_cache_info[] = INTEL_CACHE_INFO;
--- 133,139 ----
  		void (*cpu_setup)(struct cpu_info *);
  		void (*cpu_probe)(struct cpu_info *);
  		void (*cpu_info)(struct cpu_info *);
! 	} cpu_family[CPU_MAXFAMILY - CPU_MINFAMILY + 1 /* XXX */ + 1];
  };
  
  static const struct x86_cache_info intel_cpuid_cache_info[] = INTEL_CACHE_INFO;
*************** const struct cpu_cpuid_nameclass i386_cp
*** 303,308 ****
--- 303,323 ----
  			NULL,
  			intel_family_new_probe,
  			NULL,
+ 		},
+ 		/* Extended Model 1, Family 6 */
+ 		{
+ 			CPUCLASS_686,
+ 			{
+ 				0, 0, 0, 0, 0, 0, 0,
+ 				"Core2 (Yorkfield)",
+ 				0, 0, 
+ 				"Core2 (Wolfdale)",
+ 				0, 0, 0, 0, 0,
+ 				"Core2"	/* Default */
+ 			},
+ 			NULL,
+ 			intel_family_new_probe,
+ 			NULL,
  		} }
  	},
  	{
*************** identifycpu(const char *cpuname)
*** 1183,1189 ****
  {
  	const char *name, *modifier, *vendorname, *brand = "";
  	int class = CPUCLASS_386, i, xmax;
! 	int modif, family, model;
  	const struct cpu_cpuid_nameclass *cpup = NULL;
  	const struct cpu_cpuid_family *cpufam;
  	const char *feature_str[5];
--- 1198,1204 ----
  {
  	const char *name, *modifier, *vendorname, *brand = "";
  	int class = CPUCLASS_386, i, xmax;
! 	int modif, family, model, extmodel;
  	const struct cpu_cpuid_nameclass *cpup = NULL;
  	const struct cpu_cpuid_family *cpufam;
  	const char *feature_str[5];
*************** identifycpu(const char *cpuname)
*** 1216,1221 ****
--- 1231,1237 ----
  		family = CPUID2FAMILY(ci->ci_signature);
  		if (family < CPU_MINFAMILY)
  			errx(1, "identifycpu: strange family value");
+ 		extmodel = CPUID2EXTMODEL(ci->ci_signature);
  		model = CPUID2MODEL(ci->ci_signature);
  
  		for (i = 0; i < xmax; i++) {
*************** identifycpu(const char *cpuname)
*** 1242,1248 ****
  			cpu_vendor = cpup->cpu_vendor;
  			vendorname = cpup->cpu_vendorname;
  			modifier = modifiers[modif];
! 			if (family > CPU_MAXFAMILY) {
  				family = CPU_MAXFAMILY;
  				model = CPU_DEFMODEL;
  			} else if (model > CPU_MAXMODEL)
--- 1258,1269 ----
  			cpu_vendor = cpup->cpu_vendor;
  			vendorname = cpup->cpu_vendorname;
  			modifier = modifiers[modif];
! 			if (cpu_vendor == CPUVENDOR_INTEL) {
! 				/* XXX */
! 				if (extmodel == 1 && family == 6) {
! 					family = CPU_MAXFAMILY + 1;
! 				}
! 			} else if (family > CPU_MAXFAMILY) {
  				family = CPU_MAXFAMILY;
  				model = CPU_DEFMODEL;
  			} else if (model > CPU_MAXMODEL)