aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300/mm/tlb-mn10300.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mn10300/mm/tlb-mn10300.S')
-rw-r--r--arch/mn10300/mm/tlb-mn10300.S59
1 files changed, 45 insertions, 14 deletions
diff --git a/arch/mn10300/mm/tlb-mn10300.S b/arch/mn10300/mm/tlb-mn10300.S
index 7095147dcb8b..b9940177d81b 100644
--- a/arch/mn10300/mm/tlb-mn10300.S
+++ b/arch/mn10300/mm/tlb-mn10300.S
@@ -27,7 +27,6 @@
27############################################################################### 27###############################################################################
28 .type itlb_miss,@function 28 .type itlb_miss,@function
29ENTRY(itlb_miss) 29ENTRY(itlb_miss)
30 and ~EPSW_NMID,epsw
31#ifdef CONFIG_GDBSTUB 30#ifdef CONFIG_GDBSTUB
32 movm [d2,d3,a2],(sp) 31 movm [d2,d3,a2],(sp)
33#else 32#else
@@ -38,6 +37,12 @@ ENTRY(itlb_miss)
38 nop 37 nop
39#endif 38#endif
40 39
40#if defined(CONFIG_ERRATUM_NEED_TO_RELOAD_MMUCTR)
41 mov (MMUCTR),d2
42 mov d2,(MMUCTR)
43#endif
44
45 and ~EPSW_NMID,epsw
41 mov (IPTEU),d3 46 mov (IPTEU),d3
42 mov (PTBR),a2 47 mov (PTBR),a2
43 mov d3,d2 48 mov d3,d2
@@ -56,10 +61,16 @@ ENTRY(itlb_miss)
56 btst _PAGE_VALID,d2 61 btst _PAGE_VALID,d2
57 beq itlb_miss_fault # jump if doesn't point to a page 62 beq itlb_miss_fault # jump if doesn't point to a page
58 # (might be a swap id) 63 # (might be a swap id)
64#if ((_PAGE_ACCESSED & 0xffffff00) == 0)
59 bset _PAGE_ACCESSED,(0,a2) 65 bset _PAGE_ACCESSED,(0,a2)
60 and ~(xPTEL_UNUSED1|xPTEL_UNUSED2),d2 66#elif ((_PAGE_ACCESSED & 0xffff00ff) == 0)
67 bset +(_PAGE_ACCESSED >> 8),(1,a2)
68#else
69#error "_PAGE_ACCESSED value is out of range"
70#endif
71 and ~xPTEL2_UNUSED1,d2
61itlb_miss_set: 72itlb_miss_set:
62 mov d2,(IPTEL) # change the TLB 73 mov d2,(IPTEL2) # change the TLB
63#ifdef CONFIG_GDBSTUB 74#ifdef CONFIG_GDBSTUB
64 movm (sp),[d2,d3,a2] 75 movm (sp),[d2,d3,a2]
65#endif 76#endif
@@ -79,7 +90,6 @@ itlb_miss_fault:
79############################################################################### 90###############################################################################
80 .type dtlb_miss,@function 91 .type dtlb_miss,@function
81ENTRY(dtlb_miss) 92ENTRY(dtlb_miss)
82 and ~EPSW_NMID,epsw
83#ifdef CONFIG_GDBSTUB 93#ifdef CONFIG_GDBSTUB
84 movm [d2,d3,a2],(sp) 94 movm [d2,d3,a2],(sp)
85#else 95#else
@@ -90,6 +100,12 @@ ENTRY(dtlb_miss)
90 nop 100 nop
91#endif 101#endif
92 102
103#if defined(CONFIG_ERRATUM_NEED_TO_RELOAD_MMUCTR)
104 mov (MMUCTR),d2
105 mov d2,(MMUCTR)
106#endif
107
108 and ~EPSW_NMID,epsw
93 mov (DPTEU),d3 109 mov (DPTEU),d3
94 mov (PTBR),a2 110 mov (PTBR),a2
95 mov d3,d2 111 mov d3,d2
@@ -108,10 +124,16 @@ ENTRY(dtlb_miss)
108 btst _PAGE_VALID,d2 124 btst _PAGE_VALID,d2
109 beq dtlb_miss_fault # jump if doesn't point to a page 125 beq dtlb_miss_fault # jump if doesn't point to a page
110 # (might be a swap id) 126 # (might be a swap id)
127#if ((_PAGE_ACCESSED & 0xffffff00) == 0)
111 bset _PAGE_ACCESSED,(0,a2) 128 bset _PAGE_ACCESSED,(0,a2)
112 and ~(xPTEL_UNUSED1|xPTEL_UNUSED2),d2 129#elif ((_PAGE_ACCESSED & 0xffff00ff) == 0)
130 bset +(_PAGE_ACCESSED >> 8),(1,a2)
131#else
132#error "_PAGE_ACCESSED value is out of range"
133#endif
134 and ~xPTEL2_UNUSED1,d2
113dtlb_miss_set: 135dtlb_miss_set:
114 mov d2,(DPTEL) # change the TLB 136 mov d2,(DPTEL2) # change the TLB
115#ifdef CONFIG_GDBSTUB 137#ifdef CONFIG_GDBSTUB
116 movm (sp),[d2,d3,a2] 138 movm (sp),[d2,d3,a2]
117#endif 139#endif
@@ -130,9 +152,15 @@ dtlb_miss_fault:
130############################################################################### 152###############################################################################
131 .type itlb_aerror,@function 153 .type itlb_aerror,@function
132ENTRY(itlb_aerror) 154ENTRY(itlb_aerror)
133 and ~EPSW_NMID,epsw
134 add -4,sp 155 add -4,sp
135 SAVE_ALL 156 SAVE_ALL
157
158#if defined(CONFIG_ERRATUM_NEED_TO_RELOAD_MMUCTR)
159 mov (MMUCTR),d1
160 mov d1,(MMUCTR)
161#endif
162
163 and ~EPSW_NMID,epsw
136 add -4,sp # need to pass three params 164 add -4,sp # need to pass three params
137 165
138 # calculate the fault code 166 # calculate the fault code
@@ -140,15 +168,13 @@ ENTRY(itlb_aerror)
140 or 0x00010000,d1 # it's an instruction fetch 168 or 0x00010000,d1 # it's an instruction fetch
141 169
142 # determine the page address 170 # determine the page address
143 mov (IPTEU),a2 171 mov (IPTEU),d0
144 mov a2,d0
145 and PAGE_MASK,d0 172 and PAGE_MASK,d0
146 mov d0,(12,sp) 173 mov d0,(12,sp)
147 174
148 clr d0 175 clr d0
149 mov d0,(IPTEL) 176 mov d0,(IPTEL2)
150 177
151 and ~EPSW_NMID,epsw
152 or EPSW_IE,epsw 178 or EPSW_IE,epsw
153 mov fp,d0 179 mov fp,d0
154 call do_page_fault[],0 # do_page_fault(regs,code,addr 180 call do_page_fault[],0 # do_page_fault(regs,code,addr
@@ -163,10 +189,16 @@ ENTRY(itlb_aerror)
163############################################################################### 189###############################################################################
164 .type dtlb_aerror,@function 190 .type dtlb_aerror,@function
165ENTRY(dtlb_aerror) 191ENTRY(dtlb_aerror)
166 and ~EPSW_NMID,epsw
167 add -4,sp 192 add -4,sp
168 SAVE_ALL 193 SAVE_ALL
194
195#if defined(CONFIG_ERRATUM_NEED_TO_RELOAD_MMUCTR)
196 mov (MMUCTR),d1
197 mov d1,(MMUCTR)
198#endif
199
169 add -4,sp # need to pass three params 200 add -4,sp # need to pass three params
201 and ~EPSW_NMID,epsw
170 202
171 # calculate the fault code 203 # calculate the fault code
172 movhu (MMUFCR_DFC),d1 204 movhu (MMUFCR_DFC),d1
@@ -178,9 +210,8 @@ ENTRY(dtlb_aerror)
178 mov d0,(12,sp) 210 mov d0,(12,sp)
179 211
180 clr d0 212 clr d0
181 mov d0,(DPTEL) 213 mov d0,(DPTEL2)
182 214
183 and ~EPSW_NMID,epsw
184 or EPSW_IE,epsw 215 or EPSW_IE,epsw
185 mov fp,d0 216 mov fp,d0
186 call do_page_fault[],0 # do_page_fault(regs,code,addr 217 call do_page_fault[],0 # do_page_fault(regs,code,addr