1
2
3
4
5
6
7
8
9
10
11#ifndef __ASM_SH64_TLB_H
12#define __ASM_SH64_TLB_H
13
14
15
16
17
18
19
20#define ITLB_FIXED 0x00000000
21#define ITLB_LAST_VAR_UNRESTRICTED 0x000003F0
22
23
24#define DTLB_FIXED 0x00800000
25#define DTLB_LAST_VAR_UNRESTRICTED 0x008003F0
26
27#ifndef __ASSEMBLY__
28
29#include <asm-generic/tlb.h>
30
31
32
33
34
35
36struct tlb_info {
37 unsigned long long next;
38 unsigned long long first;
39 unsigned long long last;
40
41 unsigned int entries;
42 unsigned int step;
43
44 unsigned long flags;
45};
46
47
48
49
50
51
52
53
54#define for_each_dtlb_entry(tlb) \
55 for (tlb = cpu_data->dtlb.first; \
56 tlb <= cpu_data->dtlb.last; \
57 tlb += cpu_data->dtlb.step)
58
59
60
61
62
63
64
65
66#define for_each_itlb_entry(tlb) \
67 for (tlb = cpu_data->itlb.first; \
68 tlb <= cpu_data->itlb.last; \
69 tlb += cpu_data->itlb.step)
70
71
72
73
74
75
76
77
78static inline void __flush_tlb_slot(unsigned long long slot)
79{
80 __asm__ __volatile__ ("putcfg %0, 0, r63\n" : : "r" (slot));
81}
82
83
84extern int sh64_tlb_init(void);
85extern unsigned long long sh64_next_free_dtlb_entry(void);
86extern unsigned long long sh64_get_wired_dtlb_entry(void);
87extern int sh64_put_wired_dtlb_entry(unsigned long long entry);
88
89extern void sh64_setup_tlb_slot(unsigned long long config_addr, unsigned long eaddr, unsigned long asid, unsigned long paddr);
90extern void sh64_teardown_tlb_slot(unsigned long long config_addr);
91
92#endif
93
94#endif
95
96