aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-s390/pgtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-s390/pgtable.h')
-rw-r--r--include/asm-s390/pgtable.h69
1 files changed, 35 insertions, 34 deletions
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
index df94f89038cc..859b5e969826 100644
--- a/include/asm-s390/pgtable.h
+++ b/include/asm-s390/pgtable.h
@@ -36,6 +36,7 @@
36#include <linux/threads.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;
39 40
40extern pgd_t swapper_pg_dir[] __attribute__ ((aligned (4096))); 41extern pgd_t swapper_pg_dir[] __attribute__ ((aligned (4096)));
41extern void paging_init(void); 42extern void paging_init(void);
@@ -318,7 +319,7 @@ extern char empty_zero_page[PAGE_SIZE];
318 * within a page table are directly modified. Thus, the following 319 * within a page table are directly modified. Thus, the following
319 * hook is made available. 320 * hook is made available.
320 */ 321 */
321extern inline void set_pte(pte_t *pteptr, pte_t pteval) 322static inline void set_pte(pte_t *pteptr, pte_t pteval)
322{ 323{
323 *pteptr = pteval; 324 *pteptr = pteval;
324} 325}
@@ -329,63 +330,63 @@ extern inline void set_pte(pte_t *pteptr, pte_t pteval)
329 */ 330 */
330#ifndef __s390x__ 331#ifndef __s390x__
331 332
332extern inline int pgd_present(pgd_t pgd) { return 1; } 333static inline int pgd_present(pgd_t pgd) { return 1; }
333extern inline int pgd_none(pgd_t pgd) { return 0; } 334static inline int pgd_none(pgd_t pgd) { return 0; }
334extern inline int pgd_bad(pgd_t pgd) { return 0; } 335static inline int pgd_bad(pgd_t pgd) { return 0; }
335 336
336extern inline int pmd_present(pmd_t pmd) { return pmd_val(pmd) & _SEG_PRESENT; } 337static inline int pmd_present(pmd_t pmd) { return pmd_val(pmd) & _SEG_PRESENT; }
337extern inline int pmd_none(pmd_t pmd) { return pmd_val(pmd) & _PAGE_TABLE_INV; } 338static inline int pmd_none(pmd_t pmd) { return pmd_val(pmd) & _PAGE_TABLE_INV; }
338extern inline int pmd_bad(pmd_t pmd) 339static inline int pmd_bad(pmd_t pmd)
339{ 340{
340 return (pmd_val(pmd) & (~PAGE_MASK & ~_PAGE_TABLE_INV)) != _PAGE_TABLE; 341 return (pmd_val(pmd) & (~PAGE_MASK & ~_PAGE_TABLE_INV)) != _PAGE_TABLE;
341} 342}
342 343
343#else /* __s390x__ */ 344#else /* __s390x__ */
344 345
345extern inline int pgd_present(pgd_t pgd) 346static inline int pgd_present(pgd_t pgd)
346{ 347{
347 return (pgd_val(pgd) & ~PAGE_MASK) == _PGD_ENTRY; 348 return (pgd_val(pgd) & ~PAGE_MASK) == _PGD_ENTRY;
348} 349}
349 350
350extern inline int pgd_none(pgd_t pgd) 351static inline int pgd_none(pgd_t pgd)
351{ 352{
352 return pgd_val(pgd) & _PGD_ENTRY_INV; 353 return pgd_val(pgd) & _PGD_ENTRY_INV;
353} 354}
354 355
355extern inline int pgd_bad(pgd_t pgd) 356static inline int pgd_bad(pgd_t pgd)
356{ 357{
357 return (pgd_val(pgd) & (~PAGE_MASK & ~_PGD_ENTRY_INV)) != _PGD_ENTRY; 358 return (pgd_val(pgd) & (~PAGE_MASK & ~_PGD_ENTRY_INV)) != _PGD_ENTRY;
358} 359}
359 360
360extern inline int pmd_present(pmd_t pmd) 361static inline int pmd_present(pmd_t pmd)
361{ 362{
362 return (pmd_val(pmd) & ~PAGE_MASK) == _PMD_ENTRY; 363 return (pmd_val(pmd) & ~PAGE_MASK) == _PMD_ENTRY;
363} 364}
364 365
365extern inline int pmd_none(pmd_t pmd) 366static inline int pmd_none(pmd_t pmd)
366{ 367{
367 return pmd_val(pmd) & _PMD_ENTRY_INV; 368 return pmd_val(pmd) & _PMD_ENTRY_INV;
368} 369}
369 370
370extern inline int pmd_bad(pmd_t pmd) 371static inline int pmd_bad(pmd_t pmd)
371{ 372{
372 return (pmd_val(pmd) & (~PAGE_MASK & ~_PMD_ENTRY_INV)) != _PMD_ENTRY; 373 return (pmd_val(pmd) & (~PAGE_MASK & ~_PMD_ENTRY_INV)) != _PMD_ENTRY;
373} 374}
374 375
375#endif /* __s390x__ */ 376#endif /* __s390x__ */
376 377
377extern inline int pte_none(pte_t pte) 378static inline int pte_none(pte_t pte)
378{ 379{
379 return (pte_val(pte) & _PAGE_INVALID_MASK) == _PAGE_INVALID_EMPTY; 380 return (pte_val(pte) & _PAGE_INVALID_MASK) == _PAGE_INVALID_EMPTY;
380} 381}
381 382
382extern inline int pte_present(pte_t pte) 383static inline int pte_present(pte_t pte)
383{ 384{
384 return !(pte_val(pte) & _PAGE_INVALID) || 385 return !(pte_val(pte) & _PAGE_INVALID) ||
385 (pte_val(pte) & _PAGE_INVALID_MASK) == _PAGE_INVALID_NONE; 386 (pte_val(pte) & _PAGE_INVALID_MASK) == _PAGE_INVALID_NONE;
386} 387}
387 388
388extern inline int pte_file(pte_t pte) 389static inline int pte_file(pte_t pte)
389{ 390{
390 return (pte_val(pte) & _PAGE_INVALID_MASK) == _PAGE_INVALID_FILE; 391 return (pte_val(pte) & _PAGE_INVALID_MASK) == _PAGE_INVALID_FILE;
391} 392}
@@ -396,12 +397,12 @@ extern inline int pte_file(pte_t pte)
396 * query functions pte_write/pte_dirty/pte_young only work if 397 * query functions pte_write/pte_dirty/pte_young only work if
397 * pte_present() is true. Undefined behaviour if not.. 398 * pte_present() is true. Undefined behaviour if not..
398 */ 399 */
399extern inline int pte_write(pte_t pte) 400static inline int pte_write(pte_t pte)
400{ 401{
401 return (pte_val(pte) & _PAGE_RO) == 0; 402 return (pte_val(pte) & _PAGE_RO) == 0;
402} 403}
403 404
404extern inline int pte_dirty(pte_t pte) 405static inline int pte_dirty(pte_t pte)
405{ 406{
406 /* A pte is neither clean nor dirty on s/390. The dirty bit 407 /* A pte is neither clean nor dirty on s/390. The dirty bit
407 * is in the storage key. See page_test_and_clear_dirty for 408 * is in the storage key. See page_test_and_clear_dirty for
@@ -410,7 +411,7 @@ extern inline int pte_dirty(pte_t pte)
410 return 0; 411 return 0;
411} 412}
412 413
413extern inline int pte_young(pte_t pte) 414static inline int pte_young(pte_t pte)
414{ 415{
415 /* A pte is neither young nor old on s/390. The young bit 416 /* A pte is neither young nor old on s/390. The young bit
416 * is in the storage key. See page_test_and_clear_young for 417 * is in the storage key. See page_test_and_clear_young for
@@ -419,7 +420,7 @@ extern inline int pte_young(pte_t pte)
419 return 0; 420 return 0;
420} 421}
421 422
422extern inline int pte_read(pte_t pte) 423static inline int pte_read(pte_t pte)
423{ 424{
424 /* All pages are readable since we don't use the fetch 425 /* All pages are readable since we don't use the fetch
425 * protection bit in the storage key. 426 * protection bit in the storage key.
@@ -433,9 +434,9 @@ extern inline int pte_read(pte_t pte)
433 434
434#ifndef __s390x__ 435#ifndef __s390x__
435 436
436extern inline void pgd_clear(pgd_t * pgdp) { } 437static inline void pgd_clear(pgd_t * pgdp) { }
437 438
438extern inline void pmd_clear(pmd_t * pmdp) 439static inline void pmd_clear(pmd_t * pmdp)
439{ 440{
440 pmd_val(pmdp[0]) = _PAGE_TABLE_INV; 441 pmd_val(pmdp[0]) = _PAGE_TABLE_INV;
441 pmd_val(pmdp[1]) = _PAGE_TABLE_INV; 442 pmd_val(pmdp[1]) = _PAGE_TABLE_INV;
@@ -445,12 +446,12 @@ extern inline void pmd_clear(pmd_t * pmdp)
445 446
446#else /* __s390x__ */ 447#else /* __s390x__ */
447 448
448extern inline void pgd_clear(pgd_t * pgdp) 449static inline void pgd_clear(pgd_t * pgdp)
449{ 450{
450 pgd_val(*pgdp) = _PGD_ENTRY_INV | _PGD_ENTRY; 451 pgd_val(*pgdp) = _PGD_ENTRY_INV | _PGD_ENTRY;
451} 452}
452 453
453extern inline void pmd_clear(pmd_t * pmdp) 454static inline void pmd_clear(pmd_t * pmdp)
454{ 455{
455 pmd_val(*pmdp) = _PMD_ENTRY_INV | _PMD_ENTRY; 456 pmd_val(*pmdp) = _PMD_ENTRY_INV | _PMD_ENTRY;
456 pmd_val1(*pmdp) = _PMD_ENTRY_INV | _PMD_ENTRY; 457 pmd_val1(*pmdp) = _PMD_ENTRY_INV | _PMD_ENTRY;
@@ -458,7 +459,7 @@ extern inline void pmd_clear(pmd_t * pmdp)
458 459
459#endif /* __s390x__ */ 460#endif /* __s390x__ */
460 461
461extern inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) 462static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
462{ 463{
463 pte_val(*ptep) = _PAGE_INVALID_EMPTY; 464 pte_val(*ptep) = _PAGE_INVALID_EMPTY;
464} 465}
@@ -467,14 +468,14 @@ extern inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt
467 * The following pte modification functions only work if 468 * The following pte modification functions only work if
468 * pte_present() is true. Undefined behaviour if not.. 469 * pte_present() is true. Undefined behaviour if not..
469 */ 470 */
470extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) 471static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
471{ 472{
472 pte_val(pte) &= PAGE_MASK; 473 pte_val(pte) &= PAGE_MASK;
473 pte_val(pte) |= pgprot_val(newprot); 474 pte_val(pte) |= pgprot_val(newprot);
474 return pte; 475 return pte;
475} 476}
476 477
477extern inline pte_t pte_wrprotect(pte_t pte) 478static inline pte_t pte_wrprotect(pte_t pte)
478{ 479{
479 /* Do not clobber _PAGE_INVALID_NONE pages! */ 480 /* Do not clobber _PAGE_INVALID_NONE pages! */
480 if (!(pte_val(pte) & _PAGE_INVALID)) 481 if (!(pte_val(pte) & _PAGE_INVALID))
@@ -482,13 +483,13 @@ extern inline pte_t pte_wrprotect(pte_t pte)
482 return pte; 483 return pte;
483} 484}
484 485
485extern inline pte_t pte_mkwrite(pte_t pte) 486static inline pte_t pte_mkwrite(pte_t pte)
486{ 487{
487 pte_val(pte) &= ~_PAGE_RO; 488 pte_val(pte) &= ~_PAGE_RO;
488 return pte; 489 return pte;
489} 490}
490 491
491extern inline pte_t pte_mkclean(pte_t pte) 492static inline pte_t pte_mkclean(pte_t pte)
492{ 493{
493 /* The only user of pte_mkclean is the fork() code. 494 /* The only user of pte_mkclean is the fork() code.
494 We must *not* clear the *physical* page dirty bit 495 We must *not* clear the *physical* page dirty bit
@@ -497,7 +498,7 @@ extern inline pte_t pte_mkclean(pte_t pte)
497 return pte; 498 return pte;
498} 499}
499 500
500extern inline pte_t pte_mkdirty(pte_t pte) 501static inline pte_t pte_mkdirty(pte_t pte)
501{ 502{
502 /* We do not explicitly set the dirty bit because the 503 /* We do not explicitly set the dirty bit because the
503 * sske instruction is slow. It is faster to let the 504 * sske instruction is slow. It is faster to let the
@@ -506,7 +507,7 @@ extern inline pte_t pte_mkdirty(pte_t pte)
506 return pte; 507 return pte;
507} 508}
508 509
509extern inline pte_t pte_mkold(pte_t pte) 510static inline pte_t pte_mkold(pte_t pte)
510{ 511{
511 /* S/390 doesn't keep its dirty/referenced bit in the pte. 512 /* S/390 doesn't keep its dirty/referenced bit in the pte.
512 * There is no point in clearing the real referenced bit. 513 * There is no point in clearing the real referenced bit.
@@ -514,7 +515,7 @@ extern inline pte_t pte_mkold(pte_t pte)
514 return pte; 515 return pte;
515} 516}
516 517
517extern inline pte_t pte_mkyoung(pte_t pte) 518static inline pte_t pte_mkyoung(pte_t pte)
518{ 519{
519 /* S/390 doesn't keep its dirty/referenced bit in the pte. 520 /* S/390 doesn't keep its dirty/referenced bit in the pte.
520 * There is no point in setting the real referenced bit. 521 * There is no point in setting the real referenced bit.
@@ -694,7 +695,7 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
694#ifndef __s390x__ 695#ifndef __s390x__
695 696
696/* Find an entry in the second-level page table.. */ 697/* Find an entry in the second-level page table.. */
697extern inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address) 698static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
698{ 699{
699 return (pmd_t *) dir; 700 return (pmd_t *) dir;
700} 701}
@@ -757,7 +758,7 @@ extern inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
757#else 758#else
758#define __SWP_OFFSET_MASK (~0UL >> 11) 759#define __SWP_OFFSET_MASK (~0UL >> 11)
759#endif 760#endif
760extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) 761static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
761{ 762{
762 pte_t pte; 763 pte_t pte;
763 offset &= __SWP_OFFSET_MASK; 764 offset &= __SWP_OFFSET_MASK;