luxos/Kernel/library/memory/memory_info.c

48 lines
737 B
C
Raw Normal View History

/*
* 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...
// 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;
}
// Total used physical memory in bytes
uint32 MemoryGetUsed()
{
2021-09-14 16:02:20 +00:00
return UsedFrames * 0x4;
}
// Same as above functions, but in frames
uint32 MemoryGetFrameSize()
{
return 0x4;
}
uint32 MemoryGetFramesTotal()
{
2021-09-14 16:02:20 +00:00
return TotalFrames;
}
uint32 MemoryGetFramesUsed()
{
2021-09-14 16:02:20 +00:00
return UsedFrames;
}
uint32 MemoryGetFramesFree()
{
2021-09-14 16:02:20 +00:00
return (TotalFrames - UsedFrames);
}