pgalloc.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1994 - 2001, 2003 by Ralf Baechle
  7. * Copyright (C) 1999, 2000, 2001 Silicon Graphics, Inc.
  8. */
  9. #ifndef _ASM_NIOS2_PGALLOC_H
  10. #define _ASM_NIOS2_PGALLOC_H
  11. #include <linux/mm.h>
  12. #include <asm-generic/pgalloc.h>
  13. static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
  14. pte_t *pte)
  15. {
  16. set_pmd(pmd, __pmd((unsigned long)pte));
  17. }
  18. static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
  19. pgtable_t pte)
  20. {
  21. set_pmd(pmd, __pmd((unsigned long)page_address(pte)));
  22. }
  23. /*
  24. * Initialize a new pmd table with invalid pointers.
  25. */
  26. extern void pmd_init(unsigned long page, unsigned long pagetable);
  27. extern pgd_t *pgd_alloc(struct mm_struct *mm);
  28. #define __pte_free_tlb(tlb, pte, addr) \
  29. do { \
  30. pgtable_pte_page_dtor(pte); \
  31. tlb_remove_page((tlb), (pte)); \
  32. } while (0)
  33. #endif /* _ASM_NIOS2_PGALLOC_H */