2021-09-14 15:48:57 +00:00
|
|
|
/*
|
|
|
|
* memory_info.c
|
|
|
|
*
|
|
|
|
* Created on: Aug 27, 2011
|
|
|
|
* Author: Tiberiu
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <memory-add.h>
|
2021-09-14 16:02:20 +00:00
|
|
|
// MemoryGetFree(), MemoryGetTotal(), MemoryGet blah blah...
|
2021-09-14 15:48:57 +00:00
|
|
|
|
|
|
|
// Returns total physical memory in bytes
|
|
|
|
uint32 MemoryGetTotal()
|
|
|
|
{
|
|
|
|
return (TotalMemory);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Returns total free physical memory in bytes
|
|
|
|
uint32 MemoryGetFree()
|
|
|
|
{
|
2021-09-14 16:02:20 +00:00
|
|
|
return (TotalFrames - UsedFrames) * 0x4;
|
2021-09-14 15:48:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Total used physical memory in bytes
|
|
|
|
uint32 MemoryGetUsed()
|
|
|
|
{
|
2021-09-14 16:02:20 +00:00
|
|
|
return UsedFrames * 0x4;
|
2021-09-14 15:48:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Same as above functions, but in frames
|
|
|
|
uint32 MemoryGetFrameSize()
|
|
|
|
{
|
|
|
|
return 0x4;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32 MemoryGetFramesTotal()
|
|
|
|
{
|
2021-09-14 16:02:20 +00:00
|
|
|
return TotalFrames;
|
2021-09-14 15:48:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
uint32 MemoryGetFramesUsed()
|
|
|
|
{
|
2021-09-14 16:02:20 +00:00
|
|
|
return UsedFrames;
|
2021-09-14 15:48:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
uint32 MemoryGetFramesFree()
|
|
|
|
{
|
2021-09-14 16:02:20 +00:00
|
|
|
return (TotalFrames - UsedFrames);
|
|
|
|
}
|