luxos/Kernel/library/memory/memory_info.c

48 lines
737 B
C

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