Commit 98cb97ef authored by Ingo Molnar's avatar Ingo Molnar

- clean up the vmalloc_to_page() interface: no need for any pgd parameter.

parent ba493464
...@@ -177,7 +177,7 @@ static inline unsigned long uvirt_to_bus(unsigned long adr) ...@@ -177,7 +177,7 @@ static inline unsigned long uvirt_to_bus(unsigned long adr)
{ {
unsigned long kva, ret; unsigned long kva, ret;
kva = page_address(vmalloc_to_page(pgd_offset(current->mm, adr), adr)); kva = page_address(vmalloc_to_page(adr));
ret = virt_to_bus((void *)kva); ret = virt_to_bus((void *)kva);
MDEBUG(printk("uv2b(%lx-->%lx)", adr, ret)); MDEBUG(printk("uv2b(%lx-->%lx)", adr, ret));
return ret; return ret;
...@@ -188,7 +188,7 @@ static inline unsigned long kvirt_to_bus(unsigned long adr) ...@@ -188,7 +188,7 @@ static inline unsigned long kvirt_to_bus(unsigned long adr)
unsigned long va, kva, ret; unsigned long va, kva, ret;
va = VMALLOC_VMADDR(adr); va = VMALLOC_VMADDR(adr);
kva = page_address(vmalloc_to_page(pgd_offset_k(va), va)); kva = page_address(vmalloc_to_page(va));
ret = virt_to_bus((void *)kva); ret = virt_to_bus((void *)kva);
MDEBUG(printk("kv2b(%lx-->%lx)", adr, ret)); MDEBUG(printk("kv2b(%lx-->%lx)", adr, ret));
return ret; return ret;
...@@ -203,7 +203,7 @@ static inline unsigned long kvirt_to_pa(unsigned long adr) ...@@ -203,7 +203,7 @@ static inline unsigned long kvirt_to_pa(unsigned long adr)
unsigned long va, kva, ret; unsigned long va, kva, ret;
va = VMALLOC_VMADDR(adr); va = VMALLOC_VMADDR(adr);
kva = page_address(vmalloc_to_page(pgd_offset_k(va), va)); kva = page_address(vmalloc_to_page(va));
ret = __pa(kva); ret = __pa(kva);
MDEBUG(printk("kv2pa(%lx-->%lx)", adr, ret)); MDEBUG(printk("kv2pa(%lx-->%lx)", adr, ret));
return ret; return ret;
......
...@@ -145,7 +145,7 @@ static inline unsigned long uvirt_to_bus(unsigned long adr) ...@@ -145,7 +145,7 @@ static inline unsigned long uvirt_to_bus(unsigned long adr)
{ {
unsigned long kva, ret; unsigned long kva, ret;
kva = page_address(vmalloc_to_page(pgd_offset(current->mm, adr), adr)); kva = page_address(vmalloc_to_page(adr));
ret = virt_to_bus((void *)kva); ret = virt_to_bus((void *)kva);
MDEBUG(printk("uv2b(%lx-->%lx)", adr, ret)); MDEBUG(printk("uv2b(%lx-->%lx)", adr, ret));
return ret; return ret;
...@@ -156,7 +156,7 @@ static inline unsigned long kvirt_to_bus(unsigned long adr) ...@@ -156,7 +156,7 @@ static inline unsigned long kvirt_to_bus(unsigned long adr)
unsigned long va, kva, ret; unsigned long va, kva, ret;
va = VMALLOC_VMADDR(adr); va = VMALLOC_VMADDR(adr);
kva = page_address(vmalloc_to_page(pgd_offset_k(va), va)); kva = page_address(vmalloc_to_page(va));
ret = virt_to_bus((void *)kva); ret = virt_to_bus((void *)kva);
MDEBUG(printk("kv2b(%lx-->%lx)", adr, ret)); MDEBUG(printk("kv2b(%lx-->%lx)", adr, ret));
return ret; return ret;
...@@ -171,7 +171,7 @@ static inline unsigned long kvirt_to_pa(unsigned long adr) ...@@ -171,7 +171,7 @@ static inline unsigned long kvirt_to_pa(unsigned long adr)
unsigned long va, kva, ret; unsigned long va, kva, ret;
va = VMALLOC_VMADDR(adr); va = VMALLOC_VMADDR(adr);
kva = page_address(vmalloc_to_page(pgd_offset_k(va), va)); kva = page_address(vmalloc_to_page(va));
ret = __pa(kva); ret = __pa(kva);
MDEBUG(printk("kv2pa(%lx-->%lx)", adr, ret)); MDEBUG(printk("kv2pa(%lx-->%lx)", adr, ret));
return ret; return ret;
......
...@@ -189,7 +189,7 @@ static inline unsigned long kvirt_to_pa(unsigned long adr) ...@@ -189,7 +189,7 @@ static inline unsigned long kvirt_to_pa(unsigned long adr)
unsigned long va, kva, ret; unsigned long va, kva, ret;
va = VMALLOC_VMADDR(adr); va = VMALLOC_VMADDR(adr);
kva = page_address(vmalloc_to_page(pgd_offset_k(va), va)); kva = page_address(vmalloc_to_page(va));
ret = __pa(kva); ret = __pa(kva);
return ret; return ret;
} }
......
...@@ -126,7 +126,7 @@ static inline unsigned long kvirt_to_pa(unsigned long adr) { ...@@ -126,7 +126,7 @@ static inline unsigned long kvirt_to_pa(unsigned long adr) {
unsigned long va, kva, ret; unsigned long va, kva, ret;
va = VMALLOC_VMADDR(adr); va = VMALLOC_VMADDR(adr);
kva = page_address(vmalloc_to_page(pgd_offset_k(va), va)); kva = page_address(vmalloc_to_page(va));
ret = __pa(kva); ret = __pa(kva);
MDEBUG(printk("kv2pa(%lx-->%lx)\n", adr, ret)); MDEBUG(printk("kv2pa(%lx-->%lx)\n", adr, ret));
return ret; return ret;
......
...@@ -383,7 +383,7 @@ kvirt_to_pa(unsigned long adr) ...@@ -383,7 +383,7 @@ kvirt_to_pa(unsigned long adr)
unsigned long va, kva, ret; unsigned long va, kva, ret;
va = VMALLOC_VMADDR(adr); va = VMALLOC_VMADDR(adr);
kva = page_address(vmalloc_to_page(pgd_offset_k(va), va)); kva = page_address(vmalloc_to_page(va));
ret = __pa(kva); ret = __pa(kva);
return ret; return ret;
} }
......
...@@ -187,7 +187,7 @@ static inline unsigned long kvirt_to_pa(unsigned long adr) ...@@ -187,7 +187,7 @@ static inline unsigned long kvirt_to_pa(unsigned long adr)
unsigned long va, kva, ret; unsigned long va, kva, ret;
va = VMALLOC_VMADDR(adr); va = VMALLOC_VMADDR(adr);
kva = page_address(vmalloc_to_page(pgd_offset_k(va), va)); kva = page_address(vmalloc_to_page(va));
ret = __pa(kva); ret = __pa(kva);
return ret; return ret;
} }
......
...@@ -92,7 +92,7 @@ static inline unsigned long kvirt_to_pa(unsigned long adr) ...@@ -92,7 +92,7 @@ static inline unsigned long kvirt_to_pa(unsigned long adr)
unsigned long va, kva, ret; unsigned long va, kva, ret;
va = VMALLOC_VMADDR(adr); va = VMALLOC_VMADDR(adr);
kva = page_address(vmalloc_to_page(pgd_offset_k(va), va)); kva = page_address(vmalloc_to_page(va));
ret = __pa(kva); ret = __pa(kva);
return ret; return ret;
} }
......
...@@ -71,7 +71,7 @@ unsigned long usbvideo_kvirt_to_pa(unsigned long adr) ...@@ -71,7 +71,7 @@ unsigned long usbvideo_kvirt_to_pa(unsigned long adr)
unsigned long va, kva, ret; unsigned long va, kva, ret;
va = VMALLOC_VMADDR(adr); va = VMALLOC_VMADDR(adr);
kva = page_address(vmalloc_to_page(pgd_offset_k(va), va)); kva = page_address(vmalloc_to_page(va));
ret = __pa(kva); ret = __pa(kva);
MDEBUG(printk("kv2pa(%lx-->%lx)", adr, ret)); MDEBUG(printk("kv2pa(%lx-->%lx)", adr, ret));
return ret; return ret;
......
...@@ -514,7 +514,7 @@ static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * m ...@@ -514,7 +514,7 @@ static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * m
extern struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr); extern struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr);
extern struct page * vmalloc_to_page(pgd_t *pgd, unsigned long adr); extern struct page * vmalloc_to_page(unsigned long adr);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -1475,9 +1475,10 @@ int make_pages_present(unsigned long addr, unsigned long end) ...@@ -1475,9 +1475,10 @@ int make_pages_present(unsigned long addr, unsigned long end)
/* /*
* Map a vmalloc()-space virtual address to the physical page. * Map a vmalloc()-space virtual address to the physical page.
*/ */
struct page * vmalloc_to_page(pgd_t *pgd, unsigned long addr) struct page * vmalloc_to_page(unsigned long addr)
{ {
struct page *page = NULL; struct page *page = NULL;
pgd_t *pgd = pgd_offset_k(addr);
pmd_t *pmd; pmd_t *pmd;
pte_t *ptep, pte; pte_t *ptep, pte;
......
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