pgtable-2level.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
  3. * Copyright 2003 PathScale, Inc.
  4. * Derived from include/asm-i386/pgtable.h
  5. * Licensed under the GPL
  6. */
  7. #ifndef __UM_PGTABLE_2LEVEL_H
  8. #define __UM_PGTABLE_2LEVEL_H
  9. #define __ARCH_USE_5LEVEL_HACK
  10. #include <asm-generic/pgtable-nopmd.h>
  11. /* PGDIR_SHIFT determines what a third-level page table entry can map */
  12. #define PGDIR_SHIFT 22
  13. #define PGDIR_SIZE (1UL << PGDIR_SHIFT)
  14. #define PGDIR_MASK (~(PGDIR_SIZE-1))
  15. /*
  16. * entries per page directory level: the i386 is two-level, so
  17. * we don't really have any PMD directory physically.
  18. */
  19. #define PTRS_PER_PTE 1024
  20. #define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE)
  21. #define PTRS_PER_PGD 1024
  22. #define FIRST_USER_ADDRESS 0UL
  23. #define pte_ERROR(e) \
  24. printk("%s:%d: bad pte %p(%08lx).\n", __FILE__, __LINE__, &(e), \
  25. pte_val(e))
  26. #define pgd_ERROR(e) \
  27. printk("%s:%d: bad pgd %p(%08lx).\n", __FILE__, __LINE__, &(e), \
  28. pgd_val(e))
  29. static inline int pgd_newpage(pgd_t pgd) { return 0; }
  30. static inline void pgd_mkuptodate(pgd_t pgd) { }
  31. #define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval))
  32. #define pte_pfn(x) phys_to_pfn(pte_val(x))
  33. #define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot))
  34. #define pfn_pmd(pfn, prot) __pmd(pfn_to_phys(pfn) | pgprot_val(prot))
  35. #endif