diff options
Diffstat (limited to 'include/asm-um')
-rw-r--r-- | include/asm-um/page.h | 3 | ||||
-rw-r--r-- | include/asm-um/pgtable.h | 16 |
2 files changed, 12 insertions, 7 deletions
diff --git a/include/asm-um/page.h b/include/asm-um/page.h index bd850a2..2c192ab 100644 --- a/include/asm-um/page.h +++ b/include/asm-um/page.h @@ -96,8 +96,7 @@ extern unsigned long uml_physmem; #define __va_space (8*1024*1024) -extern unsigned long to_phys(void *virt); -extern void *to_virt(unsigned long phys); +#include "mem.h" /* Cast to unsigned long before casting to void * to avoid a warning from * mmap_kmem about cutting a long long down to a void *. Not sure that diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h index b48e096..ed06170 100644 --- a/include/asm-um/pgtable.h +++ b/include/asm-um/pgtable.h @@ -326,14 +326,22 @@ static inline void set_pte(pte_t *pteptr, pte_t pteval) } #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) -extern phys_t page_to_phys(struct page *page); - /* * Conversion functions: convert a page and protection to a page entry, * and a page entry and page directory to the page they refer to. */ -extern pte_t mk_pte(struct page *page, pgprot_t pgprot); +#define phys_to_page(phys) pfn_to_page(phys_to_pfn(phys)) +#define __virt_to_page(virt) phys_to_page(__pa(virt)) +#define page_to_phys(page) pfn_to_phys(page_to_pfn(page)) + +#define mk_pte(page, pgprot) \ + ({ pte_t pte; \ + \ + pte_set_val(pte, page_to_phys(page), (pgprot)); \ + if (pte_present(pte)) \ + pte_mknewprot(pte_mknewpage(pte)); \ + pte;}) static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) { @@ -410,8 +418,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) #endif #endif -extern struct page *phys_to_page(const unsigned long phys); -extern struct page *__virt_to_page(const unsigned long virt); #define virt_to_page(addr) __virt_to_page((const unsigned long) addr) /* |