Kernel/armv7 - Cleaning up debug
[tpg/acess2.git] / Kernel / arch / armv7 / mm_virt.c
index 0c2f043..64b5d57 100644 (file)
@@ -126,7 +126,9 @@ int MM_int_AllocateCoarse(tVAddr VAddr, int Domain)
        }
 
        // TLBIALL 
-       TLBIALL();      
+       TLBIALL();
+       
+       memset( (void*)&table1[ (VAddr >> 12) & ~(1024-1) ], 0, 0x1000 );
 
        LEAVE('i', 0);
        return 0;
@@ -737,7 +739,7 @@ tVAddr MM_MapTemp(tPAddr PAddr)
                if( MM_int_GetPageInfo(ret, &pi) == 0 )
                        continue;
 
-               Log("MapTemp %P at %p by %p", PAddr, ret, __builtin_return_address(0));
+//             Log("MapTemp %P at %p by %p", PAddr, ret, __builtin_return_address(0));
                MM_RefPhys(PAddr);      // Counter the MM_Deallocate in FreeTemp
                MM_Map(ret, PAddr);
                
@@ -922,7 +924,7 @@ void MM_DumpTables(tVAddr Start, tVAddr End)
        
        pi_old.Size = 0;
 
-       Debug("Page Table Dump:");
+       Debug("Page Table Dump (%p to %p):", Start, End);
        range_start = Start;
        for( addr = Start; i == 0 || (addr && addr < End); i = 1 )
        {
@@ -954,7 +956,7 @@ void MM_DumpTables(tVAddr Start, tVAddr End)
        Debug("Done");
 }
 
-// NOTE: Runs in abort context, not much differe, just a smaller stack
+// NOTE: Runs in abort context, not much difference, just a smaller stack
 void MM_PageFault(Uint32 PC, Uint32 Addr, Uint32 DFSR, int bPrefetch)
 {
         int    rv;
@@ -975,8 +977,10 @@ void MM_PageFault(Uint32 PC, Uint32 Addr, Uint32 DFSR, int bPrefetch)
                                for(;;);
                        }
                        
+                       #if TRACE_COW
                        Log_Notice("MMVirt", "COW %p caused by %p, ZERO duped to %P (RefCnt(%i)--)", Addr, PC,
                                newpage, MM_GetRefCount(pi.PhysAddr));
+                       #endif
 
                        MM_DerefPhys(pi.PhysAddr);
                        pi.PhysAddr = newpage;
@@ -1003,16 +1007,20 @@ void MM_PageFault(Uint32 PC, Uint32 Addr, Uint32 DFSR, int bPrefetch)
                        memcpy( dst, src, PAGE_SIZE );
                        MM_FreeTemp( (tVAddr)dst );
                        
+                       #if TRACE_COW
                        Log_Notice("MMVirt", "COW %p caused by %p, %P duped to %P (RefCnt(%i)--)", Addr, PC,
                                pi.PhysAddr, newpage, MM_GetRefCount(pi.PhysAddr));
+                       #endif
 
                        MM_DerefPhys(pi.PhysAddr);
                        pi.PhysAddr = newpage;
                }
+               #if TRACE_COW
                else {
                        Log_Notice("MMVirt", "COW %p caused by %p, took last reference to %P",
                                Addr, PC, pi.PhysAddr);
                }
+               #endif
                // Unset COW
                pi.AP = AP_RW_BOTH;
                MM_int_SetPageInfo(Addr, &pi);
@@ -1023,6 +1031,10 @@ void MM_PageFault(Uint32 PC, Uint32 Addr, Uint32 DFSR, int bPrefetch)
        Log_Error("MMVirt", "Code at %p accessed %p (DFSR = 0x%x)%s", PC, Addr, DFSR,
                (bPrefetch ? " - Prefetch" : "")
                );
+       if( Addr < 0x80000000 )
+               MM_DumpTables(0, 0x80000000);
+       else
+               MM_DumpTables(0x80000000, -1);
        for(;;);
 }
 

UCC git Repository :: git.ucc.asn.au