Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Mar 2007 14:42:23 GMT
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 116834 for review
Message-ID:  <200703291442.l2TEgNVs039617@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=116834

Change 116834 by gonzo@gonzo_jeeves on 2007/03/29 14:41:43

	o Fill new cpuinfo fields with values based on config0 and 
	    config1.

Affected files ...

.. //depot/projects/mips2/src/sys/mips/mips/cpu.c#17 edit

Differences ...

==== //depot/projects/mips2/src/sys/mips/mips/cpu.c#17 (text+ko) ====

@@ -138,6 +138,7 @@
     cfg0 = mips_rd_config();
 
     cpuinfo->tlb_type = ((cfg0 & MIPS_CONFIG0_MT_MASK) >> MIPS_CONFIG0_MT_SHIFT);
+    cpuinfo->icache_virtual = cfg0 & MIPS_CONFIG0_VI;
 
     /* If config register selection 1 does not exist, exit. */
     if (!(cfg0 & MIPS3_CONFIG_CM))
@@ -153,6 +154,8 @@
 	cpuinfo->l1.ic_linesize = tmp;
 	cpuinfo->l1.ic_nways = (((cfg1 & MIPS_CONFIG1_IA_MASK) >> MIPS_CONFIG1_IA_SHIFT)) + 1;
 	cpuinfo->l1.ic_nsets = 1 << (((cfg1 & MIPS_CONFIG1_IS_MASK) >> MIPS_CONFIG1_IS_SHIFT) + 6);
+	cpuinfo->l1.ic_size = cpuinfo->l1.ic_linesize * cpuinfo->l1.ic_nsets 
+	    * cpuinfo->l1.ic_nways;
     }
 
     /* L1 data cache. */
@@ -161,6 +164,8 @@
 	cpuinfo->l1.dc_linesize = tmp;
 	cpuinfo->l1.dc_nways = (((cfg1 & MIPS_CONFIG1_DA_MASK) >> MIPS_CONFIG1_DA_SHIFT)) + 1;
 	cpuinfo->l1.dc_nsets = 1 << (((cfg1 & MIPS_CONFIG1_DS_MASK) >> MIPS_CONFIG1_DS_SHIFT) + 6);
+	cpuinfo->l1.dc_size = cpuinfo->l1.dc_linesize * cpuinfo->l1.dc_nsets 
+	    * cpuinfo->l1.dc_nways;
     }
 }
 
@@ -171,7 +176,7 @@
 
 	mips_get_identity(&cpuinfo);
 	mips_num_tlb_entries = cpuinfo.tlb_nentries;
-	mips_config_cache();
+	mips_config_cache(&cpuinfo);
 	mips_vector_init();
 
 	mips_icache_sync_all();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703291442.l2TEgNVs039617>