X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-s390%2Fpgtable.h;h=85f043c6d5cfffd393aa490fcfd96a050d54bc19;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=05ac76fd38a42a2a4eb6959cf4075ed2aa6057b8;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h index 05ac76fd3..85f043c6d 100644 --- a/include/asm-s390/pgtable.h +++ b/include/asm-s390/pgtable.h @@ -13,6 +13,8 @@ #ifndef _ASM_S390_PGTABLE_H #define _ASM_S390_PGTABLE_H +#include + /* * The Linux memory management assumes a three-level page table setup. For * s390 31 bit we "fold" the mid level into the top-level page table, so @@ -416,6 +418,14 @@ extern inline int pte_young(pte_t pte) return 0; } +extern inline int pte_read(pte_t pte) +{ + /* All pages are readable since we don't use the fetch + * protection bit in the storage key. + */ + return 1; +} + /* * pgd/pmd/pte modification functions */ @@ -597,17 +607,13 @@ ptep_establish(struct vm_area_struct *vma, * should therefore only be called if it is not mapped in any * address space. */ -#define page_test_and_clear_dirty(page) \ +#define page_test_and_clear_dirty(_page) \ ({ \ - struct page *__page = (page); \ + struct page *__page = (_page); \ unsigned long __physpage = __pa((__page-mem_map) << PAGE_SHIFT); \ - int __skey; \ - asm volatile ("iske %0,%1" : "=d" (__skey) : "a" (__physpage)); \ - if (__skey & _PAGE_CHANGED) { \ - asm volatile ("sske %0,%1" \ - : : "d" (__skey & ~_PAGE_CHANGED), \ - "a" (__physpage)); \ - } \ + int __skey = page_get_storage_key(__physpage); \ + if (__skey & _PAGE_CHANGED) \ + page_set_storage_key(__physpage, __skey & ~_PAGE_CHANGED);\ (__skey & _PAGE_CHANGED); \ }) @@ -655,11 +661,10 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot) }) #define SetPageUptodate(_page) \ - do { \ - struct page *__page = (_page); \ - if (!test_and_set_bit(PG_uptodate, &__page->flags)) \ - asm volatile ("sske %0,%1" : : "d" (0), \ - "a" (__pa((__page-mem_map) << PAGE_SHIFT)));\ + do { \ + struct page *__page = (_page); \ + if (!test_and_set_bit(PG_uptodate, &__page->flags)) \ + page_test_and_clear_dirty(_page); \ } while (0) #ifdef __s390x__ @@ -684,7 +689,7 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot) #define pgd_page_kernel(pgd) (pgd_val(pgd) & PAGE_MASK) /* to find an entry in a page-table-directory */ -#define pgd_index(address) ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) +#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) #define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address)) /* to find an entry in a kernel page-table-directory */