MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tlb_invalidate_all_user

Function tlb_invalidate_all_user

freebsd/mips/mips/tlb.c:157–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void
158tlb_invalidate_all_user(struct pmap *pmap)
159{
160 register_t asid;
161 register_t s;
162 unsigned i;
163
164 s = intr_disable();
165 asid = mips_rd_entryhi() & TLBHI_ASID_MASK;
166
167 for (i = mips_rd_wired(); i < num_tlbentries; i++) {
168 register_t uasid;
169
170 mips_wr_index(i);
171 tlb_read();
172
173 uasid = mips_rd_entryhi() & TLBHI_ASID_MASK;
174 if (pmap == NULL) {
175 /*
176 * Invalidate all non-kernel entries.
177 */
178 if (uasid == 0)
179 continue;
180 } else {
181 /*
182 * Invalidate this pmap's entries.
183 */
184 if (uasid != pmap_asid(pmap))
185 continue;
186 }
187 tlb_invalidate_one(i);
188 }
189
190 mips_wr_entryhi(asid);
191 intr_restore(s);
192}
193
194/*
195 * Invalidates any TLB entries that map a virtual page from the specified

Callers 1

pmap_asid_allocFunction · 0.85

Calls 4

tlb_readFunction · 0.85
tlb_invalidate_oneFunction · 0.85
intr_disableFunction · 0.50
intr_restoreFunction · 0.50

Tested by

no test coverage detected