aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/s390/appldata/appldata_base.c2
-rw-r--r--include/asm-s390/pgtable.h84
-rw-r--r--include/linux/page-flags.h11
3 files changed, 46 insertions, 51 deletions
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 9a8f6ff21652..2b1e6c9a6e0e 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -16,7 +16,7 @@
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/proc_fs.h> 18#include <linux/proc_fs.h>
19#include <linux/page-flags.h> 19#include <linux/mm.h>
20#include <linux/swap.h> 20#include <linux/swap.h>
21#include <linux/pagemap.h> 21#include <linux/pagemap.h>
22#include <linux/sysctl.h> 22#include <linux/sysctl.h>
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
index 83425cdefc91..ecdff13b2505 100644
--- a/include/asm-s390/pgtable.h
+++ b/include/asm-s390/pgtable.h
@@ -31,9 +31,9 @@
31 * the S390 page table tree. 31 * the S390 page table tree.
32 */ 32 */
33#ifndef __ASSEMBLY__ 33#ifndef __ASSEMBLY__
34#include <linux/mm_types.h>
34#include <asm/bug.h> 35#include <asm/bug.h>
35#include <asm/processor.h> 36#include <asm/processor.h>
36#include <linux/threads.h>
37 37
38struct vm_area_struct; /* forward declaration (include/linux/mm.h) */ 38struct vm_area_struct; /* forward declaration (include/linux/mm.h) */
39struct mm_struct; 39struct mm_struct;
@@ -597,31 +597,31 @@ ptep_establish(struct vm_area_struct *vma,
597 * should therefore only be called if it is not mapped in any 597 * should therefore only be called if it is not mapped in any
598 * address space. 598 * address space.
599 */ 599 */
600#define page_test_and_clear_dirty(_page) \ 600static inline int page_test_and_clear_dirty(struct page *page)
601({ \ 601{
602 struct page *__page = (_page); \ 602 unsigned long physpage = __pa((page - mem_map) << PAGE_SHIFT);
603 unsigned long __physpage = __pa((__page-mem_map) << PAGE_SHIFT); \ 603 int skey = page_get_storage_key(physpage);
604 int __skey = page_get_storage_key(__physpage); \ 604
605 if (__skey & _PAGE_CHANGED) \ 605 if (skey & _PAGE_CHANGED)
606 page_set_storage_key(__physpage, __skey & ~_PAGE_CHANGED);\ 606 page_set_storage_key(physpage, skey & ~_PAGE_CHANGED);
607 (__skey & _PAGE_CHANGED); \ 607 return skey & _PAGE_CHANGED;
608}) 608}
609 609
610/* 610/*
611 * Test and clear referenced bit in storage key. 611 * Test and clear referenced bit in storage key.
612 */ 612 */
613#define page_test_and_clear_young(page) \ 613static inline int page_test_and_clear_young(struct page *page)
614({ \ 614{
615 struct page *__page = (page); \ 615 unsigned long physpage = __pa((page - mem_map) << PAGE_SHIFT);
616 unsigned long __physpage = __pa((__page-mem_map) << PAGE_SHIFT);\ 616 int ccode;
617 int __ccode; \ 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 (__ccode & 2); \ 623 return ccode & 2;
624}) 624}
625 625
626/* 626/*
627 * Conversion functions: convert a page and protection to a page entry, 627 * Conversion functions: convert a page and protection to a page entry,
@@ -634,32 +634,28 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
634 return __pte; 634 return __pte;
635} 635}
636 636
637#define mk_pte(pg, pgprot) \ 637static inline pte_t mk_pte(struct page *page, pgprot_t pgprot)
638({ \ 638{
639 struct page *__page = (pg); \ 639 unsigned long physpage = __pa((page - mem_map) << PAGE_SHIFT);
640 pgprot_t __pgprot = (pgprot); \
641 unsigned long __physpage = __pa((__page-mem_map) << PAGE_SHIFT); \
642 pte_t __pte = mk_pte_phys(__physpage, __pgprot); \
643 __pte; \
644})
645 640
646#define pfn_pte(pfn, pgprot) \ 641 return mk_pte_phys(physpage, pgprot);
647({ \ 642}
648 pgprot_t __pgprot = (pgprot); \ 643
649 unsigned long __physpage = __pa((pfn) << PAGE_SHIFT); \ 644static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
650 pte_t __pte = mk_pte_phys(__physpage, __pgprot); \ 645{
651 __pte; \ 646 unsigned long physpage = __pa((pfn) << PAGE_SHIFT);
652}) 647
648 return mk_pte_phys(physpage, pgprot);
649}
653 650
654#ifdef __s390x__ 651#ifdef __s390x__
655 652
656#define pfn_pmd(pfn, pgprot) \ 653static inline pmd_t pfn_pmd(unsigned long pfn, pgprot_t pgprot)
657({ \ 654{
658 pgprot_t __pgprot = (pgprot); \ 655 unsigned long physpage = __pa((pfn) << PAGE_SHIFT);
659 unsigned long __physpage = __pa((pfn) << PAGE_SHIFT); \ 656
660 pmd_t __pmd = __pmd(__physpage + pgprot_val(__pgprot)); \ 657 return __pmd(physpage + pgprot_val(pgprot));
661 __pmd; \ 658}
662})
663 659
664#endif /* __s390x__ */ 660#endif /* __s390x__ */
665 661
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 9d7921dd50f0..4830a3bedfb2 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -128,12 +128,11 @@
128 128
129#define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags) 129#define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags)
130#ifdef CONFIG_S390 130#ifdef CONFIG_S390
131#define SetPageUptodate(_page) \ 131static inline void SetPageUptodate(struct page *page)
132 do { \ 132{
133 struct page *__page = (_page); \ 133 if (!test_and_set_bit(PG_uptodate, &page->flags))
134 if (!test_and_set_bit(PG_uptodate, &__page->flags)) \ 134 page_test_and_clear_dirty(page);
135 page_test_and_clear_dirty(_page); \ 135}
136 } while (0)
137#else 136#else
138#define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags) 137#define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags)
139#endif 138#endif