summaryrefslogtreecommitdiffstats
path: root/sys/sparc64/include/tlb.h
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2002-03-07 05:25:15 +0000
committerjake <jake@FreeBSD.org>2002-03-07 05:25:15 +0000
commit951cf2831e0fa912b15f97be0521ad99c33dbf2b (patch)
tree126b92c72de7f617152b427734b406b528bd6d55 /sys/sparc64/include/tlb.h
parent04926795beeb25b72ce20663b539e0ef79aa909b (diff)
downloadFreeBSD-src-951cf2831e0fa912b15f97be0521ad99c33dbf2b.zip
FreeBSD-src-951cf2831e0fa912b15f97be0521ad99c33dbf2b.tar.gz
Modify the tlb demap API to take a pmap instead of a tlb context number.
Due to allocating tlb contexts on the fly, we only ever need to demap the primary context, non-primary contexts have already been implicitly flushed by context switching. All we really need to tell is if its a kernel demap or not, and its easier just to compare against the kernel_pmap which is a constant.
Diffstat (limited to 'sys/sparc64/include/tlb.h')
-rw-r--r--sys/sparc64/include/tlb.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/sys/sparc64/include/tlb.h b/sys/sparc64/include/tlb.h
index db10429..281b62b 100644
--- a/sys/sparc64/include/tlb.h
+++ b/sys/sparc64/include/tlb.h
@@ -104,8 +104,11 @@ tlb_dtlb_context_primary_demap(void)
}
static __inline void
-tlb_dtlb_page_demap(u_long ctx, vm_offset_t va)
+tlb_dtlb_page_demap(struct pmap *pm, vm_offset_t va)
{
+ u_int ctx;
+
+ ctx = pm->pm_context[PCPU_GET(cpuid)];
if (ctx == TLB_CTX_KERNEL) {
stxa(TLB_DEMAP_VA(va) | TLB_DEMAP_NUCLEUS | TLB_DEMAP_PAGE,
ASI_DMMU_DEMAP, 0);
@@ -150,8 +153,11 @@ tlb_itlb_context_primary_demap(void)
}
static __inline void
-tlb_itlb_page_demap(u_long ctx, vm_offset_t va)
+tlb_itlb_page_demap(struct pmap *pm, vm_offset_t va)
{
+ u_int ctx;
+
+ ctx = pm->pm_context[PCPU_GET(cpuid)];
if (ctx == TLB_CTX_KERNEL) {
stxa(TLB_DEMAP_VA(va) | TLB_DEMAP_NUCLEUS | TLB_DEMAP_PAGE,
ASI_IMMU_DEMAP, 0);
@@ -184,8 +190,11 @@ tlb_itlb_store(vm_offset_t va, u_long ctx, struct tte tte)
}
static __inline void
-tlb_context_demap(u_int ctx)
+tlb_context_demap(struct pmap *pm)
{
+ u_int ctx;
+
+ ctx = pm->pm_context[PCPU_GET(cpuid)];
if (ctx != -1) {
tlb_dtlb_context_primary_demap();
tlb_itlb_context_primary_demap();
@@ -205,25 +214,25 @@ tlb_itlb_store_slot(vm_offset_t va, u_long ctx, struct tte tte, int slot)
}
static __inline void
-tlb_page_demap(u_int tlb, u_int ctx, vm_offset_t va)
+tlb_page_demap(u_int tlb, struct pmap *pm, vm_offset_t va)
{
if (tlb & TLB_DTLB)
- tlb_dtlb_page_demap(ctx, va);
+ tlb_dtlb_page_demap(pm, va);
if (tlb & TLB_ITLB)
- tlb_itlb_page_demap(ctx, va);
+ tlb_itlb_page_demap(pm, va);
}
static __inline void
-tlb_range_demap(u_int ctx, vm_offset_t start, vm_offset_t end)
+tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end)
{
for (; start < end; start += PAGE_SIZE)
- tlb_page_demap(TLB_DTLB | TLB_ITLB, ctx, start);
+ tlb_page_demap(TLB_DTLB | TLB_ITLB, pm, start);
}
static __inline void
-tlb_tte_demap(struct tte tte, u_int ctx)
+tlb_tte_demap(struct tte tte, struct pmap *pm)
{
- tlb_page_demap(TD_GET_TLB(tte.tte_data), ctx, TV_GET_VA(tte.tte_vpn));
+ tlb_page_demap(TD_GET_TLB(tte.tte_data), pm, TV_GET_VA(tte.tte_vpn));
}
static __inline void
OpenPOWER on IntegriCloud