<html>
<body>
  <div id="body" style="background-color:#ffffff;" >
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head" style="border-bottom-width:1px;border-bottom-style:solid;" ><td class="headtd" style="padding:0;padding-top:.2em;" colspan="4">Commit in <b><tt>lxdream/src</tt></b></td></tr>
<tr><td><tt>maple/<a href="#file1">vmu.c</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+1</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-1</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">d54c499b48c7 -> cf3900ae8acc</td></tr>
<tr class="alt" style=";" ><td><tt>sh4/<a href="#file2">mmu.c</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+40</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-39</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">d54c499b48c7 -> cf3900ae8acc</td></tr>
<tr><td></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+41</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-40</td><td></td></tr>
</table>
<small id="info" style="color: #888888;" >2 modified files</small><br />
<pre class="comment" style="white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;padding:4px;border:1px dashed #000000;background-color:#ffffdd;" >
Fix crash on vmu device create introduced in r1072 - config was being
initialised in the wrong order
</pre>
<hr /><a name="file1" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/maple</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>vmu.c</b></big> <small id="info" style="color: #888888;" >d54c499b48c7 -> cf3900ae8acc</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/maple/vmu.c
+++ lxdream/src/maple/vmu.c
@@ -101,8 +101,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > static maple_device_t vmu_new( )
 {
     vmu_device_t dev = malloc( sizeof(struct vmu_device) );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    memcpy( dev, &base_vmu, sizeof(base_vmu) );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     dev->config.data = dev;
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    memcpy( dev, &base_vmu, sizeof(base_vmu) );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     return MAPLE_DEVICE(dev);
 }
 
</pre></div>
<hr /><a name="file2" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/sh4</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>mmu.c</b></big> <small id="info" style="color: #888888;" >d54c499b48c7 -> cf3900ae8acc</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/sh4/mmu.c
+++ lxdream/src/sh4/mmu.c
@@ -245,7 +245,6 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         val &= 0xFFFFFCFF;
         if( (val & 0xFF) != mmu_asid ) {
             mmu_set_tlb_asid( val&0xFF );
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-            sh4_icache.page_vma = -1; // invalidate icache as asid has changed
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         }
         break;
     case PTEL:
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -473,47 +472,49 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 static void mmu_set_tlb_asid( uint32_t asid )
 {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    /* Scan for pages that need to be remapped */
-    int i;
-    if( IS_SV_ENABLED() ) {
-        for( i=0; i<UTLB_ENTRY_COUNT; i++ ) {
-            if( mmu_utlb[i].asid == mmu_asid && 
-                (mmu_utlb[i].flags & (TLB_VALID|TLB_SHARE)) == (TLB_VALID) ) {
-                // Matches old ASID - unmap out
-                if( !mmu_utlb_unmap_pages( FALSE, TRUE, mmu_utlb[i].vpn&mmu_utlb[i].mask,
-                        get_tlb_size_pages(mmu_utlb[i].flags) ) )
-                    mmu_utlb_remap_pages( FALSE, TRUE, i );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    if( IS_TLB_ENABLED() ) {
+        /* Scan for pages that need to be remapped */
+        int i;
+        if( IS_SV_ENABLED() ) {
+            for( i=0; i<UTLB_ENTRY_COUNT; i++ ) {
+                if( mmu_utlb[i].asid == mmu_asid &&
+                        (mmu_utlb[i].flags & (TLB_VALID|TLB_SHARE)) == (TLB_VALID) ) {
+                    // Matches old ASID - unmap out
+                    if( !mmu_utlb_unmap_pages( FALSE, TRUE, mmu_utlb[i].vpn&mmu_utlb[i].mask,
+                            get_tlb_size_pages(mmu_utlb[i].flags) ) )
+                        mmu_utlb_remap_pages( FALSE, TRUE, i );
+                }
+            }
+            for( i=0; i<UTLB_ENTRY_COUNT; i++ ) {
+                if( mmu_utlb[i].asid == asid &&
+                        (mmu_utlb[i].flags & (TLB_VALID|TLB_SHARE)) == (TLB_VALID) ) {
+                    // Matches new ASID - map in
+                    mmu_utlb_map_pages( NULL, mmu_utlb_pages[i].user_fn,
+                            mmu_utlb[i].vpn&mmu_utlb[i].mask,
+                            get_tlb_size_pages(mmu_utlb[i].flags) );
+                }
+            }
+        } else {
+            // Remap both Priv+user pages
+            for( i=0; i<UTLB_ENTRY_COUNT; i++ ) {
+                if( mmu_utlb[i].asid == mmu_asid &&
+                        (mmu_utlb[i].flags & (TLB_VALID|TLB_SHARE)) == (TLB_VALID) ) {
+                    if( !mmu_utlb_unmap_pages( TRUE, TRUE, mmu_utlb[i].vpn&mmu_utlb[i].mask,
+                            get_tlb_size_pages(mmu_utlb[i].flags) ) )
+                        mmu_utlb_remap_pages( TRUE, TRUE, i );
+                }
+            }
+            for( i=0; i<UTLB_ENTRY_COUNT; i++ ) {
+                if( mmu_utlb[i].asid == asid &&
+                        (mmu_utlb[i].flags & (TLB_VALID|TLB_SHARE)) == (TLB_VALID) ) {
+                    mmu_utlb_map_pages( &mmu_utlb_pages[i].fn, mmu_utlb_pages[i].user_fn,
+                            mmu_utlb[i].vpn&mmu_utlb[i].mask,
+                            get_tlb_size_pages(mmu_utlb[i].flags) );
+                }
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             }
         }
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        for( i=0; i<UTLB_ENTRY_COUNT; i++ ) {
-            if( mmu_utlb[i].asid == asid && 
-                (mmu_utlb[i].flags & (TLB_VALID|TLB_SHARE)) == (TLB_VALID) ) {
-                // Matches new ASID - map in
-                mmu_utlb_map_pages( NULL, mmu_utlb_pages[i].user_fn, 
-                        mmu_utlb[i].vpn&mmu_utlb[i].mask, 
-                        get_tlb_size_pages(mmu_utlb[i].flags) );
-            }
-        }
-    } else {
-        // Remap both Priv+user pages
-        for( i=0; i<UTLB_ENTRY_COUNT; i++ ) {
-            if( mmu_utlb[i].asid == mmu_asid &&
-                (mmu_utlb[i].flags & (TLB_VALID|TLB_SHARE)) == (TLB_VALID) ) {
-                if( !mmu_utlb_unmap_pages( TRUE, TRUE, mmu_utlb[i].vpn&mmu_utlb[i].mask,
-                        get_tlb_size_pages(mmu_utlb[i].flags) ) )
-                    mmu_utlb_remap_pages( TRUE, TRUE, i );
-            }
-        }
-        for( i=0; i<UTLB_ENTRY_COUNT; i++ ) {
-            if( mmu_utlb[i].asid == asid &&
-                (mmu_utlb[i].flags & (TLB_VALID|TLB_SHARE)) == (TLB_VALID) ) {
-                mmu_utlb_map_pages( &mmu_utlb_pages[i].fn, mmu_utlb_pages[i].user_fn, 
-                        mmu_utlb[i].vpn&mmu_utlb[i].mask, 
-                        get_tlb_size_pages(mmu_utlb[i].flags) );  
-            }
-        }
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        sh4_icache.page_vma = -1; // invalidate icache as asid has changed
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     }
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     mmu_asid = asid;
 }
 
</pre></div>
<center><small>Chaos Theory</small></center>
</div></body></html>