hugetlbpage.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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/slab.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, unsigned long addr)
  41. {
  42. pgd_t *pgd;
  43. pud_t *pud;
  44. pmd_t *pmd;
  45. pte_t *pte = NULL;
  46. pgd = pgd_offset(mm, addr);
  47. if (pgd) {
  48. pud = pud_offset(pgd, addr);
  49. if (pud) {
  50. pmd = pmd_offset(pud, addr);
  51. if (pmd)
  52. pte = pte_offset_map(pmd, addr);
  53. }
  54. }
  55. return pte;
  56. }
  57. int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep)
  58. {
  59. return 0;
  60. }
  61. struct page *follow_huge_addr(struct mm_struct *mm,
  62. unsigned long address, int write)
  63. {
  64. return ERR_PTR(-EINVAL);
  65. }
  66. int pmd_huge(pmd_t pmd)
  67. {
  68. return 0;
  69. }
  70. int pud_huge(pud_t pud)
  71. {
  72. return 0;
  73. }
  74. struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address,
  75. pmd_t *pmd, int write)
  76. {
  77. return NULL;
  78. }