Added vm_page_max_address() which returns the greatest address of accessible

physical memory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37230 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-06-23 13:52:32 +00:00
parent 58bdffb967
commit b46540452a
2 changed files with 13 additions and 0 deletions

View File

@ -44,6 +44,7 @@ page_num_t vm_page_num_free_pages(void);
page_num_t vm_page_num_available_pages(void);
page_num_t vm_page_num_unused_pages(void);
void vm_page_get_stats(system_info *info);
phys_addr_t vm_page_max_address();
status_t vm_page_write_modified_page_range(struct VMCache *cache,
uint32 firstPage, uint32 endPage);

View File

@ -3634,3 +3634,15 @@ vm_page_get_stats(system_info *info)
// TODO: We don't consider pages used for page directories/tables yet.
}
/*! Returns the greatest address within the last page of accessible physical
memory.
The value is inclusive, i.e. in case of a 32 bit phys_addr_t 0xffffffff
means the that the last page ends at exactly 4 GB.
*/
phys_addr_t
vm_page_max_address()
{
return ((phys_addr_t)sPhysicalPageOffset + sNumPages) * B_PAGE_SIZE - 1;
}