aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/pgtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/include/asm/pgtable.h')
-rw-r--r--arch/s390/include/asm/pgtable.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 011358c1b18e..b3227415abda 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -74,15 +74,15 @@ static inline int is_zero_pfn(unsigned long pfn)
74 * table can map 74 * table can map
75 * PGDIR_SHIFT determines what a third-level page table entry can map 75 * PGDIR_SHIFT determines what a third-level page table entry can map
76 */ 76 */
77#ifndef __s390x__ 77#ifndef CONFIG_64BIT
78# define PMD_SHIFT 20 78# define PMD_SHIFT 20
79# define PUD_SHIFT 20 79# define PUD_SHIFT 20
80# define PGDIR_SHIFT 20 80# define PGDIR_SHIFT 20
81#else /* __s390x__ */ 81#else /* CONFIG_64BIT */
82# define PMD_SHIFT 20 82# define PMD_SHIFT 20
83# define PUD_SHIFT 31 83# define PUD_SHIFT 31
84# define PGDIR_SHIFT 42 84# define PGDIR_SHIFT 42
85#endif /* __s390x__ */ 85#endif /* CONFIG_64BIT */
86 86
87#define PMD_SIZE (1UL << PMD_SHIFT) 87#define PMD_SIZE (1UL << PMD_SHIFT)
88#define PMD_MASK (~(PMD_SIZE-1)) 88#define PMD_MASK (~(PMD_SIZE-1))
@@ -98,13 +98,13 @@ static inline int is_zero_pfn(unsigned long pfn)
98 * that leads to 1024 pte per pgd 98 * that leads to 1024 pte per pgd
99 */ 99 */
100#define PTRS_PER_PTE 256 100#define PTRS_PER_PTE 256
101#ifndef __s390x__ 101#ifndef CONFIG_64BIT
102#define PTRS_PER_PMD 1 102#define PTRS_PER_PMD 1
103#define PTRS_PER_PUD 1 103#define PTRS_PER_PUD 1
104#else /* __s390x__ */ 104#else /* CONFIG_64BIT */
105#define PTRS_PER_PMD 2048 105#define PTRS_PER_PMD 2048
106#define PTRS_PER_PUD 2048 106#define PTRS_PER_PUD 2048
107#endif /* __s390x__ */ 107#endif /* CONFIG_64BIT */
108#define PTRS_PER_PGD 2048 108#define PTRS_PER_PGD 2048
109 109
110#define FIRST_USER_ADDRESS 0 110#define FIRST_USER_ADDRESS 0
@@ -276,7 +276,7 @@ extern struct page *vmemmap;
276 * swap pte is 1011 and 0001, 0011, 0101, 0111 are invalid. 276 * swap pte is 1011 and 0001, 0011, 0101, 0111 are invalid.
277 */ 277 */
278 278
279#ifndef __s390x__ 279#ifndef CONFIG_64BIT
280 280
281/* Bits in the segment table address-space-control-element */ 281/* Bits in the segment table address-space-control-element */
282#define _ASCE_SPACE_SWITCH 0x80000000UL /* space switch event */ 282#define _ASCE_SPACE_SWITCH 0x80000000UL /* space switch event */
@@ -308,7 +308,7 @@ extern struct page *vmemmap;
308#define KVM_UR_BIT 0x00008000UL 308#define KVM_UR_BIT 0x00008000UL
309#define KVM_UC_BIT 0x00004000UL 309#define KVM_UC_BIT 0x00004000UL
310 310
311#else /* __s390x__ */ 311#else /* CONFIG_64BIT */
312 312
313/* Bits in the segment/region table address-space-control-element */ 313/* Bits in the segment/region table address-space-control-element */
314#define _ASCE_ORIGIN ~0xfffUL/* segment table origin */ 314#define _ASCE_ORIGIN ~0xfffUL/* segment table origin */
@@ -363,7 +363,7 @@ extern struct page *vmemmap;
363#define KVM_UR_BIT 0x0000800000000000UL 363#define KVM_UR_BIT 0x0000800000000000UL
364#define KVM_UC_BIT 0x0000400000000000UL 364#define KVM_UC_BIT 0x0000400000000000UL
365 365
366#endif /* __s390x__ */ 366#endif /* CONFIG_64BIT */
367 367
368/* 368/*
369 * A user page table pointer has the space-switch-event bit, the 369 * A user page table pointer has the space-switch-event bit, the
@@ -424,7 +424,7 @@ static inline int mm_has_pgste(struct mm_struct *mm)
424/* 424/*
425 * pgd/pmd/pte query functions 425 * pgd/pmd/pte query functions
426 */ 426 */
427#ifndef __s390x__ 427#ifndef CONFIG_64BIT
428 428
429static inline int pgd_present(pgd_t pgd) { return 1; } 429static inline int pgd_present(pgd_t pgd) { return 1; }
430static inline int pgd_none(pgd_t pgd) { return 0; } 430static inline int pgd_none(pgd_t pgd) { return 0; }
@@ -434,7 +434,7 @@ static inline int pud_present(pud_t pud) { return 1; }
434static inline int pud_none(pud_t pud) { return 0; } 434static inline int pud_none(pud_t pud) { return 0; }
435static inline int pud_bad(pud_t pud) { return 0; } 435static inline int pud_bad(pud_t pud) { return 0; }
436 436
437#else /* __s390x__ */ 437#else /* CONFIG_64BIT */
438 438
439static inline int pgd_present(pgd_t pgd) 439static inline int pgd_present(pgd_t pgd)
440{ 440{
@@ -490,7 +490,7 @@ static inline int pud_bad(pud_t pud)
490 return (pud_val(pud) & mask) != 0; 490 return (pud_val(pud) & mask) != 0;
491} 491}
492 492
493#endif /* __s390x__ */ 493#endif /* CONFIG_64BIT */
494 494
495static inline int pmd_present(pmd_t pmd) 495static inline int pmd_present(pmd_t pmd)
496{ 496{
@@ -741,7 +741,7 @@ static inline int pte_young(pte_t pte)
741 741
742static inline void pgd_clear(pgd_t *pgd) 742static inline void pgd_clear(pgd_t *pgd)
743{ 743{
744#ifdef __s390x__ 744#ifdef CONFIG_64BIT
745 if ((pgd_val(*pgd) & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R2) 745 if ((pgd_val(*pgd) & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R2)
746 pgd_val(*pgd) = _REGION2_ENTRY_EMPTY; 746 pgd_val(*pgd) = _REGION2_ENTRY_EMPTY;
747#endif 747#endif
@@ -749,7 +749,7 @@ static inline void pgd_clear(pgd_t *pgd)
749 749
750static inline void pud_clear(pud_t *pud) 750static inline void pud_clear(pud_t *pud)
751{ 751{
752#ifdef __s390x__ 752#ifdef CONFIG_64BIT
753 if ((pud_val(*pud) & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R3) 753 if ((pud_val(*pud) & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R3)
754 pud_val(*pud) = _REGION3_ENTRY_EMPTY; 754 pud_val(*pud) = _REGION3_ENTRY_EMPTY;
755#endif 755#endif
@@ -921,7 +921,7 @@ static inline int ptep_clear_flush_young(struct vm_area_struct *vma,
921static inline void __ptep_ipte(unsigned long address, pte_t *ptep) 921static inline void __ptep_ipte(unsigned long address, pte_t *ptep)
922{ 922{
923 if (!(pte_val(*ptep) & _PAGE_INVALID)) { 923 if (!(pte_val(*ptep) & _PAGE_INVALID)) {
924#ifndef __s390x__ 924#ifndef CONFIG_64BIT
925 /* pto must point to the start of the segment table */ 925 /* pto must point to the start of the segment table */
926 pte_t *pto = (pte_t *) (((unsigned long) ptep) & 0x7ffffc00); 926 pte_t *pto = (pte_t *) (((unsigned long) ptep) & 0x7ffffc00);
927#else 927#else
@@ -1116,7 +1116,7 @@ static inline pte_t mk_pte(struct page *page, pgprot_t pgprot)
1116#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) 1116#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
1117#define pgd_offset_k(address) pgd_offset(&init_mm, address) 1117#define pgd_offset_k(address) pgd_offset(&init_mm, address)
1118 1118
1119#ifndef __s390x__ 1119#ifndef CONFIG_64BIT
1120 1120
1121#define pmd_deref(pmd) (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN) 1121#define pmd_deref(pmd) (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN)
1122#define pud_deref(pmd) ({ BUG(); 0UL; }) 1122#define pud_deref(pmd) ({ BUG(); 0UL; })
@@ -1125,7 +1125,7 @@ static inline pte_t mk_pte(struct page *page, pgprot_t pgprot)
1125#define pud_offset(pgd, address) ((pud_t *) pgd) 1125#define pud_offset(pgd, address) ((pud_t *) pgd)
1126#define pmd_offset(pud, address) ((pmd_t *) pud + pmd_index(address)) 1126#define pmd_offset(pud, address) ((pmd_t *) pud + pmd_index(address))
1127 1127
1128#else /* __s390x__ */ 1128#else /* CONFIG_64BIT */
1129 1129
1130#define pmd_deref(pmd) (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN) 1130#define pmd_deref(pmd) (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN)
1131#define pud_deref(pud) (pud_val(pud) & _REGION_ENTRY_ORIGIN) 1131#define pud_deref(pud) (pud_val(pud) & _REGION_ENTRY_ORIGIN)
@@ -1147,7 +1147,7 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
1147 return pmd + pmd_index(address); 1147 return pmd + pmd_index(address);
1148} 1148}
1149 1149
1150#endif /* __s390x__ */ 1150#endif /* CONFIG_64BIT */
1151 1151
1152#define pfn_pte(pfn,pgprot) mk_pte_phys(__pa((pfn) << PAGE_SHIFT),(pgprot)) 1152#define pfn_pte(pfn,pgprot) mk_pte_phys(__pa((pfn) << PAGE_SHIFT),(pgprot))
1153#define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT) 1153#define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT)
@@ -1196,7 +1196,7 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
1196 * 0000000000111111111122222222223333333333444444444455 5555 5 55566 66 1196 * 0000000000111111111122222222223333333333444444444455 5555 5 55566 66
1197 * 0123456789012345678901234567890123456789012345678901 2345 6 78901 23 1197 * 0123456789012345678901234567890123456789012345678901 2345 6 78901 23
1198 */ 1198 */
1199#ifndef __s390x__ 1199#ifndef CONFIG_64BIT
1200#define __SWP_OFFSET_MASK (~0UL >> 12) 1200#define __SWP_OFFSET_MASK (~0UL >> 12)
1201#else 1201#else
1202#define __SWP_OFFSET_MASK (~0UL >> 11) 1202#define __SWP_OFFSET_MASK (~0UL >> 11)
@@ -1217,11 +1217,11 @@ static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
1217#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 1217#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
1218#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 1218#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
1219 1219
1220#ifndef __s390x__ 1220#ifndef CONFIG_64BIT
1221# define PTE_FILE_MAX_BITS 26 1221# define PTE_FILE_MAX_BITS 26
1222#else /* __s390x__ */ 1222#else /* CONFIG_64BIT */
1223# define PTE_FILE_MAX_BITS 59 1223# define PTE_FILE_MAX_BITS 59
1224#endif /* __s390x__ */ 1224#endif /* CONFIG_64BIT */
1225 1225
1226#define pte_to_pgoff(__pte) \ 1226#define pte_to_pgoff(__pte) \
1227 ((((__pte).pte >> 12) << 7) + (((__pte).pte >> 1) & 0x7f)) 1227 ((((__pte).pte >> 12) << 7) + (((__pte).pte >> 1) & 0x7f))