if( gaiStaticAllocPages[i] ) {
tPAddr ret = gaiStaticAllocPages[i];
gaiStaticAllocPages[i] = 0;
- Log("MM_AllocPhys: Return %x, static alloc %i", ret, i);
+ Log("MM_AllocPhys: Return %P, static alloc %i", ret, i);
return ret;
}
}
}
}
+int MM_GetRefCount( tPAddr PAddr )
+{
+ PAddr >>= 12;
+
+ if( PAddr >> 12 > giMaxPhysPage ) return 0;
+
+ if( gaMultiBitmap[ PAddr >> 6 ] & (1LL << (PAddr&63)) ) {
+ return gaiPageReferences[PAddr];
+ }
+
+ if( gaMainBitmap[ PAddr >> 6 ] & (1LL << (PAddr&63)) )
+ {
+ return 1;
+ }
+ return 0;
+}
+
/**
* \brief Takes a physical address and returns the ID of its range
* \param Addr Physical address of page