Commit dc75aa33 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] Sun-3/3x PTE updates

Sun-3/3x PTE updates (from Sam Creasey)
parent 114a3c1b
......@@ -83,7 +83,7 @@ void __init paging_init(void)
/* now change pg_table to kernel virtual addresses */
pg_table = (pte_t *) __va ((unsigned long) pg_table);
for (i=0; i<PTRS_PER_PTE; ++i, ++pg_table) {
pte_t pte = __mk_pte(address, PAGE_INIT);
pte_t pte = pfn_pte(virt_to_pfn(address), PAGE_INIT);
if (address >= (unsigned long)high_memory)
pte_val (pte) = 0;
set_pte (pg_table, pte);
......
/* dvma support routines */
/*
* linux/arch/m68k/sun3/dvma.c
*
* Written by Sam Creasey
*
* Sun3 IOMMU routines used for dvma accesses.
*
*/
#include <linux/kernel.h>
#include <linux/mm.h>
......@@ -22,7 +28,7 @@ inline unsigned long dvma_page(unsigned long kaddr, unsigned long vaddr)
j = *(volatile unsigned long *)kaddr;
*(volatile unsigned long *)kaddr = j;
ptep = __mk_pte(kaddr, PAGE_KERNEL);
ptep = pfn_pte(virt_to_pfn(kaddr), PAGE_KERNEL);
pte = pte_val(ptep);
// printk("dvma_remap: addr %lx -> %lx pte %08lx len %x\n",
// kaddr, vaddr, pte, len);
......
......@@ -102,7 +102,7 @@ inline int dvma_map_cpu(unsigned long kaddr,
pmd_t *pmd;
unsigned long end2;
if((pmd = pmd_alloc_kernel(pgd, vaddr)) == NULL) {
if((pmd = pmd_alloc(&init_mm, pgd, vaddr)) == NULL) {
ret = -ENOMEM;
goto out;
}
......@@ -116,7 +116,7 @@ inline int dvma_map_cpu(unsigned long kaddr,
pte_t *pte;
unsigned long end3;
if((pte = pte_alloc_kernel(pmd, vaddr)) == NULL) {
if((pte = pte_alloc_kernel(&init_mm, pmd, vaddr)) == NULL) {
ret = -ENOMEM;
goto out;
}
......@@ -131,7 +131,8 @@ inline int dvma_map_cpu(unsigned long kaddr,
printk("mapping %08lx phys to %08lx\n",
__pa(kaddr), vaddr);
#endif
set_pte(pte, __mk_pte(kaddr, PAGE_KERNEL));
set_pte(pte, pfn_pte(virt_to_pfn(kaddr),
PAGE_KERNEL));
pte++;
kaddr += PAGE_SIZE;
vaddr += PAGE_SIZE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment