summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-12-31 20:54:22 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-12-31 20:54:22 +0000
commit4453bcfa8ac89c2860b8636ad8fb7bb2243d915c (patch)
tree82695154f264d8fcc1217a96d1d45a0e0fa3a069
parentb7aebe1a8d8e2ea02e98c8977ac3030f96da82bc (diff)
Standardize cache handling functions and defines to use wb/wbinv/inv instead
of flush/sync/inval. No functional change.
-rw-r--r--sys/arch/m88k/include/cmmu.h14
-rw-r--r--sys/arch/m88k/m88k/m8820x_machdep.c20
-rw-r--r--sys/arch/m88k/m88k/pmap.c24
-rw-r--r--sys/arch/m88k/m88k/trap.c6
-rw-r--r--sys/arch/mvme88k/include/m88110.h186
-rw-r--r--sys/arch/mvme88k/include/m88410.h14
-rw-r--r--sys/arch/mvme88k/mvme88k/m197_machdep.c10
-rw-r--r--sys/arch/mvme88k/mvme88k/m88110.c70
-rw-r--r--sys/arch/mvme88k/mvme88k/m88410.c24
9 files changed, 184 insertions, 184 deletions
diff --git a/sys/arch/m88k/include/cmmu.h b/sys/arch/m88k/include/cmmu.h
index 62858f66fd7..9d8f5bd7a9c 100644
--- a/sys/arch/m88k/include/cmmu.h
+++ b/sys/arch/m88k/include/cmmu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmmu.h,v 1.23 2010/06/22 17:42:35 miod Exp $ */
+/* $OpenBSD: cmmu.h,v 1.24 2010/12/31 20:54:21 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1992 Carnegie Mellon University
@@ -42,9 +42,9 @@ struct cmmu_p {
cpuid_t (*cpu_number)(void);
void (*set_sapr)(apr_t);
void (*set_uapr)(apr_t);
- void (*flush_tlb)(cpuid_t, u_int, vaddr_t, u_int);
- void (*flush_cache)(cpuid_t, paddr_t, psize_t);
- void (*flush_inst_cache)(cpuid_t, paddr_t, psize_t);
+ void (*tlb_inv)(cpuid_t, u_int, vaddr_t, u_int);
+ void (*cache_wbinv)(cpuid_t, paddr_t, psize_t);
+ void (*icache_inv)(cpuid_t, paddr_t, psize_t);
void (*dma_cachectl)(paddr_t, psize_t, int);
#ifdef MULTIPROCESSOR
void (*dma_cachectl_local)(paddr_t, psize_t, int);
@@ -76,9 +76,9 @@ extern __cpu_simple_lock_t cmmu_cpu_lock;
#define cmmu_cpu_number (cmmu->cpu_number)
#define cmmu_set_sapr(apr) (cmmu->set_sapr)(apr)
#define cmmu_set_uapr(apr) (cmmu->set_uapr)(apr)
-#define cmmu_flush_tlb(cpu, k, va, c) (cmmu->flush_tlb)(cpu, k, va, c)
-#define cmmu_flush_cache(cpu, pa, s) (cmmu->flush_cache)(cpu, pa, s)
-#define cmmu_flush_inst_cache(cpu,pa,s) (cmmu->flush_inst_cache)(cpu, pa, s)
+#define cmmu_tlb_inv(cpu, k, va, c) (cmmu->tlb_inv)(cpu, k, va, c)
+#define cmmu_cache_wbinv(cpu, pa, s) (cmmu->cache_wbinv)(cpu, pa, s)
+#define cmmu_icache_inv(cpu,pa,s) (cmmu->icache_inv)(cpu, pa, s)
#define dma_cachectl(pa, s, op) (cmmu->dma_cachectl)(pa, s, op)
#define dma_cachectl_local(pa, s, op) (cmmu->dma_cachectl_local)(pa, s, op)
#define cmmu_initialize_cpu(cpu) (cmmu->initialize_cpu)(cpu)
diff --git a/sys/arch/m88k/m88k/m8820x_machdep.c b/sys/arch/m88k/m88k/m8820x_machdep.c
index aa1130f89dc..f03c0230b77 100644
--- a/sys/arch/m88k/m88k/m8820x_machdep.c
+++ b/sys/arch/m88k/m88k/m8820x_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m8820x_machdep.c,v 1.41 2010/12/27 19:18:37 miod Exp $ */
+/* $OpenBSD: m8820x_machdep.c,v 1.42 2010/12/31 20:54:21 miod Exp $ */
/*
* Copyright (c) 2004, 2007, Miodrag Vallat.
*
@@ -98,9 +98,9 @@ void m8820x_cpu_configuration_print(int);
void m8820x_shutdown(void);
void m8820x_set_sapr(apr_t);
void m8820x_set_uapr(apr_t);
-void m8820x_flush_tlb(cpuid_t, u_int, vaddr_t, u_int);
-void m8820x_flush_cache(cpuid_t, paddr_t, psize_t);
-void m8820x_flush_inst_cache(cpuid_t, paddr_t, psize_t);
+void m8820x_tlb_inv(cpuid_t, u_int, vaddr_t, u_int);
+void m8820x_cache_wbinv(cpuid_t, paddr_t, psize_t);
+void m8820x_icache_inv(cpuid_t, paddr_t, psize_t);
void m8820x_dma_cachectl(paddr_t, psize_t, int);
void m8820x_dma_cachectl_local(paddr_t, psize_t, int);
void m8820x_initialize_cpu(cpuid_t);
@@ -114,9 +114,9 @@ struct cmmu_p cmmu8820x = {
m8820x_cpu_number,
m8820x_set_sapr,
m8820x_set_uapr,
- m8820x_flush_tlb,
- m8820x_flush_cache,
- m8820x_flush_inst_cache,
+ m8820x_tlb_inv,
+ m8820x_cache_wbinv,
+ m8820x_icache_inv,
m8820x_dma_cachectl,
#ifdef MULTIPROCESSOR
m8820x_dma_cachectl_local,
@@ -546,7 +546,7 @@ m8820x_set_uapr(apr_t ap)
* flush any tlb
*/
void
-m8820x_flush_tlb(cpuid_t cpu, u_int kernel, vaddr_t vaddr, u_int count)
+m8820x_tlb_inv(cpuid_t cpu, u_int kernel, vaddr_t vaddr, u_int count)
{
u_int32_t psr;
@@ -606,7 +606,7 @@ m8820x_flush_tlb(cpuid_t cpu, u_int kernel, vaddr_t vaddr, u_int count)
* flush both Instruction and Data caches
*/
void
-m8820x_flush_cache(cpuid_t cpu, paddr_t pa, psize_t size)
+m8820x_cache_wbinv(cpuid_t cpu, paddr_t pa, psize_t size)
{
u_int32_t psr;
psize_t count;
@@ -641,7 +641,7 @@ m8820x_flush_cache(cpuid_t cpu, paddr_t pa, psize_t size)
* flush Instruction caches
*/
void
-m8820x_flush_inst_cache(cpuid_t cpu, paddr_t pa, psize_t size)
+m8820x_icache_inv(cpuid_t cpu, paddr_t pa, psize_t size)
{
u_int32_t psr;
psize_t count;
diff --git a/sys/arch/m88k/m88k/pmap.c b/sys/arch/m88k/m88k/pmap.c
index 710f90e75d4..9bcada644fd 100644
--- a/sys/arch/m88k/m88k/pmap.c
+++ b/sys/arch/m88k/m88k/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.55 2010/12/26 22:18:20 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.56 2010/12/31 20:54:21 miod Exp $ */
/*
* Copyright (c) 2001-2004, Miodrag Vallat
* Copyright (c) 1998-2001 Steve Murphree, Jr.
@@ -206,7 +206,7 @@ flush_atc_entry(pmap_t pmap, vaddr_t va)
if (CPU_IS88100) {
CPU_INFO_FOREACH(cpu, ci) {
if (kernel || pmap == ci->ci_curpmap)
- cmmu_flush_tlb(ci->ci_cpuid, kernel, va, 1);
+ cmmu_tlb_inv(ci->ci_cpuid, kernel, va, 1);
}
}
@@ -227,7 +227,7 @@ flush_atc_entry(pmap_t pmap, vaddr_t va)
if (kernel || pmap == ci->ci_curpmap) {
if (CPU_IS88100)
- cmmu_flush_tlb(ci->ci_cpuid, kernel, va, 1);
+ cmmu_tlb_inv(ci->ci_cpuid, kernel, va, 1);
if (CPU_IS88110)
ci->ci_pmap_ipi |= kernel ?
CI_IPI_TLB_FLUSH_KERNEL : CI_IPI_TLB_FLUSH_USER;
@@ -255,9 +255,9 @@ pmap_update(pmap_t pm)
/* CPU_INFO_FOREACH(cpu, ci) */ {
ipi = atomic_clear_int(&ci->ci_pmap_ipi);
if (ipi & CI_IPI_TLB_FLUSH_KERNEL)
- cmmu_flush_tlb(ci->ci_cpuid, TRUE, 0 ,0);
+ cmmu_tlb_inv(ci->ci_cpuid, TRUE, 0 ,0);
if (ipi & CI_IPI_TLB_FLUSH_USER)
- cmmu_flush_tlb(ci->ci_cpuid, FALSE, 0 ,0);
+ cmmu_tlb_inv(ci->ci_cpuid, FALSE, 0 ,0);
}
}
}
@@ -527,7 +527,7 @@ pmap_cache_ctrl(pmap_t pmap, vaddr_t s, vaddr_t e, u_int mode)
#else
cpu = cpu_number();
#endif
- cmmu_flush_cache(cpu, pa, PAGE_SIZE);
+ cmmu_cache_wbinv(cpu, pa, PAGE_SIZE);
}
}
PMAP_UNLOCK(pmap);
@@ -773,7 +773,7 @@ pmap_bootstrap_cpu(cpuid_t cpu)
cmmu_initialize_cpu(cpu);
else
#endif
- cmmu_flush_tlb(cpu, TRUE, 0, -1);
+ cmmu_tlb_inv(cpu, TRUE, 0, -1);
/* Load supervisor pointer to segment table. */
cmmu_set_sapr(kernel_pmap->pm_apr);
@@ -855,7 +855,7 @@ pmap_zero_page(struct vm_page *pg)
* We don't need the flush_atc_entry() dance, as these pages are
* bound to only one cpu.
*/
- cmmu_flush_tlb(cpu, TRUE, va, 1);
+ cmmu_tlb_inv(cpu, TRUE, va, 1);
zeropage(va);
splx(spl);
}
@@ -2026,7 +2026,7 @@ pmap_activate(struct proc *p)
} else {
if (pmap != ci->ci_curpmap) {
cmmu_set_uapr(pmap->pm_apr);
- cmmu_flush_tlb(ci->ci_cpuid, FALSE, 0, -1);
+ cmmu_tlb_inv(ci->ci_cpuid, FALSE, 0, -1);
ci->ci_curpmap = pmap;
}
}
@@ -2102,8 +2102,8 @@ pmap_copy_page(struct vm_page *srcpg, struct vm_page *dstpg)
* We don't need the flush_atc_entry() dance, as these pages are
* bound to only one cpu.
*/
- cmmu_flush_tlb(cpu, TRUE, dstva, 2);
- cmmu_flush_cache(cpu, src, PAGE_SIZE);
+ cmmu_tlb_inv(cpu, TRUE, dstva, 2);
+ cmmu_cache_wbinv(cpu, src, PAGE_SIZE);
copypage(srcva, dstva);
splx(spl);
@@ -2596,7 +2596,7 @@ pmap_proc_iflush(struct proc *p, vaddr_t va, vsize_t len)
ci = curcpu();
#endif
/* CPU_INFO_FOREACH(cpu, ci) */ {
- cmmu_flush_inst_cache(ci->ci_cpuid, pa, count);
+ cmmu_icache_inv(ci->ci_cpuid, pa, count);
}
}
va += count;
diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c
index d919df49cec..b62d0b92058 100644
--- a/sys/arch/m88k/m88k/trap.c
+++ b/sys/arch/m88k/m88k/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.72 2010/12/23 19:55:24 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.73 2010/12/31 20:54:21 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
* Copyright (c) 1998 Steve Murphree, Jr.
@@ -794,9 +794,9 @@ lose:
if (fault_addr >= (vaddr_t)&kernel_text &&
fault_addr < (vaddr_t)&etext) {
- cmmu_flush_inst_cache(curcpu()->ci_cpuid,
+ cmmu_icache_inv(curcpu()->ci_cpuid,
trunc_page(fault_addr), PAGE_SIZE);
- cmmu_flush_cache(curcpu()->ci_cpuid,
+ cmmu_cache_wbinv(curcpu()->ci_cpuid,
trunc_page(fault_addr), PAGE_SIZE);
return;
}
diff --git a/sys/arch/mvme88k/include/m88110.h b/sys/arch/mvme88k/include/m88110.h
index f3dfad7e3a9..306bd6cd4ac 100644
--- a/sys/arch/mvme88k/include/m88110.h
+++ b/sys/arch/mvme88k/include/m88110.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88110.h,v 1.22 2007/12/02 21:32:44 miod Exp $ */
+/* $OpenBSD: m88110.h,v 1.23 2010/12/31 20:54:21 miod Exp $ */
#ifndef __MACHINE_M88110_H__
#define __MACHINE_M88110_H__
@@ -7,88 +7,88 @@
* 88110 CMMU definitions
*/
-#define CMMU_ICMD_INV_ITIC 0x001 /* Invalidate Inst Cache & TIC */
-#define CMMU_ICMD_INV_TIC 0x002 /* Invalidate TIC */
-#define CMMU_ICMD_INV_LINE 0x005 /* Invalidate Inst Cache Line */
-#define CMMU_ICMD_PRB_SUPR 0x008 /* MMU Probe Supervisor */
-#define CMMU_ICMD_PRB_USER 0x009 /* MMU Probe User */
-#define CMMU_ICMD_INV_SATC 0x00a /* Invalidate All Supervisor ATCs */
-#define CMMU_ICMD_INV_UATC 0x00b /* Invalidate All User ATCs */
-
-#define CMMU_ICTL_DID 0x8000 /* Double instruction disable */
-#define CMMU_ICTL_PREN 0x4000 /* Branch Prediction Enable */
-#define CMMU_ICTL_FRZ0 0x0100 /* Inst Cache Freeze Bank 0 */
-#define CMMU_ICTL_FRZ1 0x0080 /* Inst Cache Freeze Bank 1 */
-#define CMMU_ICTL_HTEN 0x0040 /* Hardware Table Search Enable */
-#define CMMU_ICTL_MEN 0x0020 /* Inst MMU Enable */
-#define CMMU_ICTL_BEN 0x0004 /* TIC Cache Enable */
-#define CMMU_ICTL_CEN 0x0001 /* Inst Cache Enable */
-
-#define CMMU_ISR_TBE 0x200000 /* Table Search Bus Error */
-#define CMMU_ISR_SI 0x100000 /* Segment Fault*/
-#define CMMU_ISR_PI 0x080000 /* Page Fault */
-#define CMMU_ISR_SP 0x040000 /* Supervisor Protection Violation */
-#define CMMU_ISR_PH 0x000800 /* PATC Hit */
-#define CMMU_ISR_BH 0x000400 /* BATC Hit */
-#define CMMU_ISR_SU 0x000200 /* Supervisor Bit */
-#define CMMU_ISR_BE 0x000001 /* Bus Error */
-
-#define CMMU_DCMD_FLUSH_PG 0x000 /* Flush Data Cache Page (sync) */
-#define CMMU_DCMD_INV_ALL 0x001 /* Invalidate Data Cache All */
-#define CMMU_DCMD_FLUSH_ALL 0x002 /* Flush Data Cache All (sync) */
-#define CMMU_DCMD_FLUSH_ALL_INV 0x003 /* Flush Data Cache All (sync & inval) */
-#define CMMU_DCMD_FLUSH_PG_INV 0x004 /* Flush Data Cache Page (sync & inval) */
-#define CMMU_DCMD_INV_LINE 0x005 /* Invalidate Data Cache Line */
-#define CMMU_DCMD_FLUSH_LINE 0x006 /* Flush Data Cache Line (sync)*/
-#define CMMU_DCMD_FLUSH_LINE_INV 0x007 /* Flush Data Cache Line (sync & inval)*/
-#define CMMU_DCMD_PRB_SUPR 0x008 /* MMU Probe Supervisor */
-#define CMMU_DCMD_PRB_USER 0x009 /* MMU Probe User */
-#define CMMU_DCMD_INV_SATC 0x00A /* Invalidate All Supervisor ATCs */
-#define CMMU_DCMD_INV_UATC 0x00B /* Invalidate All User ATCs */
-
-#define CMMU_DCTL_RSVD7 0x40000 /* Reserved */
-#define CMMU_DCTL_RSVD6 0x20000 /* Reserved */
-#define CMMU_DCTL_RSVD5 0x10000 /* Reserved */
-#define CMMU_DCTL_RSVD4 0x8000 /* Reserved */
-#define CMMU_DCTL_RSVD3 0x4000 /* Reserved */
-#define CMMU_DCTL_XMEM 0x2000 /* store -> load sequence */
-#define CMMU_DCTL_DEN 0x1000 /* Decoupled Cache Access Enable */
-#define CMMU_DCTL_FWT 0x0800 /* Force Write Through */
-#define CMMU_DCTL_BPEN1 0x0400 /* Break Point Enable 1 */
-#define CMMU_DCTL_BPEN0 0x0200 /* Break Point Enable 0 */
-#define CMMU_DCTL_FRZ0 0x0100 /* Data Cache Freeze Bank 0 */
-#define CMMU_DCTL_FRZ1 0x0080 /* Data Cache Freeze Bank 1 */
-#define CMMU_DCTL_HTEN 0x0040 /* Hardware Table Search Enable */
-#define CMMU_DCTL_MEN 0x0020 /* Data MMU Enable */
-#define CMMU_DCTL_RSVD2 0x0010 /* Reserved */
-#define CMMU_DCTL_ADS 0x0008 /* Allocat Disable */
-#define CMMU_DCTL_RSVD1 0x0004 /* Reserved */
-#define CMMU_DCTL_SEN 0x0002 /* Data Cache Snoop Enable */
-#define CMMU_DCTL_CEN 0x0001 /* Data Cache Enable */
-
-#define CMMU_DSR_TBE 0x200000 /* Table Search Bus Error */
-#define CMMU_DSR_SI 0x100000 /* Segment Fault*/
-#define CMMU_DSR_PI 0x080000 /* Page Fault */
-#define CMMU_DSR_SP 0x040000 /* Supervisor Protection Violation */
-#define CMMU_DSR_WE 0x020000 /* Write Protection Violation */
-#define CMMU_DSR_BPE 0x010000 /* Break Point Exception */
-#define CMMU_DSR_PH 0x000800 /* PATC Hit */
-#define CMMU_DSR_BH 0x000400 /* BATC Hit */
-#define CMMU_DSR_SU 0x000200 /* Supervisor Bit */
-#define CMMU_DSR_RW 0x000100 /* Read Bit */
-#define CMMU_DSR_CP 0x000004 /* Copyback Error */
-#define CMMU_DSR_WA 0x000002 /* Write-Allocate Bus Error */
-#define CMMU_DSR_BE 0x000001 /* Bus Error */
+#define CMMU_ICMD_INV_ITIC 0x001 /* Invalidate Inst Cache & TIC */
+#define CMMU_ICMD_INV_TIC 0x002 /* Invalidate TIC */
+#define CMMU_ICMD_INV_LINE 0x005 /* Invalidate Inst Cache Line */
+#define CMMU_ICMD_PRB_SUPR 0x008 /* MMU Probe Supervisor */
+#define CMMU_ICMD_PRB_USER 0x009 /* MMU Probe User */
+#define CMMU_ICMD_INV_SATC 0x00a /* Invalidate All Supervisor ATCs */
+#define CMMU_ICMD_INV_UATC 0x00b /* Invalidate All User ATCs */
+
+#define CMMU_ICTL_DID 0x8000 /* Double instruction disable */
+#define CMMU_ICTL_PREN 0x4000 /* Branch Prediction Enable */
+#define CMMU_ICTL_FRZ0 0x0100 /* Inst Cache Freeze Bank 0 */
+#define CMMU_ICTL_FRZ1 0x0080 /* Inst Cache Freeze Bank 1 */
+#define CMMU_ICTL_HTEN 0x0040 /* Hardware Table Search Enable */
+#define CMMU_ICTL_MEN 0x0020 /* Inst MMU Enable */
+#define CMMU_ICTL_BEN 0x0004 /* TIC Cache Enable */
+#define CMMU_ICTL_CEN 0x0001 /* Inst Cache Enable */
+
+#define CMMU_ISR_TBE 0x200000 /* Table Search Bus Error */
+#define CMMU_ISR_SI 0x100000 /* Segment Fault*/
+#define CMMU_ISR_PI 0x080000 /* Page Fault */
+#define CMMU_ISR_SP 0x040000 /* Supervisor Protection Violation */
+#define CMMU_ISR_PH 0x000800 /* PATC Hit */
+#define CMMU_ISR_BH 0x000400 /* BATC Hit */
+#define CMMU_ISR_SU 0x000200 /* Supervisor Bit */
+#define CMMU_ISR_BE 0x000001 /* Bus Error */
+
+#define CMMU_DCMD_WB_PG 0x000 /* Flush Data Cache Page (sync) */
+#define CMMU_DCMD_INV_ALL 0x001 /* Invalidate Data Cache All */
+#define CMMU_DCMD_WB_ALL 0x002 /* Flush Data Cache All (sync) */
+#define CMMU_DCMD_WBINV_ALL 0x003 /* Flush Data Cache All (sync + inv) */
+#define CMMU_DCMD_WBINV_PG 0x004 /* Flush Data Cache Page (sync + inv) */
+#define CMMU_DCMD_INV_LINE 0x005 /* Invalidate Data Cache Line */
+#define CMMU_DCMD_WB_LINE 0x006 /* Flush Data Cache Line (sync) */
+#define CMMU_DCMD_WBINV_LINE 0x007 /* Flush Data Cache Line (sync + inv) */
+#define CMMU_DCMD_PRB_SUPR 0x008 /* MMU Probe Supervisor */
+#define CMMU_DCMD_PRB_USER 0x009 /* MMU Probe User */
+#define CMMU_DCMD_INV_SATC 0x00a /* Invalidate All Supervisor ATCs */
+#define CMMU_DCMD_INV_UATC 0x00b /* Invalidate All User ATCs */
+
+#define CMMU_DCTL_RSVD7 0x40000 /* Reserved */
+#define CMMU_DCTL_RSVD6 0x20000 /* Reserved */
+#define CMMU_DCTL_RSVD5 0x10000 /* Reserved */
+#define CMMU_DCTL_RSVD4 0x8000 /* Reserved */
+#define CMMU_DCTL_RSVD3 0x4000 /* Reserved */
+#define CMMU_DCTL_XMEM 0x2000 /* store -> load sequence */
+#define CMMU_DCTL_DEN 0x1000 /* Decoupled Cache Access Enable */
+#define CMMU_DCTL_FWT 0x0800 /* Force Write Through */
+#define CMMU_DCTL_BPEN1 0x0400 /* Break Point Enable 1 */
+#define CMMU_DCTL_BPEN0 0x0200 /* Break Point Enable 0 */
+#define CMMU_DCTL_FRZ0 0x0100 /* Data Cache Freeze Bank 0 */
+#define CMMU_DCTL_FRZ1 0x0080 /* Data Cache Freeze Bank 1 */
+#define CMMU_DCTL_HTEN 0x0040 /* Hardware Table Search Enable */
+#define CMMU_DCTL_MEN 0x0020 /* Data MMU Enable */
+#define CMMU_DCTL_RSVD2 0x0010 /* Reserved */
+#define CMMU_DCTL_ADS 0x0008 /* Allocate Disable */
+#define CMMU_DCTL_RSVD1 0x0004 /* Reserved */
+#define CMMU_DCTL_SEN 0x0002 /* Data Cache Snoop Enable */
+#define CMMU_DCTL_CEN 0x0001 /* Data Cache Enable */
+
+#define CMMU_DSR_TBE 0x200000 /* Table Search Bus Error */
+#define CMMU_DSR_SI 0x100000 /* Segment Fault */
+#define CMMU_DSR_PI 0x080000 /* Page Fault */
+#define CMMU_DSR_SP 0x040000 /* Supervisor Protection Violation */
+#define CMMU_DSR_WE 0x020000 /* Write Protection Violation */
+#define CMMU_DSR_BPE 0x010000 /* Break Point Exception */
+#define CMMU_DSR_PH 0x000800 /* PATC Hit */
+#define CMMU_DSR_BH 0x000400 /* BATC Hit */
+#define CMMU_DSR_SU 0x000200 /* Supervisor Bit */
+#define CMMU_DSR_RW 0x000100 /* Read Bit */
+#define CMMU_DSR_CP 0x000004 /* Copyback Error */
+#define CMMU_DSR_WA 0x000002 /* Write-Allocate Bus Error */
+#define CMMU_DSR_BE 0x000001 /* Bus Error */
/* definitions for use of the BATC */
-#define BATC_512K (0x00 << BATC_BLKSHIFT)
-#define BATC_1M (0x01 << BATC_BLKSHIFT)
-#define BATC_2M (0x03 << BATC_BLKSHIFT)
-#define BATC_4M (0x07 << BATC_BLKSHIFT)
-#define BATC_8M (0x0f << BATC_BLKSHIFT)
-#define BATC_16M (0x1f << BATC_BLKSHIFT)
-#define BATC_32M (0x3f << BATC_BLKSHIFT)
-#define BATC_64M (0x7f << BATC_BLKSHIFT)
+#define BATC_512K (0x00 << BATC_BLKSHIFT)
+#define BATC_1M (0x01 << BATC_BLKSHIFT)
+#define BATC_2M (0x03 << BATC_BLKSHIFT)
+#define BATC_4M (0x07 << BATC_BLKSHIFT)
+#define BATC_8M (0x0f << BATC_BLKSHIFT)
+#define BATC_16M (0x1f << BATC_BLKSHIFT)
+#define BATC_32M (0x3f << BATC_BLKSHIFT)
+#define BATC_64M (0x7f << BATC_BLKSHIFT)
/*
* Cache line information
@@ -128,23 +128,23 @@ u_int get_dctl(void);
*/
static __inline__ void
-mc88110_flush_data_line(paddr_t x)
+mc88110_wb_data_line(paddr_t x)
{
set_dsar(x);
- set_dcmd(CMMU_DCMD_FLUSH_LINE);
+ set_dcmd(CMMU_DCMD_WB_LINE);
}
static __inline__ void
-mc88110_flush_data_page(paddr_t x)
+mc88110_wb_data_page(paddr_t x)
{
set_dsar(x);
- set_dcmd(CMMU_DCMD_FLUSH_PG);
+ set_dcmd(CMMU_DCMD_WB_PG);
}
static __inline__ void
-mc88110_flush_data(void)
+mc88110_wb_data(void)
{
- set_dcmd(CMMU_DCMD_FLUSH_ALL);
+ set_dcmd(CMMU_DCMD_WB_ALL);
}
static __inline__ void
@@ -161,23 +161,23 @@ mc88110_inval_data(void)
}
static __inline__ void
-mc88110_sync_data_line(paddr_t x)
+mc88110_wbinv_data_line(paddr_t x)
{
set_dsar(x);
- set_dcmd(CMMU_DCMD_FLUSH_LINE_INV);
+ set_dcmd(CMMU_DCMD_WBINV_LINE);
}
static __inline__ void
-mc88110_sync_data_page(paddr_t x)
+mc88110_wbinv_data_page(paddr_t x)
{
set_dsar(x);
- set_dcmd(CMMU_DCMD_FLUSH_PG_INV);
+ set_dcmd(CMMU_DCMD_WBINV_PG);
}
static __inline__ void
-mc88110_sync_data(void)
+mc88110_wbinv_data(void)
{
- set_dcmd(CMMU_DCMD_FLUSH_ALL_INV);
+ set_dcmd(CMMU_DCMD_WBINV_ALL);
}
static __inline__ void
diff --git a/sys/arch/mvme88k/include/m88410.h b/sys/arch/mvme88k/include/m88410.h
index d0b5d464823..02a969450ff 100644
--- a/sys/arch/mvme88k/include/m88410.h
+++ b/sys/arch/mvme88k/include/m88410.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88410.h,v 1.12 2005/12/12 20:36:32 miod Exp $ */
+/* $OpenBSD: m88410.h,v 1.13 2010/12/31 20:54:21 miod Exp $ */
/*
* Copyright (c) 2001 Steve Murphree, Jr.
* All rights reserved.
@@ -42,15 +42,15 @@
#include <mvme88k/dev/busswreg.h>
-void mc88410_flush_page(paddr_t);
-void mc88410_flush(void);
-void mc88410_inval(void);
+void mc88410_wb_page(paddr_t);
+void mc88410_wb(void);
+void mc88410_inv(void);
static __inline__ void
-mc88410_sync(void)
+mc88410_wbinv(void)
{
- mc88410_flush();
- mc88410_inval();
+ mc88410_wb();
+ mc88410_inv();
}
static __inline__ int
diff --git a/sys/arch/mvme88k/mvme88k/m197_machdep.c b/sys/arch/mvme88k/mvme88k/m197_machdep.c
index 518075852d2..863997d2ad0 100644
--- a/sys/arch/mvme88k/mvme88k/m197_machdep.c
+++ b/sys/arch/mvme88k/mvme88k/m197_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m197_machdep.c,v 1.42 2010/06/22 17:42:37 miod Exp $ */
+/* $OpenBSD: m197_machdep.c,v 1.43 2010/12/31 20:54:21 miod Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
@@ -603,16 +603,16 @@ m197_ipi_handler(struct trapframe *eframe)
arg2 = ci->ci_ipi_arg2;
if (ipi & CI_IPI_TLB_FLUSH_KERNEL) {
- cmmu_flush_tlb(ci->ci_cpuid, 1, 0, 0);
+ cmmu_tlb_inv(ci->ci_cpuid, 1, 0, 0);
}
else if (ipi & CI_IPI_TLB_FLUSH_USER) {
- cmmu_flush_tlb(ci->ci_cpuid, 0, 0, 0);
+ cmmu_tlb_inv(ci->ci_cpuid, 0, 0, 0);
}
else if (ipi & CI_IPI_CACHE_FLUSH) {
- cmmu_flush_cache(ci->ci_cpuid, arg1, arg2);
+ cmmu_cache_wbinv(ci->ci_cpuid, arg1, arg2);
}
else if (ipi & CI_IPI_ICACHE_FLUSH) {
- cmmu_flush_inst_cache(ci->ci_cpuid, arg1, arg2);
+ cmmu_icache_inv(ci->ci_cpuid, arg1, arg2);
}
else if (ipi & CI_IPI_DMA_CACHECTL) {
dma_cachectl_local(arg1, arg2, DMA_CACHE_INV);
diff --git a/sys/arch/mvme88k/mvme88k/m88110.c b/sys/arch/mvme88k/mvme88k/m88110.c
index c6a9d3b6c0a..278818c7935 100644
--- a/sys/arch/mvme88k/mvme88k/m88110.c
+++ b/sys/arch/mvme88k/mvme88k/m88110.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88110.c,v 1.65 2010/06/22 17:42:37 miod Exp $ */
+/* $OpenBSD: m88110.c,v 1.66 2010/12/31 20:54:21 miod Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* All rights reserved.
@@ -85,12 +85,12 @@ void m88110_shutdown(void);
cpuid_t m88110_cpu_number(void);
void m88110_set_sapr(apr_t);
void m88110_set_uapr(apr_t);
-void m88110_flush_tlb(cpuid_t, u_int, vaddr_t, u_int);
-void m88410_flush_tlb(cpuid_t, u_int, vaddr_t, u_int);
-void m88110_flush_cache(cpuid_t, paddr_t, psize_t);
-void m88410_flush_cache(cpuid_t, paddr_t, psize_t);
-void m88110_flush_inst_cache(cpuid_t, paddr_t, psize_t);
-void m88410_flush_inst_cache(cpuid_t, paddr_t, psize_t);
+void m88110_tlb_inv(cpuid_t, u_int, vaddr_t, u_int);
+void m88410_tlb_inv(cpuid_t, u_int, vaddr_t, u_int);
+void m88110_cache_wbinv(cpuid_t, paddr_t, psize_t);
+void m88410_cache_wbinv(cpuid_t, paddr_t, psize_t);
+void m88110_icache_inv(cpuid_t, paddr_t, psize_t);
+void m88410_icache_inv(cpuid_t, paddr_t, psize_t);
void m88110_dma_cachectl(paddr_t, psize_t, int);
void m88110_dma_cachectl_local(paddr_t, psize_t, int);
void m88410_dma_cachectl(paddr_t, psize_t, int);
@@ -110,9 +110,9 @@ struct cmmu_p cmmu88110 = {
m88110_cpu_number,
m88110_set_sapr,
m88110_set_uapr,
- m88110_flush_tlb,
- m88110_flush_cache,
- m88110_flush_inst_cache,
+ m88110_tlb_inv,
+ m88110_cache_wbinv,
+ m88110_icache_inv,
m88110_dma_cachectl,
#ifdef MULTIPROCESSOR
m88110_dma_cachectl_local,
@@ -132,9 +132,9 @@ struct cmmu_p cmmu88410 = {
m88110_cpu_number,
m88110_set_sapr,
m88110_set_uapr,
- m88110_flush_tlb,
- m88410_flush_cache,
- m88410_flush_inst_cache,
+ m88110_tlb_inv,
+ m88410_cache_wbinv,
+ m88410_icache_inv,
m88410_dma_cachectl,
#ifdef MULTIPROCESSOR
m88410_dma_cachectl_local,
@@ -378,9 +378,9 @@ m88410_initialize_cpu(cpuid_t cpu)
junk += *(uint32_t *)va;
/* to make sure the above loop isn't optimized away */
- mc88110_sync_data_page(junk & PAGE_SIZE);
+ mc88110_wbinv_data_page(junk & PAGE_SIZE);
}
- mc88410_flush();
+ mc88410_wb();
mc88410_inval();
#endif
CMMU_UNLOCK;
@@ -443,7 +443,7 @@ m88110_set_uapr(apr_t ap)
* flush any tlb
*/
void
-m88110_flush_tlb(cpuid_t cpu, u_int kernel, vaddr_t vaddr, u_int count)
+m88110_tlb_inv(cpuid_t cpu, u_int kernel, vaddr_t vaddr, u_int count)
{
u_int32_t psr;
#ifdef MULTIPROCESSOR
@@ -520,7 +520,7 @@ m88110_flush_tlb(cpuid_t cpu, u_int kernel, vaddr_t vaddr, u_int count)
*/
void
-m88110_flush_cache(cpuid_t cpu, paddr_t pa, psize_t size)
+m88110_cache_wbinv(cpuid_t cpu, paddr_t pa, psize_t size)
{
u_int32_t psr;
@@ -528,13 +528,13 @@ m88110_flush_cache(cpuid_t cpu, paddr_t pa, psize_t size)
set_psr(psr | PSR_IND);
mc88110_inval_inst();
- mc88110_flush_data();
+ mc88110_wb_data();
set_psr(psr);
}
void
-m88410_flush_cache(cpuid_t cpu, paddr_t pa, psize_t size)
+m88410_cache_wbinv(cpuid_t cpu, paddr_t pa, psize_t size)
{
u_int32_t psr;
#ifdef MULTIPROCESSOR
@@ -551,9 +551,9 @@ m88410_flush_cache(cpuid_t cpu, paddr_t pa, psize_t size)
mc88110_inval_inst();
/* flush all data to avoid errata invalidate */
- mc88110_flush_data();
+ mc88110_wb_data();
CMMU_LOCK;
- mc88410_flush();
+ mc88410_wb();
CMMU_UNLOCK;
set_psr(psr);
@@ -564,14 +564,14 @@ m88410_flush_cache(cpuid_t cpu, paddr_t pa, psize_t size)
*/
void
-m88110_flush_inst_cache(cpuid_t cpu, paddr_t pa, psize_t size)
+m88110_icache_inv(cpuid_t cpu, paddr_t pa, psize_t size)
{
/* atomic so no psr games */
mc88110_inval_inst();
}
void
-m88410_flush_inst_cache(cpuid_t cpu, paddr_t pa, psize_t size)
+m88410_icache_inv(cpuid_t cpu, paddr_t pa, psize_t size)
{
u_int32_t psr;
#ifdef MULTIPROCESSOR
@@ -588,7 +588,7 @@ m88410_flush_inst_cache(cpuid_t cpu, paddr_t pa, psize_t size)
mc88110_inval_inst();
CMMU_LOCK;
- mc88410_flush();
+ mc88410_wb();
CMMU_UNLOCK;
set_psr(psr);
@@ -602,12 +602,12 @@ void
m88110_cmmu_sync_cache(paddr_t pa, psize_t size)
{
#ifdef ENABLE_88110_ERRATA_17
- mc88110_flush_data_page(pa);
+ mc88110_wb_data_page(pa);
#else
if (size <= MC88110_CACHE_LINE)
- mc88110_flush_data_line(pa);
+ mc88110_wb_data_line(pa);
else
- mc88110_flush_data_page(pa);
+ mc88110_wb_data_page(pa);
#endif
}
@@ -615,13 +615,13 @@ void
m88110_cmmu_sync_inval_cache(paddr_t pa, psize_t size)
{
#ifdef ENABLE_88110_ERRATA_17
- mc88110_flush_data_page(pa);
- mc88110_sync_data_page(pa);
+ mc88110_wb_data_page(pa);
+ mc88110_wbinv_data_page(pa);
#else
if (size <= MC88110_CACHE_LINE)
- mc88110_sync_data_line(pa);
+ mc88110_wbinv_data_line(pa);
else
- mc88110_sync_data_page(pa);
+ mc88110_wbinv_data_page(pa);
#endif
}
@@ -711,12 +711,12 @@ m88410_dma_cachectl_local(paddr_t pa, psize_t size, int op)
case DMA_CACHE_SYNC:
#if 0
flusher = m88110_cmmu_sync_cache;
- ext_flusher = mc88410_flush;
+ ext_flusher = mc88410_wb;
#endif
break;
case DMA_CACHE_SYNC_INVAL:
flusher = m88110_cmmu_sync_inval_cache;
- ext_flusher = mc88410_sync;
+ ext_flusher = mc88410_wbinv;
break;
default:
#ifdef ENABLE_88110_ERRATA_17
@@ -727,7 +727,7 @@ m88410_dma_cachectl_local(paddr_t pa, psize_t size, int op)
#ifdef notyet
ext_flusher = mc88410_inval;
#else
- ext_flusher = mc88410_sync;
+ ext_flusher = mc88410_wbinv;
#endif
break;
}
@@ -739,7 +739,7 @@ m88410_dma_cachectl_local(paddr_t pa, psize_t size, int op)
CMMU_LOCK;
while (size != 0) {
m88110_cmmu_sync_cache(pa, PAGE_SIZE);
- mc88410_flush_page(pa);
+ mc88410_wb_page(pa);
pa += PAGE_SIZE;
size -= PAGE_SIZE;
}
diff --git a/sys/arch/mvme88k/mvme88k/m88410.c b/sys/arch/mvme88k/mvme88k/m88410.c
index 1b5217a0b8f..a2f9938d9ea 100644
--- a/sys/arch/mvme88k/mvme88k/m88410.c
+++ b/sys/arch/mvme88k/mvme88k/m88410.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88410.c,v 1.4 2009/02/27 05:17:53 miod Exp $ */
+/* $OpenBSD: m88410.c,v 1.5 2010/12/31 20:54:21 miod Exp $ */
/*
* Copyright (c) 2001 Steve Murphree, Jr.
* All rights reserved.
@@ -48,18 +48,18 @@
*/
/*
- * Flush physical page number (specified in the low 20 bits of the
+ * Writeback physical page number (specified in the low 20 bits of the
* address).
*/
-#define XCC_FLUSH_PAGE 0x01
+#define XCC_WB_PAGE 0x01
/*
- * Flush the whole cache.
+ * Writeback the whole cache.
*/
-#define XCC_FLUSH_ALL 0x02
+#define XCC_WB_ALL 0x02
/*
* Invalidate the whole cache.
*/
-#define XCC_INVAL_ALL 0x03
+#define XCC_INV_ALL 0x03
/*
* Base address of the 88410 when mapped.
@@ -67,7 +67,7 @@
#define XCC_ADDR 0xff800000
void
-mc88410_flush_page(paddr_t physaddr)
+mc88410_wb_page(paddr_t physaddr)
{
paddr_t xccaddr = XCC_ADDR | (physaddr >> PGSHIFT);
u_int psr;
@@ -93,7 +93,7 @@ mc88410_flush_page(paddr_t physaddr)
__asm__ __volatile__ (
"or r2, r0, %0\n\t"
"or r3, r0, r0\n\t"
- "st.d r2, %1, 0" : : "i" (XCC_FLUSH_PAGE), "r" (xccaddr) : "r2", "r3");
+ "st.d r2, %1, 0" : : "i" (XCC_WB_PAGE), "r" (xccaddr) : "r2", "r3");
/* spin until the operation is complete */
while ((*(volatile u_int32_t *)(BS_BASE + BS_XCCR) & BS_XCC_FBSY) != 0)
@@ -107,7 +107,7 @@ mc88410_flush_page(paddr_t physaddr)
}
void
-mc88410_flush(void)
+mc88410_wb(void)
{
u_int16_t bs_gcsr, bs_romcr;
@@ -125,7 +125,7 @@ mc88410_flush(void)
__asm__ __volatile__ (
"or r2, r0, %0\n\t"
"or r3, r0, r0\n\t"
- "st.d r2, %1, 0" : : "i" (XCC_FLUSH_ALL), "r" (XCC_ADDR) : "r2", "r3");
+ "st.d r2, %1, 0" : : "i" (XCC_WB_ALL), "r" (XCC_ADDR) : "r2", "r3");
/* spin until the operation is complete */
while ((*(volatile u_int32_t *)(BS_BASE + BS_XCCR) & BS_XCC_FBSY) != 0)
@@ -136,7 +136,7 @@ mc88410_flush(void)
}
void
-mc88410_inval(void)
+mc88410_inv(void)
{
u_int16_t bs_gcsr, bs_romcr;
u_int32_t dummy;
@@ -155,7 +155,7 @@ mc88410_inval(void)
__asm__ __volatile__ (
"or r2, r0, %0\n\t"
"or r3, r0, r0\n\t"
- "st.d r2, %1, 0" : : "i" (XCC_INVAL_ALL), "r" (XCC_ADDR) : "r2", "r3");
+ "st.d r2, %1, 0" : : "i" (XCC_INV_ALL), "r" (XCC_ADDR) : "r2", "r3");
/*
* The 88410 will not let the 88110 access it until the