implement mmap(MAP_POPULATE)

populate_process_memory() function is not efficient,
because whether every small page is present is checked.
This commit is contained in:
NAKAMURA Gou
2014-01-24 21:27:18 +09:00
parent bdc945cb34
commit f0a52d4519
5 changed files with 93 additions and 1 deletions

View File

@@ -62,6 +62,7 @@
#define PT_PHYSMASK (((1UL << 52) - 1) & PAGE_MASK)
#define PF_PRESENT ((pte_t)0x01) /* entry is valid */
#define PF_WRITABLE ((pte_t)0x02)
#define PF_SIZE ((pte_t)0x80) /* entry points large page */
#define PFL4_PRESENT ((pte_t)0x01)
@@ -130,6 +131,11 @@ static inline int pte_is_present(pte_t *ptep)
return !!(*ptep & PF_PRESENT);
}
static inline int pte_is_writable(pte_t *ptep)
{
return !!(*ptep & PF_WRITABLE);
}
static inline uintptr_t pte_get_phys(pte_t *ptep)
{
return (*ptep & PT_PHYSMASK);