tlb_64.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * include/asm-sh/tlb_64.h
  3. *
  4. * Copyright (C) 2003 Paul Mundt
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #ifndef __ASM_SH_TLB_64_H
  11. #define __ASM_SH_TLB_64_H
  12. /* ITLB defines */
  13. #define ITLB_FIXED 0x00000000 /* First fixed ITLB, see head.S */
  14. #define ITLB_LAST_VAR_UNRESTRICTED 0x000003F0 /* Last ITLB */
  15. /* DTLB defines */
  16. #define DTLB_FIXED 0x00800000 /* First fixed DTLB, see head.S */
  17. #define DTLB_LAST_VAR_UNRESTRICTED 0x008003F0 /* Last DTLB */
  18. #ifndef __ASSEMBLY__
  19. /**
  20. * for_each_dtlb_entry - Iterate over free (non-wired) DTLB entries
  21. *
  22. * @tlb: TLB entry
  23. */
  24. #define for_each_dtlb_entry(tlb) \
  25. for (tlb = cpu_data->dtlb.first; \
  26. tlb <= cpu_data->dtlb.last; \
  27. tlb += cpu_data->dtlb.step)
  28. /**
  29. * for_each_itlb_entry - Iterate over free (non-wired) ITLB entries
  30. *
  31. * @tlb: TLB entry
  32. */
  33. #define for_each_itlb_entry(tlb) \
  34. for (tlb = cpu_data->itlb.first; \
  35. tlb <= cpu_data->itlb.last; \
  36. tlb += cpu_data->itlb.step)
  37. /**
  38. * __flush_tlb_slot - Flushes TLB slot @slot.
  39. *
  40. * @slot: Address of TLB slot.
  41. */
  42. static inline void __flush_tlb_slot(unsigned long long slot)
  43. {
  44. __asm__ __volatile__ ("putcfg %0, 0, r63\n" : : "r" (slot));
  45. }
  46. #ifdef CONFIG_MMU
  47. /* arch/sh64/mm/tlb.c */
  48. int sh64_tlb_init(void);
  49. unsigned long long sh64_next_free_dtlb_entry(void);
  50. unsigned long long sh64_get_wired_dtlb_entry(void);
  51. int sh64_put_wired_dtlb_entry(unsigned long long entry);
  52. void sh64_setup_tlb_slot(unsigned long long config_addr, unsigned long eaddr,
  53. unsigned long asid, unsigned long paddr);
  54. void sh64_teardown_tlb_slot(unsigned long long config_addr);
  55. #else
  56. #define sh64_tlb_init() do { } while (0)
  57. #define sh64_next_free_dtlb_entry() (0)
  58. #define sh64_get_wired_dtlb_entry() (0)
  59. #define sh64_put_wired_dtlb_entry(entry) do { } while (0)
  60. #define sh64_setup_tlb_slot(conf, virt, asid, phys) do { } while (0)
  61. #define sh64_teardown_tlb_slot(addr) do { } while (0)
  62. #endif /* CONFIG_MMU */
  63. #endif /* __ASSEMBLY__ */
  64. #endif /* __ASM_SH_TLB_64_H */