From: NIIBE Y. <gn...@m1...> - 2002-03-22 03:57:23
|
More follow-up to 2.5.5. 2002-03-22 NIIBE Yutaka <gn...@se...> * include/asm-sh/pgtable.h (pmd_page_kernel): Renamed from pmd_page. (pmd_page): New macro for user page. (pte_offset_kernel): New macro. (pte_offset_map, pte_offset_map_nested, pte_unmap, pte_unmap_nested): New macros. * arch/sh/mm/ioremap.c (remap_area_pmd): Use pte_alloc_kernel (was: pte_alloc). Index: arch/sh/mm/ioremap.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/mm/ioremap.c,v retrieving revision 1.1.1.1 diff -u -3 -p -r1.1.1.1 ioremap.c --- arch/sh/mm/ioremap.c 15 Oct 2001 20:44:54 -0000 1.1.1.1 +++ arch/sh/mm/ioremap.c 22 Mar 2002 03:47:36 -0000 @@ -52,7 +52,7 @@ static inline int remap_area_pmd(pmd_t * if (address >= end) BUG(); do { - pte_t * pte = pte_alloc(&init_mm, pmd, address); + pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address); if (!pte) return -ENOMEM; remap_area_pte(pte, address, end - address, address + phys_addr, flags); Index: include/asm-sh/pgtable.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/pgtable.h,v retrieving revision 1.5 diff -u -3 -p -r1.5 pgtable.h --- include/asm-sh/pgtable.h 22 Mar 2002 00:59:15 -0000 1.5 +++ include/asm-sh/pgtable.h 22 Mar 2002 03:47:36 -0000 @@ -269,9 +271,12 @@ static inline pte_t pte_modify(pte_t pte #define page_pte(page) page_pte_prot(page, __pgprot(0)) -#define pmd_page(pmd) \ +#define pmd_page_kernel(pmd) \ ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) +#define pmd_page(pmd) \ + (phys_to_page(pmd_val(pmd))) + /* to find an entry in a page-table-directory. */ #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) #define __pgd_offset(address) pgd_index(address) @@ -283,8 +288,13 @@ static inline pte_t pte_modify(pte_t pte /* Find an entry in the third-level page table.. */ #define __pte_offset(address) \ ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) -#define pte_offset(dir, address) ((pte_t *) pmd_page(*(dir)) + \ - __pte_offset(address)) +#define pte_offset_kernel(dir, address) \ + ((pte_t *) pmd_page_kernel(*(dir)) + __pte_offset(address)) +#define pte_offset_map(dir, address) \ + ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address)) +#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address) +#define pte_unmap(pte) do { } while (0) +#define pte_unmap_nested(pte) do { } while (0) extern void update_mmu_cache(struct vm_area_struct * vma, unsigned long address, pte_t pte); |