pgtable.h (b0412ea94bcbd08dc1e61043dfdd9c33272cec48) | pgtable.h (f281b5d50c87ecca108dcbf8f791bd8923fde3de) |
---|---|
1#ifndef _ASM_POWERPC_BOOK3S_64_PGTABLE_H_ 2#define _ASM_POWERPC_BOOK3S_64_PGTABLE_H_ 3/* 4 * This file contains the functions and defines necessary to modify and use 5 * the ppc64 hashed page table. 6 */ 7 8#include <asm/book3s/64/hash.h> --- 222 unchanged lines hidden (view full) --- 231#endif /* __real_pte */ 232 233 234/* pte_clear moved to later in this file */ 235 236#define PMD_BAD_BITS (PTE_TABLE_SIZE-1) 237#define PUD_BAD_BITS (PMD_TABLE_SIZE-1) 238 | 1#ifndef _ASM_POWERPC_BOOK3S_64_PGTABLE_H_ 2#define _ASM_POWERPC_BOOK3S_64_PGTABLE_H_ 3/* 4 * This file contains the functions and defines necessary to modify and use 5 * the ppc64 hashed page table. 6 */ 7 8#include <asm/book3s/64/hash.h> --- 222 unchanged lines hidden (view full) --- 231#endif /* __real_pte */ 232 233 234/* pte_clear moved to later in this file */ 235 236#define PMD_BAD_BITS (PTE_TABLE_SIZE-1) 237#define PUD_BAD_BITS (PMD_TABLE_SIZE-1) 238 |
239#define pmd_set(pmdp, pmdval) (pmd_val(*(pmdp)) = (pmdval)) | 239static inline void pmd_set(pmd_t *pmdp, unsigned long val) 240{ 241 *pmdp = __pmd(val); 242} 243 244static inline void pmd_clear(pmd_t *pmdp) 245{ 246 *pmdp = __pmd(0); 247} 248 249 |
240#define pmd_none(pmd) (!pmd_val(pmd)) 241#define pmd_bad(pmd) (!is_kernel_addr(pmd_val(pmd)) \ 242 || (pmd_val(pmd) & PMD_BAD_BITS)) 243#define pmd_present(pmd) (!pmd_none(pmd)) | 250#define pmd_none(pmd) (!pmd_val(pmd)) 251#define pmd_bad(pmd) (!is_kernel_addr(pmd_val(pmd)) \ 252 || (pmd_val(pmd) & PMD_BAD_BITS)) 253#define pmd_present(pmd) (!pmd_none(pmd)) |
244#define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0) | |
245#define pmd_page_vaddr(pmd) (pmd_val(pmd) & ~PMD_MASKED_BITS) 246extern struct page *pmd_page(pmd_t pmd); 247 | 254#define pmd_page_vaddr(pmd) (pmd_val(pmd) & ~PMD_MASKED_BITS) 255extern struct page *pmd_page(pmd_t pmd); 256 |
248#define pud_set(pudp, pudval) (pud_val(*(pudp)) = (pudval)) | 257static inline void pud_set(pud_t *pudp, unsigned long val) 258{ 259 *pudp = __pud(val); 260} 261 262static inline void pud_clear(pud_t *pudp) 263{ 264 *pudp = __pud(0); 265} 266 |
249#define pud_none(pud) (!pud_val(pud)) 250#define pud_bad(pud) (!is_kernel_addr(pud_val(pud)) \ 251 || (pud_val(pud) & PUD_BAD_BITS)) 252#define pud_present(pud) (pud_val(pud) != 0) | 267#define pud_none(pud) (!pud_val(pud)) 268#define pud_bad(pud) (!is_kernel_addr(pud_val(pud)) \ 269 || (pud_val(pud) & PUD_BAD_BITS)) 270#define pud_present(pud) (pud_val(pud) != 0) |
253#define pud_clear(pudp) (pud_val(*(pudp)) = 0) | |
254#define pud_page_vaddr(pud) (pud_val(pud) & ~PUD_MASKED_BITS) 255 256extern struct page *pud_page(pud_t pud); 257 258static inline pte_t pud_pte(pud_t pud) 259{ 260 return __pte(pud_val(pud)); 261} 262 263static inline pud_t pte_pud(pte_t pte) 264{ 265 return __pud(pte_val(pte)); 266} 267#define pud_write(pud) pte_write(pud_pte(pud)) | 271#define pud_page_vaddr(pud) (pud_val(pud) & ~PUD_MASKED_BITS) 272 273extern struct page *pud_page(pud_t pud); 274 275static inline pte_t pud_pte(pud_t pud) 276{ 277 return __pte(pud_val(pud)); 278} 279 280static inline pud_t pte_pud(pte_t pte) 281{ 282 return __pud(pte_val(pte)); 283} 284#define pud_write(pud) pte_write(pud_pte(pud)) |
268#define pgd_set(pgdp, pudp) ({pgd_val(*(pgdp)) = (unsigned long)(pudp);}) | |
269#define pgd_write(pgd) pte_write(pgd_pte(pgd)) | 285#define pgd_write(pgd) pte_write(pgd_pte(pgd)) |
286static inline void pgd_set(pgd_t *pgdp, unsigned long val) 287{ 288 *pgdp = __pgd(val); 289} |
|
270 271/* 272 * Find an entry in a page-table-directory. We combine the address region 273 * (the high order N bits) and the pgd portion of the address. 274 */ 275#define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & (PTRS_PER_PGD - 1)) 276 277#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) --- 305 unchanged lines hidden (view full) --- 583static inline pmd_t pmd_mkhuge(pmd_t pmd) 584{ 585 /* Do nothing, mk_pmd() does this part. */ 586 return pmd; 587} 588 589static inline pmd_t pmd_mknotpresent(pmd_t pmd) 590{ | 290 291/* 292 * Find an entry in a page-table-directory. We combine the address region 293 * (the high order N bits) and the pgd portion of the address. 294 */ 295#define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & (PTRS_PER_PGD - 1)) 296 297#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) --- 305 unchanged lines hidden (view full) --- 603static inline pmd_t pmd_mkhuge(pmd_t pmd) 604{ 605 /* Do nothing, mk_pmd() does this part. */ 606 return pmd; 607} 608 609static inline pmd_t pmd_mknotpresent(pmd_t pmd) 610{ |
591 pmd_val(pmd) &= ~_PAGE_PRESENT; 592 return pmd; | 611 return __pmd(pmd_val(pmd) & ~_PAGE_PRESENT); |
593} 594 595static inline pmd_t pmd_mksplitting(pmd_t pmd) 596{ | 612} 613 614static inline pmd_t pmd_mksplitting(pmd_t pmd) 615{ |
597 pmd_val(pmd) |= _PAGE_SPLITTING; 598 return pmd; | 616 return __pmd(pmd_val(pmd) | _PAGE_SPLITTING); |
599} 600 601#define __HAVE_ARCH_PMD_SAME 602static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) 603{ 604 return (((pmd_val(pmd_a) ^ pmd_val(pmd_b)) & ~_PAGE_HPTEFLAGS) == 0); 605} 606 --- 76 unchanged lines hidden --- | 617} 618 619#define __HAVE_ARCH_PMD_SAME 620static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) 621{ 622 return (((pmd_val(pmd_a) ^ pmd_val(pmd_b)) & ~_PAGE_HPTEFLAGS) == 0); 623} 624 --- 76 unchanged lines hidden --- |