summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k/include
diff options
context:
space:
mode:
authorSteve Murphree <smurph@cvs.openbsd.org>2001-12-22 09:49:40 +0000
committerSteve Murphree <smurph@cvs.openbsd.org>2001-12-22 09:49:40 +0000
commit9f900604dbc423473ab9e941ac8feb88f9753e73 (patch)
treec69f40734154e65f3b7f6e5dc946df7e36af7855 /sys/arch/mvme88k/include
parente1fa840727a68278f53aa349cd5ca12b79da6b24 (diff)
masive cmmu overhaul. function pointers now control cmmu functionality
instead of case statements based on cpu type.
Diffstat (limited to 'sys/arch/mvme88k/include')
-rw-r--r--sys/arch/mvme88k/include/cmmu.h158
-rw-r--r--sys/arch/mvme88k/include/m88110.h316
-rw-r--r--sys/arch/mvme88k/include/m8820x.h105
3 files changed, 336 insertions, 243 deletions
diff --git a/sys/arch/mvme88k/include/cmmu.h b/sys/arch/mvme88k/include/cmmu.h
index cb81f1f55ad..4428ed13348 100644
--- a/sys/arch/mvme88k/include/cmmu.h
+++ b/sys/arch/mvme88k/include/cmmu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmmu.h,v 1.9 2001/12/16 23:49:46 miod Exp $ */
+/* $OpenBSD: cmmu.h,v 1.10 2001/12/22 09:49:39 smurph Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1992 Carnegie Mellon University
@@ -28,6 +28,8 @@
#ifndef _MACHINE_CMMU_H_
#define _MACHINE_CMMU_H_
+#include <machine/mmu.h>
+
/* Area Description */
#define AREA_D_WT 0x00000200 /* write through */
#define AREA_D_G 0x00000080 /* global */
@@ -58,70 +60,106 @@ extern unsigned cpu_sets[MAX_CPUS];
extern int cpu_cmmu_ratio;
extern unsigned number_cpus, master_cpu;
extern unsigned cache_policy;
+extern unsigned number_cpus;
+extern unsigned master_cpu;
extern int max_cpus, max_cmmus;
-#ifdef CMMU_DEBUG
-void show_apr(unsigned value);
-void show_sctr(unsigned value);
-#endif
-
-#ifdef DDB
-void cmmu_show_translation(unsigned, unsigned, unsigned, int);
-void cmmu_cache_state(unsigned, unsigned);
-void show_cmmu_info(unsigned);
-#endif
-
/*
- * Prototypes from "mvme88k/mvme88k/cmmu.c"
+ * This lock protects the cmmu SAR and SCR's; other ports
+ * can be accessed without locking it
+ *
+ * May be used from "db_interface.c".
*/
-
-unsigned cmmu_cpu_number(void);
-unsigned cmmu_remote_get(unsigned cpu, unsigned r, unsigned data);
-unsigned cmmu_get_idr(unsigned data);
-void cmmu_init(void);
-void cmmu_shutdown_now(void);
-void cmmu_parity_enable(void);
-void setup_board_config(void);
-void setup_cmmu_config(void);
-void cmmu_dump_config(void);
-unsigned cmmu_get_by_mode(int cpu, int mode);
-void cpu_configuration_print(int master);
-void dma_cachectl(vm_offset_t va, int size, int op);
-void cmmu_remote_set(unsigned cpu, unsigned r, unsigned data, unsigned x);
-void cmmu_set_sapr(unsigned ap);
-void cmmu_remote_set_sapr(unsigned cpu, unsigned ap);
-void cmmu_set_uapr(unsigned ap);
-void cmmu_flush_tlb(unsigned kernel, vm_offset_t vaddr, int size);
-void cmmu_flush_remote_cache(int cpu, vm_offset_t physaddr, int size);
-void cmmu_flush_cache(vm_offset_t physaddr, int size);
-void cmmu_flush_remote_inst_cache(int cpu, vm_offset_t physaddr, int size);
-void cmmu_flush_inst_cache(vm_offset_t physaddr, int size);
-void cmmu_flush_remote_data_cache(int cpu, vm_offset_t physaddr, int size);
-void cmmu_flush_data_cache(vm_offset_t physaddr, int size);
-
-void cmmu_pmap_activate(
- unsigned cpu,
- unsigned uapr,
- batc_template_t i_batc[BATC_MAX],
- batc_template_t d_batc[BATC_MAX]);
-
-void cmmu_flush_remote_tlb(
- unsigned cpu,
- unsigned kernel,
- vm_offset_t vaddr,
- int size);
-
-void cmmu_set_batc_entry(
- unsigned cpu,
- unsigned entry_no,
- unsigned data, /* 1 = data, 0 = instruction */
- unsigned value); /* the value to stuff into the batc */
-
-void cmmu_set_pair_batc_entry(
- unsigned cpu,
- unsigned entry_no,
- unsigned value); /* the value to stuff into the batc */
+extern struct simplelock cmmu_cpu_lock;
+
+#define CMMU_LOCK simple_lock(&cmmu_cpu_lock)
+#define CMMU_UNLOCK simple_unlock(&cmmu_cpu_lock)
+
+/* machine dependant cmmu function pointer structure */
+struct cmmu_p {
+ void (*cmmu_init_func) __P((void));
+ void (*show_apr_func) __P((unsigned));
+ void (*setup_board_config_func) __P((void));
+ void (*setup_cmmu_config_func) __P((void));
+ void (*cmmu_dump_config_func) __P((void));
+ void (*cpu_configuration_print_func) __P((int));
+ void (*cmmu_shutdown_now_func) __P((void));
+ void (*cmmu_parity_enable_func) __P((void));
+ unsigned (*cmmu_cpu_number_func) __P((void));
+ unsigned (*cmmu_get_idr_func) __P((unsigned));
+ void (*cmmu_set_sapr_func) __P((unsigned));
+ void (*cmmu_remote_set_sapr_func) __P((unsigned, unsigned));
+ void (*cmmu_set_uapr_func) __P((unsigned));
+ void (*cmmu_set_batc_entry_func) __P((unsigned, unsigned, unsigned, unsigned));
+ void (*cmmu_set_pair_batc_entry_func) __P((unsigned, unsigned, unsigned));
+ void (*cmmu_flush_remote_tlb_func) __P((unsigned, unsigned, vm_offset_t, int));
+ void (*cmmu_flush_tlb_func) __P((unsigned, vm_offset_t, int));
+ void (*cmmu_pmap_activate_func) __P((unsigned, unsigned,
+ batc_template_t i_batc[BATC_MAX],
+ batc_template_t d_batc[BATC_MAX]));
+ void (*cmmu_flush_remote_cache_func) __P((int, vm_offset_t, int));
+ void (*cmmu_flush_cache_func) __P((vm_offset_t, int));
+ void (*cmmu_flush_remote_inst_cache_func) __P((int, vm_offset_t, int));
+ void (*cmmu_flush_inst_cache_func) __P((vm_offset_t, int));
+ void (*cmmu_flush_remote_data_cache_func) __P((int, vm_offset_t, int));
+ void (*cmmu_flush_data_cache_func) __P((vm_offset_t, int));
+ void (*dma_cachectl_func) __P((vm_offset_t, int, int));
+#ifdef DDB
+ unsigned (*cmmu_get_by_mode_func) __P((int, int));
+ void (*cmmu_show_translation_func) __P((unsigned, unsigned, unsigned, int));
+ void (*cmmu_cache_state_func) __P((unsigned, unsigned));
+ void (*show_cmmu_info_func) __P((unsigned));
+#endif /* end if DDB */
+};
+
+/* THE pointer! */
+extern struct cmmu_p *cmmu;
+
+extern struct cmmu_p cmmu88110;
+extern struct cmmu_p cmmu8820x;
+
+/* The macros... */
+#define cmmu_init (cmmu->cmmu_init_func)
+#define show_apr(ap) (cmmu->show_apr_func)(ap)
+#define setup_board_config (cmmu->setup_board_config_func)
+#define setup_cmmu_config (cmmu->setup_cmmu_config_func)
+#define cmmu_dump_config (cmmu->cmmu_dump_config_func)
+#define cpu_configuration_print(a) (cmmu->cpu_configuration_print_func)(a)
+#define cmmu_shutdown_now (cmmu->cmmu_shutdown_now_func)
+#define cmmu_parity_enable (cmmu->cmmu_parity_enable_func)
+#define cmmu_cpu_number (cmmu->cmmu_cpu_number_func)
+#define cmmu_get_idr(a) (cmmu->cmmu_get_idr_func)(a)
+#define cmmu_set_sapr(a) (cmmu->cmmu_set_sapr_func)(a)
+#define cmmu_remote_set_sapr(a, b) (cmmu->cmmu_remote_set_sapr_func)(a, b)
+#define cmmu_set_uapr(a) (cmmu->cmmu_set_uapr_func)(a)
+#define cmmu_set_batc_entry(a, b, c, d) (cmmu->cmmu_set_batc_entry_func)(a, b, c, d)
+#define cmmu_set_pair_batc_entry(a, b, c) (cmmu->cmmu_set_pair_batc_entry_func)(a, b, c)
+#define cmmu_flush_remote_tlb(a, b, c, d) (cmmu->cmmu_flush_remote_tlb_func)(a, b, c, d)
+#define cmmu_flush_tlb(a, b, c) (cmmu->cmmu_flush_tlb_func)(a, b, c)
+#define cmmu_pmap_activate(a, b, c, d) (cmmu->cmmu_pmap_activate_func)(a, b, c, d)
+#define cmmu_flush_remote_cache(a, b, c) (cmmu->cmmu_flush_remote_cache_func)(a, b, c)
+#define cmmu_flush_cache(a, b) (cmmu->cmmu_flush_cache_func)(a, b)
+#define cmmu_flush_remote_inst_cache(a, b, c) (cmmu->cmmu_flush_remote_inst_cache_func)(a, b, c)
+#define cmmu_flush_inst_cache(a, b) (cmmu->cmmu_flush_inst_cache_func)(a, b)
+#define cmmu_flush_remote_data_cache(a, b, c) (cmmu->cmmu_flush_remote_data_cache_func)(a, b, c)
+#define cmmu_flush_data_cache(a, b) (cmmu->cmmu_flush_data_cache_func)(a, b)
+#define dma_cachectl(a, b, c) (cmmu->dma_cachectl_func)(a, b, c)
+#ifdef DDB
+#define cmmu_get_by_mode(a, b) (cmmu->cmmu_get_by_mode_func)(a, b)
+#define cmmu_show_translation(a, b, c, d) (cmmu->cmmu_show_translation_func)(a, b, c, d)
+#define cmmu_cache_state(a, b) (cmmu->cmmu_cache_state_func)(a, b)
+#define show_cmmu_info(a) (cmmu->show_cmmu_info_func)(a)
+#endif /* end if DDB */
#endif /* _LOCORE */
+#ifdef M88100
+#include <machine/m8820x.h>
+#endif /* M88100 */
+#ifdef M88110
+#include <machine/m88110.h>
+#include <machine/m88410.h>
+#endif /* M88110 */
+
#endif /* _MACHINE_CMMU_H_ */
+
diff --git a/sys/arch/mvme88k/include/m88110.h b/sys/arch/mvme88k/include/m88110.h
index 7be6627c784..2190b51aa25 100644
--- a/sys/arch/mvme88k/include/m88110.h
+++ b/sys/arch/mvme88k/include/m88110.h
@@ -1,16 +1,13 @@
-/* $OpenBSD: m88110.h,v 1.10 2001/12/16 23:49:46 miod Exp $ */
+/* $OpenBSD: m88110.h,v 1.11 2001/12/22 09:49:39 smurph Exp $ */
#ifndef __MACHINE_M88110_H__
#define __MACHINE_M88110_H__
+#include <uvm/uvm_extern.h>
#ifndef _LOCORE
# include <machine/mmu.h> /* batc_template_t */
#endif
-#include <machine/board.h>
-#include <machine/cmmu.h>
-#include <uvm/uvm_extern.h>
-
/*
* 88110 CMMU definitions
*/
@@ -79,6 +76,11 @@
#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 */
@@ -88,6 +90,9 @@
#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 */
@@ -110,126 +115,205 @@
#define CMMU_DATA 1
#define CMMU_INST 0
+/* definitions for use of the BATC */
+#define BATC_512K (0x00 << 19)
+#define BATC_1M (0x01 << 19)
+#define BATC_2M (0x03 << 19)
+#define BATC_4M (0x07 << 19)
+#define BATC_8M (0x0F << 19)
+#define BATC_16M (0x1F << 19)
+#define BATC_32M (0x3F << 19)
+#define BATC_64M (0x7F << 19)
+#define BATC_ADDR_MASK 0xFFF80000
+#define BATC_ADDR_SHIFT 13
+#define BATC_LBA_SHIFT 19
+#define BATC_PBA_SHIFT 6
+#define BATC_SU 0x20
+#define BATC_WT 0x10
+#define BATC_G 0x08
+#define BATC_CI 0x04
+#define BATC_WP 0x02
+#define BATC_V 0x01
+
+#define CLINE_MASK 0x1F
+#define CLINE_SIZE (8 * 32)
+
#ifndef _LOCORE
+
/*
- * Prototypes from "mvme88k/mvme88k/m197_cmmu.c"
+ * Prototypes from "mvme88k/mvme88k/m88110_cmmu.c"
*/
+void m88110_show_apr __P((unsigned));
+void m88110_show_sctr __P((unsigned));
+void m88110_setup_board_config __P((void));
+void m88110_setup_cmmu_config __P((void));
+void m88110_cmmu_dump_config __P((void));
+void m88110_cpu_configuration_print __P((int));
+void m88110_cmmu_shutdown_now __P((void));
+void m88110_cmmu_parity_enable __P((void));
+unsigned m88110_cmmu_cpu_number __P((void));
+unsigned m88110_cmmu_get_idr __P((unsigned));
+void m88110_cmmu_set_sapr __P((unsigned));
+void m88110_cmmu_remote_set_sapr __P((unsigned, unsigned));
+void m88110_cmmu_set_uapr __P((unsigned));
+void m88110_cmmu_set_batc_entry __P((unsigned, unsigned, unsigned, unsigned));
+void m88110_cmmu_set_pair_batc_entry __P((unsigned, unsigned, unsigned));
+void m88110_cmmu_flush_remote_tlb __P((unsigned, unsigned, vm_offset_t, int));
+void m88110_cmmu_flush_tlb __P((unsigned, vm_offset_t, int));
+void m88110_cmmu_pmap_activate __P((unsigned, unsigned,
+ batc_template_t i_batc[BATC_MAX],
+ batc_template_t d_batc[BATC_MAX]));
+void m88110_cmmu_flush_remote_cache __P((int, vm_offset_t, int));
+void m88110_cmmu_flush_cache __P((vm_offset_t, int));
+void m88110_cmmu_flush_remote_inst_cache __P((int, vm_offset_t, int));
+void m88110_cmmu_flush_inst_cache __P((vm_offset_t, int));
+void m88110_cmmu_flush_remote_data_cache __P((int, vm_offset_t, int));
+void m88110_cmmu_flush_data_cache __P((vm_offset_t, int));
+void m88110_dma_cachectl __P((vm_offset_t, int, int));
-#ifdef DDB
-void m197_cmmu_show_translation(unsigned, unsigned, unsigned, int);
-void m197_cmmu_cache_state(unsigned, unsigned);
-void m197_show_cmmu_info(unsigned);
+#if DDB
+unsigned m88110_cmmu_get_by_mode __P((int, int));
+void m88110_cmmu_show_translation __P((unsigned, unsigned, unsigned, int));
+void m88110_cmmu_cache_state __P((unsigned, unsigned));
+void m88110_show_cmmu_info __P((unsigned));
#endif
-#ifdef CMMU_DEBUG
-void m197_show_apr(unsigned value);
-void m197_show_sctr(unsigned value);
-#endif
+void m88110_cmmu_init __P((void));
+int m88110_table_search __P((pmap_t, vm_offset_t, int, int, int));
-unsigned m197_cmmu_cpu_number(void);
-unsigned m197_cmmu_remote_get(unsigned cpu, unsigned r, unsigned data);
-unsigned m197_cmmu_get_idr(unsigned data);
-void m197_cmmu_init(void);
-void m197_cmmu_shutdown_now(void);
-void m197_cmmu_parity_enable(void);
-void m197_setup_board_config(void);
-void m197_setup_cmmu_config(void);
-void m197_cmmu_dump_config(void);
-unsigned m197_cmmu_get_by_mode(int cpu, int mode);
-void m197_cpu_configuration_print(int master);
-void m197_dma_cachectl(vm_offset_t va, int size, int op);
-void m197_cmmu_remote_set(unsigned cpu, unsigned r, unsigned data, unsigned x);
-void m197_cmmu_set_sapr(unsigned ap);
-void m197_cmmu_remote_set_sapr(unsigned cpu, unsigned ap);
-void m197_cmmu_set_uapr(unsigned ap);
-void m197_cmmu_flush_tlb(unsigned kernel, vm_offset_t vaddr, int size);
-void m197_cmmu_flush_remote_cache(int cpu, vm_offset_t physaddr, int size);
-void m197_cmmu_flush_cache(vm_offset_t physaddr, int size);
-void m197_cmmu_flush_remote_inst_cache(int cpu, vm_offset_t physaddr, int size);
-void m197_cmmu_flush_inst_cache(vm_offset_t physaddr, int size);
-void m197_cmmu_flush_remote_data_cache(int cpu, vm_offset_t physaddr, int size);
-void m197_cmmu_flush_data_cache(vm_offset_t physaddr, int size);
-
-void m197_cmmu_pmap_activate(
- unsigned cpu,
- unsigned uapr,
- batc_template_t i_batc[BATC_MAX],
- batc_template_t d_batc[BATC_MAX]);
-
-void m197_cmmu_flush_remote_tlb(
- unsigned cpu,
- unsigned kernel,
- vm_offset_t vaddr,
- int size);
-
-void m197_cmmu_set_batc_entry(
- unsigned cpu,
- unsigned entry_no,
- unsigned data, /* 1 = data, 0 = instruction */
- unsigned value); /* the value to stuff into the batc */
-
-void m197_cmmu_set_pair_batc_entry(
- unsigned cpu,
- unsigned entry_no,
- unsigned value); /* the value to stuff into the batc */
-
-int m197_table_search(
- pmap_t map,
- vm_offset_t virt,
- int write,
- int user, int data);
-
-void set_icmd (unsigned value);
-void set_ictl (unsigned value);
-void set_isar (unsigned value);
-void set_isap (unsigned value);
-void set_iuap (unsigned value);
-void set_iir (unsigned value);
-void set_ibp (unsigned value);
-void set_ippu (unsigned value);
-void set_ippl (unsigned value);
-void set_isr (unsigned value);
-void set_ilar (unsigned value);
-void set_ipar (unsigned value);
-void set_dcmd (unsigned value);
-void set_dctl (unsigned value);
-void set_dsar (unsigned value);
-void set_dsap (unsigned value);
-void set_duap (unsigned value);
-void set_dir (unsigned value);
-void set_dbp (unsigned value);
-void set_dppu (unsigned value);
-void set_dppl (unsigned value);
-void set_dsr (unsigned value);
-void set_dlar (unsigned value);
-void set_dpar (unsigned value);
+void set_icmd __P((unsigned value));
+void set_ictl __P((unsigned value));
+void set_isar __P((unsigned value));
+void set_isap __P((unsigned value));
+void set_iuap __P((unsigned value));
+void set_iir __P((unsigned value));
+void set_ibp __P((unsigned value));
+void set_ippu __P((unsigned value));
+void set_ippl __P((unsigned value));
+void set_isr __P((unsigned value));
+void set_ilar __P((unsigned value));
+void set_ipar __P((unsigned value));
+void set_dcmd __P((unsigned value));
+void set_dctl __P((unsigned value));
+void set_dsar __P((unsigned value));
+void set_dsap __P((unsigned value));
+void set_duap __P((unsigned value));
+void set_dir __P((unsigned value));
+void set_dbp __P((unsigned value));
+void set_dppu __P((unsigned value));
+void set_dppl __P((unsigned value));
+void set_dsr __P((unsigned value));
+void set_dlar __P((unsigned value));
+void set_dpar __P((unsigned value));
/* get routines */
-unsigned get_icmd (void);
-unsigned get_ictl (void);
-unsigned get_isar (void);
-unsigned get_isap (void);
-unsigned get_iuap (void);
-unsigned get_iir (void);
-unsigned get_ibp (void);
-unsigned get_ippu (void);
-unsigned get_ippl (void);
-unsigned get_isr (void);
-unsigned get_ilar (void);
-unsigned get_ipar (void);
-unsigned get_dcmd (void);
-unsigned get_dctl (void);
-unsigned get_dsar (void);
-unsigned get_dsap (void);
-unsigned get_duap (void);
-unsigned get_dir (void);
-unsigned get_dbp (void);
-unsigned get_dppu (void);
-unsigned get_dppl (void);
-unsigned get_dsr (void);
-unsigned get_dlar (void);
-unsigned get_dpar (void);
+unsigned get_icmd __P((void));
+unsigned get_ictl __P((void));
+unsigned get_isar __P((void));
+unsigned get_isap __P((void));
+unsigned get_iuap __P((void));
+unsigned get_iir __P((void));
+unsigned get_ibp __P((void));
+unsigned get_ippu __P((void));
+unsigned get_ippl __P((void));
+unsigned get_isr __P((void));
+unsigned get_ilar __P((void));
+unsigned get_ipar __P((void));
+unsigned get_dcmd __P((void));
+unsigned get_dctl __P((void));
+unsigned get_dsar __P((void));
+unsigned get_dsap __P((void));
+unsigned get_duap __P((void));
+unsigned get_dir __P((void));
+unsigned get_dbp __P((void));
+unsigned get_dppu __P((void));
+unsigned get_dppl __P((void));
+unsigned get_dsr __P((void));
+unsigned get_dlar __P((void));
+unsigned get_dpar __P((void));
-#endif /* _LOCORE */
+/* Cache inlines */
+
+#define line_addr(x) (vm_offset_t)((x) & ~CLINE_MASK)
+#define page_addr(x) (vm_offset_t)((x) & ~PAGE_MASK)
+
+static __inline__ void mc88110_flush_data_line(vm_offset_t x)
+{
+ unsigned dctl = get_dctl();
+ if (dctl & CMMU_DCTL_CEN){
+ set_dsar(line_addr(x));
+ set_dcmd(CMMU_DCMD_FLUSH_LINE);
+ }
+}
+static __inline__ void mc88110_flush_data_page(vm_offset_t x)
+{
+ unsigned dctl = get_dctl();
+ if (dctl & CMMU_DCTL_CEN){
+ set_dsar(page_addr(x));
+ set_dcmd(CMMU_DCMD_FLUSH_PG);
+ }
+}
+
+static __inline__ void mc88110_flush_data(void)
+{
+ unsigned dctl = get_dctl();
+ if (dctl & CMMU_DCTL_CEN){
+ set_dsar(0x00);
+ set_dcmd(CMMU_DCMD_FLUSH_ALL);
+ }
+}
+
+static __inline__ void mc88110_inval_data_line(vm_offset_t x)
+{
+ set_dsar(line_addr(x));
+ set_dcmd(CMMU_DCMD_INV_LINE);
+}
+
+static __inline__ void mc88110_inval_data(void)
+{
+ set_dsar(0x00);
+ set_dcmd(CMMU_DCMD_INV_ALL);
+}
+
+static __inline__ void mc88110_sync_data_line(vm_offset_t x)
+{
+ unsigned dctl = get_dctl();
+ if (dctl & CMMU_DCTL_CEN){
+ set_dsar(line_addr(x));
+ set_dcmd(CMMU_DCMD_FLUSH_LINE_INV);
+ }
+}
+
+static __inline__ void mc88110_sync_data_page(vm_offset_t x)
+{
+ unsigned dctl = get_dctl();
+ if (dctl & CMMU_DCTL_CEN){
+ set_dsar(page_addr(x));
+ set_dcmd(CMMU_DCMD_FLUSH_PG_INV);
+ }
+}
+
+static __inline__ void mc88110_sync_data(void)
+{
+ unsigned dctl = get_dctl();
+ if (dctl & CMMU_DCTL_CEN){
+ set_dsar(0x00);
+ set_dcmd(CMMU_DCMD_FLUSH_ALL_INV);
+ }
+}
+
+static __inline__ void mc88110_inval_inst_line(vm_offset_t x)
+{
+ set_isar(line_addr(x));
+ set_icmd(CMMU_ICMD_INV_LINE);
+}
+
+static __inline__ void mc88110_inval_inst(void)
+{
+ set_isar(0x00);
+ set_icmd(CMMU_ICMD_INV_ITIC);
+}
+
+#endif /* _LOCORE */
#endif /* __MACHINE_M88110_H__ */
diff --git a/sys/arch/mvme88k/include/m8820x.h b/sys/arch/mvme88k/include/m8820x.h
index 3b8c03ab510..64535a472dc 100644
--- a/sys/arch/mvme88k/include/m8820x.h
+++ b/sys/arch/mvme88k/include/m8820x.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: m8820x.h,v 1.4 2001/12/22 07:35:43 smurph Exp $ */
+/* $OpenBSD: m8820x.h,v 1.5 2001/12/22 09:49:39 smurph Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1992 Carnegie Mellon University
@@ -30,15 +30,8 @@
*/
-#ifndef __MACHINE_M882XX_H__
-#define __MACHINE_M882XX_H__
-
-#ifndef _LOCORE
-# include <machine/mmu.h> /* batc_template_t */
-#endif
-
-#include <machine/board.h>
-#include <machine/cmmu.h>
+#ifndef __MACHINE_M8820X_H__
+#define __MACHINE_M8820X_H__
/*
* 88200 CMMU definitions
@@ -133,65 +126,43 @@
#ifndef _LOCORE
/*
- * Prototypes from "mvme88k/mvme88k/m18x_cmmu.c"
+ * Prototypes from "mvme88k/mvme88k/m8820x.c"
*/
-#ifdef DDB
-void m18x_cmmu_show_translation(unsigned, unsigned, unsigned, int);
-void m18x_cmmu_cache_state(unsigned, unsigned);
-void m18x_show_cmmu_info(unsigned);
-#endif
-
-#ifdef CMMU_DEBUG
-void m18x_show_apr(unsigned value);
-void m18x_show_sctr(unsigned value);
-#endif
-
-unsigned m18x_cmmu_cpu_number(void);
-unsigned m18x_cmmu_remote_get(unsigned cpu, unsigned r, unsigned data);
-unsigned m18x_cmmu_get_idr(unsigned data);
-void m18x_cmmu_init(void);
-void m18x_cmmu_shutdown_now(void);
-void m18x_cmmu_parity_enable(void);
-void m18x_setup_board_config(void);
-void m18x_setup_cmmu_config(void);
-void m18x_cmmu_dump_config(void);
-unsigned m18x_cmmu_get_by_mode(int cpu, int mode);
-void m18x_cpu_configuration_print(int master);
-void m18x_dma_cachectl(vm_offset_t va, int size, int op);
-void m18x_cmmu_remote_set(unsigned cpu, unsigned r, unsigned data, unsigned x);
-void m18x_cmmu_set_sapr(unsigned ap);
-void m18x_cmmu_remote_set_sapr(unsigned cpu, unsigned ap);
-void m18x_cmmu_set_uapr(unsigned ap);
-void m18x_cmmu_flush_tlb(unsigned kernel, vm_offset_t vaddr, int size);
-void m18x_cmmu_flush_remote_cache(int cpu, vm_offset_t physaddr, int size);
-void m18x_cmmu_flush_cache(vm_offset_t physaddr, int size);
-void m18x_cmmu_flush_remote_inst_cache(int cpu, vm_offset_t physaddr, int size);
-void m18x_cmmu_flush_inst_cache(vm_offset_t physaddr, int size);
-void m18x_cmmu_flush_remote_data_cache(int cpu, vm_offset_t physaddr, int size);
-void m18x_cmmu_flush_data_cache(vm_offset_t physaddr, int size);
-
-void m18x_cmmu_pmap_activate(
- unsigned cpu,
- unsigned uapr,
+void m8820x_show_apr __P((unsigned));
+void m8820x_setup_board_config __P((void));
+void m8820x_setup_cmmu_config __P((void));
+void m8820x_cmmu_dump_config __P((void));
+void m8820x_cpu_configuration_print __P((int));
+void m8820x_cmmu_shutdown_now __P((void));
+void m8820x_cmmu_parity_enable __P((void));
+unsigned m8820x_cmmu_cpu_number __P((void));
+unsigned m8820x_cmmu_get_idr __P((unsigned));
+void m8820x_cmmu_set_sapr __P((unsigned));
+void m8820x_cmmu_remote_set_sapr __P((unsigned, unsigned));
+void m8820x_cmmu_set_uapr __P((unsigned));
+void m8820x_cmmu_set_batc_entry __P((unsigned, unsigned, unsigned, unsigned));
+void m8820x_cmmu_set_pair_batc_entry __P((unsigned, unsigned, unsigned));
+void m8820x_cmmu_flush_remote_tlb __P((unsigned, unsigned, vm_offset_t, int));
+void m8820x_cmmu_flush_tlb __P((unsigned, vm_offset_t, int));
+void m8820x_cmmu_pmap_activate __P((unsigned, unsigned,
batc_template_t i_batc[BATC_MAX],
- batc_template_t d_batc[BATC_MAX]);
-
-void m18x_cmmu_flush_remote_tlb(
- unsigned cpu,
- unsigned kernel,
- vm_offset_t vaddr,
- int size);
-
-void m18x_cmmu_set_batc_entry(
- unsigned cpu,
- unsigned entry_no,
- unsigned data, /* 1 = data, 0 = instruction */
- unsigned value); /* the value to stuff into the batc */
+ batc_template_t d_batc[BATC_MAX]));
+void m8820x_cmmu_flush_remote_cache __P((int, vm_offset_t, int));
+void m8820x_cmmu_flush_cache __P((vm_offset_t, int));
+void m8820x_cmmu_flush_remote_inst_cache __P((int, vm_offset_t, int));
+void m8820x_cmmu_flush_inst_cache __P((vm_offset_t, int));
+void m8820x_cmmu_flush_remote_data_cache __P((int, vm_offset_t, int));
+void m8820x_cmmu_flush_data_cache __P((vm_offset_t, int));
+void m8820x_dma_cachectl __P((vm_offset_t, int, int));
+
+#if DDB
+unsigned m8820x_cmmu_get_by_mode __P((int, int));
+void m8820x_cmmu_show_translation __P((unsigned, unsigned, unsigned, int));
+void m8820x_cmmu_cache_state __P((unsigned, unsigned));
+void m8820x_show_cmmu_info __P((unsigned));
+#endif
-void m18x_cmmu_set_pair_batc_entry(
- unsigned cpu,
- unsigned entry_no,
- unsigned value); /* the value to stuff into the batc */
+void m8820x_cmmu_init __P((void));
#endif /* _LOCORE */
@@ -245,4 +216,4 @@ void m18x_cmmu_set_pair_batc_entry(
#define NBSG (4*1024*1024) /* segment size */
-#endif /* __MACHINE_M882XX_H__ */
+#endif /* __MACHINE_M8820X_H__ */