1 #include <linux/vmalloc.h>
2 #include <asm/pgalloc.h>
3 #include <asm/cacheflush.h>
6 remap_area_pte(pte_t * pte, unsigned long address, unsigned long size,
7 unsigned long phys_addr, unsigned long flags)
18 pfn = phys_addr >> PAGE_SHIFT;
20 if (!pte_none(*pte)) {
21 printk("remap_area_pte: page already exists\n");
24 set_pte(pte, pfn_pte(pfn,
25 __pgprot(_PAGE_VALID | _PAGE_ASM |
26 _PAGE_KRE | _PAGE_KWE | flags)));
30 } while (address && (address < end));
34 remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size,
35 unsigned long phys_addr, unsigned long flags)
39 address &= ~PGDIR_MASK;
47 pte_t * pte = pte_alloc_kernel(pmd, address);
50 remap_area_pte(pte, address, end - address,
51 address + phys_addr, flags);
52 address = (address + PMD_SIZE) & PMD_MASK;
54 } while (address && (address < end));
59 __alpha_remap_area_pages(unsigned long address, unsigned long phys_addr,
60 unsigned long size, unsigned long flags)
64 unsigned long end = address + size;
67 dir = pgd_offset(&init_mm, address);
73 pmd = pmd_alloc(&init_mm, dir, address);
77 if (remap_area_pmd(pmd, address, end - address,
78 phys_addr + address, flags))
81 address = (address + PGDIR_SIZE) & PGDIR_MASK;
83 } while (address && (address < end));