hugetlbpage.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * arch/sh/mm/hugetlbpage.c
  3. *
  4. * SuperH HugeTLB page support.
  5. *
  6. * Cloned from sparc64 by Paul Mundt.
  7. *
  8. * Copyright (C) 2002, 2003 David S. Miller (davem@redhat.com)
  9. */
  10. #include <linux/init.h>
  11. #include <linux/fs.h>
  12. #include <linux/mm.h>
  13. #include <linux/hugetlb.h>
  14. #include <linux/pagemap.h>
  15. #include <linux/sysctl.h>
  16. #include <asm/mman.h>
  17. #include <asm/pgalloc.h>
  18. #include <asm/tlb.h>
  19. #include <asm/tlbflush.h>
  20. #include <asm/cacheflush.h>
  21. pte_t *huge_pte_alloc(struct mm_struct *mm,
  22. unsigned long addr, unsigned long sz)
  23. {
  24. pgd_t *pgd;
  25. pud_t *pud;
  26. pmd_t *pmd;
  27. pte_t *pte = NULL;
  28. pgd = pgd_offset(mm, addr);
  29. if (pgd) {
  30. pud = pud_alloc(mm, pgd, addr);
  31. if (pud) {
  32. pmd = pmd_alloc(mm, pud, addr);
  33. if (pmd)
  34. pte = pte_alloc_map(mm, NULL, pmd, addr);
  35. }
  36. }
  37. return pte;
  38. }
  39. pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
  40. {
  41. pgd_t *pgd;
  42. pud_t *pud;
  43. pmd_t *pmd;
  44. pte_t *pte = NULL;
  45. pgd = pgd_offset(mm, addr);
  46. if (pgd) {
  47. pud = pud_offset(pgd, addr);
  48. if (pud) {
  49. pmd = pmd_offset(pud, addr);
  50. if (pmd)
  51. pte = pte_offset_map(pmd, addr);
  52. }
  53. }
  54. return pte;
  55. }
  56. int pmd_huge(pmd_t pmd)
  57. {
  58. return 0;
  59. }
  60. int pud_huge(pud_t pud)
  61. {
  62. return 0;
  63. }