hugetlbpage.c 1.2 KB

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