Kernel/heap - Add File/Line to free(), modify heap messages to use Log_*
[tpg/acess2.git] / KernelLand / Kernel / include / tpl_mm_phys_bitmap.h
index 005a2f8..106efd7 100644 (file)
@@ -354,7 +354,13 @@ int MM_GetRefCount(tPAddr PAddr)
                return gaiPageReferences[PAddr];
        }
        
-       if( gaPageBitmaps[ PAddr / 32 ] & (1LL << (PAddr&31)) ) {
+       Uint32  *bm = &gaPageBitmaps[ PAddr / 32 ];
+       if( !MM_GetPhysAddr(bm) ) {
+               Log_Error("MMPhys", "MM_GetRefCount: bitmap for ppage 0x%x not mapped %p",
+                       PAddr, bm);
+               return 0;
+       }
+       if( (*bm) & (1LL << (PAddr&31)) ) {
                return 1;
        }
        

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