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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user