tlb.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * TLB shootdown specifics for PPC
  3. *
  4. * Copyright (C) 2002 Paul Mackerras, IBM Corp.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #ifndef _PPC_TLB_H
  12. #define _PPC_TLB_H
  13. #include <linux/config.h>
  14. #include <asm/pgtable.h>
  15. #include <asm/pgalloc.h>
  16. #include <asm/tlbflush.h>
  17. #include <asm/page.h>
  18. #include <asm/mmu.h>
  19. #ifdef CONFIG_PPC_STD_MMU
  20. /* Classic PPC with hash-table based MMU... */
  21. struct mmu_gather;
  22. extern void tlb_flush(struct mmu_gather *tlb);
  23. /* Get the generic bits... */
  24. #include <asm-generic/tlb.h>
  25. /* Nothing needed here in fact... */
  26. #define tlb_start_vma(tlb, vma) do { } while (0)
  27. #define tlb_end_vma(tlb, vma) do { } while (0)
  28. extern void flush_hash_entry(struct mm_struct *mm, pte_t *ptep,
  29. unsigned long address);
  30. static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep,
  31. unsigned long address)
  32. {
  33. if (pte_val(*ptep) & _PAGE_HASHPTE)
  34. flush_hash_entry(tlb->mm, ptep, address);
  35. }
  36. #else
  37. /* Embedded PPC with software-loaded TLB, very simple... */
  38. #define tlb_start_vma(tlb, vma) do { } while (0)
  39. #define tlb_end_vma(tlb, vma) do { } while (0)
  40. #define __tlb_remove_tlb_entry(tlb, pte, address) do { } while (0)
  41. #define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
  42. /* Get the generic bits... */
  43. #include <asm-generic/tlb.h>
  44. #endif /* CONFIG_PPC_STD_MMU */
  45. #endif /* __PPC_TLB_H */