qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [5146] CRIS: Avoid a few unecessary steps in the mmu.
@ 2008-09-03 14:31 Edgar E. Iglesias
  0 siblings, 0 replies; only message in thread
From: Edgar E. Iglesias @ 2008-09-03 14:31 UTC (permalink / raw)
  To: qemu-devel

Revision: 5146
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5146
Author:   edgar_igl
Date:     2008-09-03 14:31:11 +0000 (Wed, 03 Sep 2008)

Log Message:
-----------
CRIS: Avoid a few unecessary steps in the mmu.

Modified Paths:
--------------
    trunk/target-cris/mmu.c

Modified: trunk/target-cris/mmu.c
===================================================================
--- trunk/target-cris/mmu.c	2008-09-03 14:30:27 UTC (rev 5145)
+++ trunk/target-cris/mmu.c	2008-09-03 14:31:11 UTC (rev 5146)
@@ -127,7 +127,7 @@
 {
 	unsigned int vpage;
 	unsigned int idx;
-	uint32_t lo, hi;
+	uint32_t pid, lo, hi;
 	uint32_t tlb_vpn, tlb_pfn = 0;
 	int tlb_pid, tlb_g, tlb_v, tlb_k, tlb_w, tlb_x;
 	int cfg_v, cfg_k, cfg_w, cfg_x;	
@@ -140,6 +140,7 @@
 
 	r_cause = env->sregs[SFR_R_MM_CAUSE];
 	r_cfg = env->sregs[SFR_RW_MM_CFG];
+	pid = env->pregs[PR_PID];
 
 	switch (rw) {
 		case 2: rwcause = CRIS_MMU_ERR_EXEC; mmu = 0; break;
@@ -175,15 +176,14 @@
 		lo = env->tlbsets[mmu][set][idx].lo;
 		hi = env->tlbsets[mmu][set][idx].hi;
 
-		tlb_vpn = EXTRACT_FIELD(hi, 13, 31);
+		tlb_vpn = hi >> 13;
 		tlb_pid = EXTRACT_FIELD(hi, 0, 7);
-		tlb_pfn = EXTRACT_FIELD(lo, 13, 31);
 		tlb_g  = EXTRACT_FIELD(lo, 4, 4);
 
 		D(fprintf(logfile, 
-			 "TLB[%d][%d][%d] v=%x vpage=%x->pfn=%x lo=%x hi=%x\n", 
-			 mmu, set, idx, tlb_vpn, vpage, tlb_pfn, lo, hi));
-		if ((tlb_g || (tlb_pid == (env->pregs[PR_PID] & 0xff)))
+			 "TLB[%d][%d][%d] v=%x vpage=%x lo=%x hi=%x\n", 
+			 mmu, set, idx, tlb_vpn, vpage, lo, hi));
+		if ((tlb_g || (tlb_pid == pid))
 		    && tlb_vpn == vpage) {
 			match = 1;
 			break;
@@ -245,9 +245,6 @@
 		}
 		else
 			D(dump_tlb(env, mmu));
-
-		env->sregs[SFR_RW_MM_TLB_HI] = hi;
-		env->sregs[SFR_RW_MM_TLB_LO] = lo;
 	} else {
 		/* If refill, provide a randomized set.  */
 		set = env->mmu_rand_lfsr & 3;
@@ -278,7 +275,6 @@
 		D(printf("refill vaddr=%x pc=%x\n", vaddr, env->pc));
 	}
 
-
 	D(printf ("%s rw=%d mtch=%d pc=%x va=%x vpn=%x tlbvpn=%x pfn=%x pid=%x"
 		  " %x cause=%x sel=%x sp=%x %x %x\n",
 		  __func__, rw, match, env->pc,
@@ -348,7 +344,7 @@
 
 	if (!cris_mmu_enabled(env->sregs[SFR_RW_GC_CFG])) {
 		res->phy = vaddr;
-		res->prot = PAGE_BITS;		
+		res->prot = PAGE_BITS;
 		goto done;
 	}
 
@@ -361,7 +357,7 @@
 		base = cris_mmu_translate_seg(env, seg);
 		phy = base | (0x0fffffff & vaddr);
 		res->phy = phy;
-		res->prot = PAGE_BITS;		
+		res->prot = PAGE_BITS;
 	}
 	else
 	{

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-03 14:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-03 14:31 [Qemu-devel] [5146] CRIS: Avoid a few unecessary steps in the mmu Edgar E. Iglesias

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).