Implement initial memory manager infrastructure #24

Open
harraiken wants to merge 169 commits from memmgr into master
2 changed files with 16 additions and 0 deletions
Showing only changes of commit 46c24e653e - Show all commits

View File

@@ -22,6 +22,7 @@ namespace MM
STATIC PFN_NUMBER NumberOfSystemPtes;
public:
STATIC XTAPI ULONG_PTR GetInstalledMemorySize(VOID);
STATIC XTAPI PMMMEMORY_LAYOUT GetMemoryLayout(VOID);
STATIC XTAPI PFN_NUMBER GetNumberOfSystemPtes();
STATIC XTAPI VOID InitializeMemoryLayout(VOID);

View File

@@ -10,6 +10,21 @@
#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.
*