tlb-sh3.c 876 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * arch/sh/mm/tlb-sh3.c
  3. *
  4. * SH-3 specific TLB operations
  5. *
  6. * Copyright (C) 1999 Niibe Yutaka
  7. * Copyright (C) 2002 Paul Mundt
  8. *
  9. * Released under the terms of the GNU GPL v2.0.
  10. */
  11. #include <linux/io.h>
  12. #include <asm/system.h>
  13. #include <asm/mmu_context.h>
  14. void local_flush_tlb_one(unsigned long asid, unsigned long page)
  15. {
  16. unsigned long addr, data;
  17. int i, ways = MMU_NTLB_WAYS;
  18. /*
  19. * NOTE: PTEH.ASID should be set to this MM
  20. * _AND_ we need to write ASID to the array.
  21. *
  22. * It would be simple if we didn't need to set PTEH.ASID...
  23. */
  24. addr = MMU_TLB_ADDRESS_ARRAY | (page & 0x1F000);
  25. data = (page & 0xfffe0000) | asid; /* VALID bit is off */
  26. if ((current_cpu_data.flags & CPU_HAS_MMU_PAGE_ASSOC)) {
  27. addr |= MMU_PAGE_ASSOC_BIT;
  28. ways = 1; /* we already know the way .. */
  29. }
  30. for (i = 0; i < ways; i++)
  31. ctrl_outl(data, addr + (i << 8));
  32. }