Lines Matching refs:pmd

690 static inline int pmd_large(pmd_t pmd)  in pmd_large()  argument
692 return (pmd_val(pmd) & _SEGMENT_ENTRY_LARGE) != 0; in pmd_large()
695 static inline int pmd_bad(pmd_t pmd) in pmd_bad() argument
697 if ((pmd_val(pmd) & _SEGMENT_ENTRY_TYPE_MASK) > 0 || pmd_large(pmd)) in pmd_bad()
699 return (pmd_val(pmd) & ~_SEGMENT_ENTRY_BITS) != 0; in pmd_bad()
724 static inline int pmd_present(pmd_t pmd) in pmd_present() argument
726 return pmd_val(pmd) != _SEGMENT_ENTRY_EMPTY; in pmd_present()
729 static inline int pmd_none(pmd_t pmd) in pmd_none() argument
731 return pmd_val(pmd) == _SEGMENT_ENTRY_EMPTY; in pmd_none()
735 static inline int pmd_write(pmd_t pmd) in pmd_write() argument
737 return (pmd_val(pmd) & _SEGMENT_ENTRY_WRITE) != 0; in pmd_write()
746 static inline int pmd_dirty(pmd_t pmd) in pmd_dirty() argument
748 return (pmd_val(pmd) & _SEGMENT_ENTRY_DIRTY) != 0; in pmd_dirty()
751 static inline int pmd_young(pmd_t pmd) in pmd_young() argument
753 return (pmd_val(pmd) & _SEGMENT_ENTRY_YOUNG) != 0; in pmd_young()
792 static inline int pmd_protnone(pmd_t pmd) in pmd_protnone() argument
795 return pmd_large(pmd) && !(pmd_val(pmd) & _SEGMENT_ENTRY_READ); in pmd_protnone()
819 static inline int pmd_soft_dirty(pmd_t pmd) in pmd_soft_dirty() argument
821 return pmd_val(pmd) & _SEGMENT_ENTRY_SOFT_DIRTY; in pmd_soft_dirty()
824 static inline pmd_t pmd_mksoft_dirty(pmd_t pmd) in pmd_mksoft_dirty() argument
826 pmd_val(pmd) |= _SEGMENT_ENTRY_SOFT_DIRTY; in pmd_mksoft_dirty()
827 return pmd; in pmd_mksoft_dirty()
830 static inline pmd_t pmd_clear_soft_dirty(pmd_t pmd) in pmd_clear_soft_dirty() argument
832 pmd_val(pmd) &= ~_SEGMENT_ENTRY_SOFT_DIRTY; in pmd_clear_soft_dirty()
833 return pmd; in pmd_clear_soft_dirty()
1240 static inline unsigned long pmd_deref(pmd_t pmd) in pmd_deref() argument
1245 if (pmd_large(pmd)) in pmd_deref()
1247 return (unsigned long)__va(pmd_val(pmd) & origin_mask); in pmd_deref()
1250 static inline unsigned long pmd_pfn(pmd_t pmd) in pmd_pfn() argument
1252 return __pa(pmd_deref(pmd)) >> PAGE_SHIFT; in pmd_pfn()
1336 static inline unsigned long pmd_page_vaddr(pmd_t pmd) in pmd_page_vaddr() argument
1338 return (unsigned long) pmd_deref(pmd); in pmd_page_vaddr()
1351 #define pmd_page(pmd) pfn_to_page(pmd_pfn(pmd)) argument
1356 static inline pmd_t pmd_wrprotect(pmd_t pmd) in pmd_wrprotect() argument
1358 pmd_val(pmd) &= ~_SEGMENT_ENTRY_WRITE; in pmd_wrprotect()
1359 pmd_val(pmd) |= _SEGMENT_ENTRY_PROTECT; in pmd_wrprotect()
1360 return pmd; in pmd_wrprotect()
1363 static inline pmd_t pmd_mkwrite(pmd_t pmd) in pmd_mkwrite() argument
1365 pmd_val(pmd) |= _SEGMENT_ENTRY_WRITE; in pmd_mkwrite()
1366 if (pmd_val(pmd) & _SEGMENT_ENTRY_DIRTY) in pmd_mkwrite()
1367 pmd_val(pmd) &= ~_SEGMENT_ENTRY_PROTECT; in pmd_mkwrite()
1368 return pmd; in pmd_mkwrite()
1371 static inline pmd_t pmd_mkclean(pmd_t pmd) in pmd_mkclean() argument
1373 pmd_val(pmd) &= ~_SEGMENT_ENTRY_DIRTY; in pmd_mkclean()
1374 pmd_val(pmd) |= _SEGMENT_ENTRY_PROTECT; in pmd_mkclean()
1375 return pmd; in pmd_mkclean()
1378 static inline pmd_t pmd_mkdirty(pmd_t pmd) in pmd_mkdirty() argument
1380 pmd_val(pmd) |= _SEGMENT_ENTRY_DIRTY | _SEGMENT_ENTRY_SOFT_DIRTY; in pmd_mkdirty()
1381 if (pmd_val(pmd) & _SEGMENT_ENTRY_WRITE) in pmd_mkdirty()
1382 pmd_val(pmd) &= ~_SEGMENT_ENTRY_PROTECT; in pmd_mkdirty()
1383 return pmd; in pmd_mkdirty()
1434 static inline pmd_t pmd_mkyoung(pmd_t pmd) in pmd_mkyoung() argument
1436 pmd_val(pmd) |= _SEGMENT_ENTRY_YOUNG; in pmd_mkyoung()
1437 if (pmd_val(pmd) & _SEGMENT_ENTRY_READ) in pmd_mkyoung()
1438 pmd_val(pmd) &= ~_SEGMENT_ENTRY_INVALID; in pmd_mkyoung()
1439 return pmd; in pmd_mkyoung()
1442 static inline pmd_t pmd_mkold(pmd_t pmd) in pmd_mkold() argument
1444 pmd_val(pmd) &= ~_SEGMENT_ENTRY_YOUNG; in pmd_mkold()
1445 pmd_val(pmd) |= _SEGMENT_ENTRY_INVALID; in pmd_mkold()
1446 return pmd; in pmd_mkold()
1449 static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot) in pmd_modify() argument
1451 pmd_val(pmd) &= _SEGMENT_ENTRY_ORIGIN_LARGE | in pmd_modify()
1454 pmd_val(pmd) |= massage_pgprot_pmd(newprot); in pmd_modify()
1455 if (!(pmd_val(pmd) & _SEGMENT_ENTRY_DIRTY)) in pmd_modify()
1456 pmd_val(pmd) |= _SEGMENT_ENTRY_PROTECT; in pmd_modify()
1457 if (!(pmd_val(pmd) & _SEGMENT_ENTRY_YOUNG)) in pmd_modify()
1458 pmd_val(pmd) |= _SEGMENT_ENTRY_INVALID; in pmd_modify()
1459 return pmd; in pmd_modify()
1570 pmd_t pmd = *pmdp; in pmdp_test_and_clear_young() local
1572 pmd = pmdp_xchg_direct(vma->vm_mm, addr, pmdp, pmd_mkold(pmd)); in pmdp_test_and_clear_young()
1573 return pmd_young(pmd); in pmdp_test_and_clear_young()
1592 static inline pmd_t pmd_mkhuge(pmd_t pmd) in pmd_mkhuge() argument
1594 pmd_val(pmd) |= _SEGMENT_ENTRY_LARGE; in pmd_mkhuge()
1595 pmd_val(pmd) |= _SEGMENT_ENTRY_YOUNG; in pmd_mkhuge()
1596 pmd_val(pmd) |= _SEGMENT_ENTRY_PROTECT; in pmd_mkhuge()
1597 return pmd; in pmd_mkhuge()
1613 pmd_t pmd = *pmdp; in pmdp_huge_get_and_clear_full() local
1615 return pmd; in pmdp_huge_get_and_clear_full()
1631 pmd_t pmd = __pmd(pmd_val(*pmdp) | _SEGMENT_ENTRY_INVALID); in pmdp_invalidate() local
1633 return pmdp_xchg_direct(vma->vm_mm, addr, pmdp, pmd); in pmdp_invalidate()
1640 pmd_t pmd = *pmdp; in pmdp_set_wrprotect() local
1642 if (pmd_write(pmd)) in pmdp_set_wrprotect()
1643 pmd = pmdp_xchg_lazy(mm, addr, pmdp, pmd_wrprotect(pmd)); in pmdp_set_wrprotect()
1657 static inline int pmd_trans_huge(pmd_t pmd) in pmd_trans_huge() argument
1659 return pmd_val(pmd) & _SEGMENT_ENTRY_LARGE; in pmd_trans_huge()
1731 #define pmd_pgtable(pmd) \ argument
1732 ((pgtable_t)__va(pmd_val(pmd) & -sizeof(pte_t)*PTRS_PER_PTE))