aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-s390/pgtable.h
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2006-10-04 14:02:23 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2006-10-04 14:02:23 -0400
commit0b2b6e1ddce4696cb7afcbb15a654fe95428a498 (patch)
treea6dd837de5ce7088ab1009d125e8bcd6cfeaa1e1 /include/asm-s390/pgtable.h
parent7676bef9c183fd573822cac9992927ef596d584c (diff)
[S390] Remove open-coded mem_map usage.
Use page_to_phys and pfn_to_page to avoid open-coded mem_map usage. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'include/asm-s390/pgtable.h')
-rw-r--r--include/asm-s390/pgtable.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
index ecdff13b2505..519f0a5ff181 100644
--- a/include/asm-s390/pgtable.h
+++ b/include/asm-s390/pgtable.h
@@ -599,7 +599,7 @@ ptep_establish(struct vm_area_struct *vma,
599 */ 599 */
600static inline int page_test_and_clear_dirty(struct page *page) 600static inline int page_test_and_clear_dirty(struct page *page)
601{ 601{
602 unsigned long physpage = __pa((page - mem_map) << PAGE_SHIFT); 602 unsigned long physpage = page_to_phys(page);
603 int skey = page_get_storage_key(physpage); 603 int skey = page_get_storage_key(physpage);
604 604
605 if (skey & _PAGE_CHANGED) 605 if (skey & _PAGE_CHANGED)
@@ -612,13 +612,13 @@ static inline int page_test_and_clear_dirty(struct page *page)
612 */ 612 */
613static inline int page_test_and_clear_young(struct page *page) 613static inline int page_test_and_clear_young(struct page *page)
614{ 614{
615 unsigned long physpage = __pa((page - mem_map) << PAGE_SHIFT); 615 unsigned long physpage = page_to_phys(page);
616 int ccode; 616 int ccode;
617 617
618 asm volatile ( 618 asm volatile(
619 "rrbe 0,%1\n" 619 " rrbe 0,%1\n"
620 "ipm %0\n" 620 " ipm %0\n"
621 "srl %0,28\n" 621 " srl %0,28\n"
622 : "=d" (ccode) : "a" (physpage) : "cc" ); 622 : "=d" (ccode) : "a" (physpage) : "cc" );
623 return ccode & 2; 623 return ccode & 2;
624} 624}
@@ -636,7 +636,7 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
636 636
637static inline pte_t mk_pte(struct page *page, pgprot_t pgprot) 637static inline pte_t mk_pte(struct page *page, pgprot_t pgprot)
638{ 638{
639 unsigned long physpage = __pa((page - mem_map) << PAGE_SHIFT); 639 unsigned long physpage = page_to_phys(page);
640 640
641 return mk_pte_phys(physpage, pgprot); 641 return mk_pte_phys(physpage, pgprot);
642} 642}
@@ -664,11 +664,11 @@ static inline pmd_t pfn_pmd(unsigned long pfn, pgprot_t pgprot)
664 664
665#define pmd_page_vaddr(pmd) (pmd_val(pmd) & PAGE_MASK) 665#define pmd_page_vaddr(pmd) (pmd_val(pmd) & PAGE_MASK)
666 666
667#define pmd_page(pmd) (mem_map+(pmd_val(pmd) >> PAGE_SHIFT)) 667#define pmd_page(pmd) pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)
668 668
669#define pgd_page_vaddr(pgd) (pgd_val(pgd) & PAGE_MASK) 669#define pgd_page_vaddr(pgd) (pgd_val(pgd) & PAGE_MASK)
670 670
671#define pgd_page(pgd) (mem_map+(pgd_val(pgd) >> PAGE_SHIFT)) 671#define pgd_page(pgd) pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT)
672 672
673/* to find an entry in a page-table-directory */ 673/* to find an entry in a page-table-directory */
674#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) 674#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))