luxos/Kernel/library/memory/memory_info.c
Tiberiu Chibici e3b3584734 [????] BUILD 0.1.1.??? DATE 9/0?/2011 AT ?:?? ??
====================================================
Mainly changed: Tasking
+ Implemented multitasking
2021-09-14 18:54:59 +03:00

48 lines
677 B
C

/*
* 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()
{
return (TotalBlocks - UsedBlocks) * 0x4;
}
// Total used physical memory in bytes
uint32 MemoryGetUsed()
{
return UsedBlocks * 0x4;
}
// Same as above functions, but in frames
uint32 MemoryGetFrameSize()
{
return 0x4;
}
uint32 MemoryGetFramesTotal()
{
return TotalBlocks;
}
uint32 MemoryGetFramesUsed()
{
return UsedBlocks;
}
uint32 MemoryGetFramesFree()
{
return (TotalBlocks - UsedBlocks);
}