Add routine to retrieve installed memory size
This commit is contained in:
@@ -22,6 +22,7 @@ namespace MM
|
|||||||
STATIC PFN_NUMBER NumberOfSystemPtes;
|
STATIC PFN_NUMBER NumberOfSystemPtes;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
STATIC XTAPI ULONG_PTR GetInstalledMemorySize(VOID);
|
||||||
STATIC XTAPI PMMMEMORY_LAYOUT GetMemoryLayout(VOID);
|
STATIC XTAPI PMMMEMORY_LAYOUT GetMemoryLayout(VOID);
|
||||||
STATIC XTAPI PFN_NUMBER GetNumberOfSystemPtes();
|
STATIC XTAPI PFN_NUMBER GetNumberOfSystemPtes();
|
||||||
STATIC XTAPI VOID InitializeMemoryLayout(VOID);
|
STATIC XTAPI VOID InitializeMemoryLayout(VOID);
|
||||||
|
|||||||
@@ -10,6 +10,21 @@
|
|||||||
#include <xtos.hh>
|
#include <xtos.hh>
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the amount of total available memory in the system.
|
||||||
|
*
|
||||||
|
* @return This routine returns the amount of available memory in the system in megabytes.
|
||||||
|
*
|
||||||
|
* @since XT 1.0
|
||||||
|
*/
|
||||||
|
XTAPI
|
||||||
|
ULONG_PTR
|
||||||
|
MM::Manager::GetInstalledMemorySize(VOID)
|
||||||
|
{
|
||||||
|
/* Return the amount of installed memory */
|
||||||
|
return (MM::Pfn::GetNumberOfPhysicalPages() * MM_PAGE_SIZE) / 1048576;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a pointer to the system's virtual memory layout structure.
|
* Retrieves a pointer to the system's virtual memory layout structure.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user