pgtable.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:1k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. #ifndef _ASM_GENERIC_PGTABLE_H
  2. #define _ASM_GENERIC_PGTABLE_H
  3. static inline int ptep_test_and_clear_young(pte_t *ptep)
  4. {
  5. pte_t pte = *ptep;
  6. if (!pte_young(pte))
  7. return 0;
  8. set_pte(ptep, pte_mkold(pte));
  9. return 1;
  10. }
  11. static inline int ptep_test_and_clear_dirty(pte_t *ptep)
  12. {
  13. pte_t pte = *ptep;
  14. if (!pte_dirty(pte))
  15. return 0;
  16. set_pte(ptep, pte_mkclean(pte));
  17. return 1;
  18. }
  19. static inline pte_t ptep_get_and_clear(pte_t *ptep)
  20. {
  21. pte_t pte = *ptep;
  22. pte_clear(ptep);
  23. return pte;
  24. }
  25. static inline void ptep_set_wrprotect(pte_t *ptep)
  26. {
  27. pte_t old_pte = *ptep;
  28. set_pte(ptep, pte_wrprotect(old_pte));
  29. }
  30. static inline void ptep_mkdirty(pte_t *ptep)
  31. {
  32. pte_t old_pte = *ptep;
  33. set_pte(ptep, pte_mkdirty(old_pte));
  34. }
  35. #define pte_same(A,B) (pte_val(A) == pte_val(B))
  36. #endif /* _ASM_GENERIC_PGTABLE_H */