| .. | .. |
|---|
| 17 | 17 | #include <linux/sysctl.h> |
|---|
| 18 | 18 | |
|---|
| 19 | 19 | #include <asm/mman.h> |
|---|
| 20 | | -#include <asm/pgalloc.h> |
|---|
| 21 | 20 | #include <asm/tlb.h> |
|---|
| 22 | 21 | #include <asm/tlbflush.h> |
|---|
| 23 | 22 | #include <asm/cacheflush.h> |
|---|
| 24 | 23 | |
|---|
| 25 | | -pte_t *huge_pte_alloc(struct mm_struct *mm, |
|---|
| 24 | +pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, |
|---|
| 26 | 25 | unsigned long addr, unsigned long sz) |
|---|
| 27 | 26 | { |
|---|
| 28 | 27 | pgd_t *pgd; |
|---|
| 28 | + p4d_t *p4d; |
|---|
| 29 | 29 | pud_t *pud; |
|---|
| 30 | 30 | pmd_t *pmd; |
|---|
| 31 | 31 | pte_t *pte = NULL; |
|---|
| 32 | 32 | |
|---|
| 33 | 33 | pgd = pgd_offset(mm, addr); |
|---|
| 34 | 34 | if (pgd) { |
|---|
| 35 | | - pud = pud_alloc(mm, pgd, addr); |
|---|
| 36 | | - if (pud) { |
|---|
| 37 | | - pmd = pmd_alloc(mm, pud, addr); |
|---|
| 38 | | - if (pmd) |
|---|
| 39 | | - pte = pte_alloc_map(mm, pmd, addr); |
|---|
| 35 | + p4d = p4d_alloc(mm, pgd, addr); |
|---|
| 36 | + if (p4d) { |
|---|
| 37 | + pud = pud_alloc(mm, p4d, addr); |
|---|
| 38 | + if (pud) { |
|---|
| 39 | + pmd = pmd_alloc(mm, pud, addr); |
|---|
| 40 | + if (pmd) |
|---|
| 41 | + pte = pte_alloc_map(mm, pmd, addr); |
|---|
| 42 | + } |
|---|
| 40 | 43 | } |
|---|
| 41 | 44 | } |
|---|
| 42 | 45 | |
|---|
| .. | .. |
|---|
| 47 | 50 | unsigned long addr, unsigned long sz) |
|---|
| 48 | 51 | { |
|---|
| 49 | 52 | pgd_t *pgd; |
|---|
| 53 | + p4d_t *p4d; |
|---|
| 50 | 54 | pud_t *pud; |
|---|
| 51 | 55 | pmd_t *pmd; |
|---|
| 52 | 56 | pte_t *pte = NULL; |
|---|
| 53 | 57 | |
|---|
| 54 | 58 | pgd = pgd_offset(mm, addr); |
|---|
| 55 | 59 | if (pgd) { |
|---|
| 56 | | - pud = pud_offset(pgd, addr); |
|---|
| 57 | | - if (pud) { |
|---|
| 58 | | - pmd = pmd_offset(pud, addr); |
|---|
| 59 | | - if (pmd) |
|---|
| 60 | | - pte = pte_offset_map(pmd, addr); |
|---|
| 60 | + p4d = p4d_offset(pgd, addr); |
|---|
| 61 | + if (p4d) { |
|---|
| 62 | + pud = pud_offset(p4d, addr); |
|---|
| 63 | + if (pud) { |
|---|
| 64 | + pmd = pmd_offset(pud, addr); |
|---|
| 65 | + if (pmd) |
|---|
| 66 | + pte = pte_offset_map(pmd, addr); |
|---|
| 67 | + } |
|---|
| 61 | 68 | } |
|---|
| 62 | 69 | } |
|---|
| 63 | 70 | |
|---|