2021-09-14 15:48:57 +00:00
|
|
|
/*
|
|
|
|
* memory_info.c
|
|
|
|
*
|
|
|
|
* Created on: Aug 27, 2011
|
|
|
|
* Author: Tiberiu
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <memory-add.h>
|
|
|
|
|
|
|
|
// Returns total physical memory in bytes
|
|
|
|
uint32 MemoryGetTotal()
|
|
|
|
{
|
|
|
|
return (TotalMemory);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Returns total free physical memory in bytes
|
|
|
|
uint32 MemoryGetFree()
|
|
|
|
{
|
2021-09-14 15:54:59 +00:00
|
|
|
return (TotalBlocks - UsedBlocks) * 0x4;
|
2021-09-14 15:48:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Total used physical memory in bytes
|
|
|
|
uint32 MemoryGetUsed()
|
|
|
|
{
|
2021-09-14 15:54:59 +00:00
|
|
|
return UsedBlocks * 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 15:54:59 +00:00
|
|
|
return TotalBlocks;
|
2021-09-14 15:48:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
uint32 MemoryGetFramesUsed()
|
|
|
|
{
|
2021-09-14 15:54:59 +00:00
|
|
|
return UsedBlocks;
|
2021-09-14 15:48:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
uint32 MemoryGetFramesFree()
|
|
|
|
{
|
2021-09-14 15:54:59 +00:00
|
|
|
return (TotalBlocks - UsedBlocks);
|
|
|
|
}
|