hugetlb.h (cf9ce948f47640797bd19980e1d99c6d17d0bdc3) hugetlb.h (106c992a5ebef28193cf5958e49ceff5e4aebb04)
1/*
2 * IBM System z Huge TLB Page Support for Kernel.
3 *
4 * Copyright IBM Corp. 2008
5 * Author(s): Gerald Schaefer <gerald.schaefer@de.ibm.com>
6 */
7
8#ifndef _ASM_S390_HUGETLB_H

--- 100 unchanged lines hidden (view full) ---

109 set_huge_pte_at((__vma)->vm_mm, __addr, __ptep, __entry); \
110 } \
111 __changed; \
112})
113
114#define huge_ptep_set_wrprotect(__mm, __addr, __ptep) \
115({ \
116 pte_t __pte = huge_ptep_get(__ptep); \
1/*
2 * IBM System z Huge TLB Page Support for Kernel.
3 *
4 * Copyright IBM Corp. 2008
5 * Author(s): Gerald Schaefer <gerald.schaefer@de.ibm.com>
6 */
7
8#ifndef _ASM_S390_HUGETLB_H

--- 100 unchanged lines hidden (view full) ---

109 set_huge_pte_at((__vma)->vm_mm, __addr, __ptep, __entry); \
110 } \
111 __changed; \
112})
113
114#define huge_ptep_set_wrprotect(__mm, __addr, __ptep) \
115({ \
116 pte_t __pte = huge_ptep_get(__ptep); \
117 if (pte_write(__pte)) { \
117 if (huge_pte_write(__pte)) { \
118 huge_ptep_invalidate(__mm, __addr, __ptep); \
119 set_huge_pte_at(__mm, __addr, __ptep, \
120 huge_pte_wrprotect(__pte)); \
121 } \
122})
123
124static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
125 unsigned long address, pte_t *ptep)
126{
127 huge_ptep_invalidate(vma->vm_mm, address, ptep);
128}
129
118 huge_ptep_invalidate(__mm, __addr, __ptep); \
119 set_huge_pte_at(__mm, __addr, __ptep, \
120 huge_pte_wrprotect(__pte)); \
121 } \
122})
123
124static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
125 unsigned long address, pte_t *ptep)
126{
127 huge_ptep_invalidate(vma->vm_mm, address, ptep);
128}
129
130static inline pte_t mk_huge_pte(struct page *page, pgprot_t pgprot)
131{
132 pte_t pte;
133 pmd_t pmd;
134
135 pmd = mk_pmd_phys(page_to_phys(page), pgprot);
136 pte_val(pte) = pmd_val(pmd);
137 return pte;
138}
139
140static inline int huge_pte_write(pte_t pte)
141{
142 pmd_t pmd;
143
144 pmd_val(pmd) = pte_val(pte);
145 return pmd_write(pmd);
146}
147
148static inline int huge_pte_dirty(pte_t pte)
149{
150 /* No dirty bit in the segment table entry. */
151 return 0;
152}
153
154static inline pte_t huge_pte_mkwrite(pte_t pte)
155{
156 pmd_t pmd;
157
158 pmd_val(pmd) = pte_val(pte);
159 pte_val(pte) = pmd_val(pmd_mkwrite(pmd));
160 return pte;
161}
162
163static inline pte_t huge_pte_mkdirty(pte_t pte)
164{
165 /* No dirty bit in the segment table entry. */
166 return pte;
167}
168
169static inline pte_t huge_pte_modify(pte_t pte, pgprot_t newprot)
170{
171 pmd_t pmd;
172
173 pmd_val(pmd) = pte_val(pte);
174 pte_val(pte) = pmd_val(pmd_modify(pmd, newprot));
175 return pte;
176}
177
178static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
179 pte_t *ptep)
180{
181 pmd_clear((pmd_t *) ptep);
182}
183
130#endif /* _ASM_S390_HUGETLB_H */
184#endif /* _ASM_S390_HUGETLB_H */