summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/luna88k/luna88k/machdep.c4
-rw-r--r--sys/arch/m88k/include/m88100.h20
-rw-r--r--sys/arch/m88k/m88k/m88100_machdep.c36
-rw-r--r--sys/arch/mvme88k/mvme88k/machdep.c11
4 files changed, 58 insertions, 13 deletions
diff --git a/sys/arch/luna88k/luna88k/machdep.c b/sys/arch/luna88k/luna88k/machdep.c
index 2991ee82ffc..fd43ad9270f 100644
--- a/sys/arch/luna88k/luna88k/machdep.c
+++ b/sys/arch/luna88k/luna88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.34 2006/10/30 14:46:35 aoyama Exp $ */
+/* $OpenBSD: machdep.c,v 1.35 2006/11/18 22:58:25 miod Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -1096,6 +1096,8 @@ luna88k_bootstrap()
master_cpu = cmmu_init();
set_cpu_number(master_cpu);
+ m88100_apply_patches();
+
/*
* On the luna88k, secondary processors are not disabled while the
* kernel is initializing. We just initialized the CMMUs tied to the
diff --git a/sys/arch/m88k/include/m88100.h b/sys/arch/m88k/include/m88100.h
index 1b56d2f26d2..53180beb2e2 100644
--- a/sys/arch/m88k/include/m88100.h
+++ b/sys/arch/m88k/include/m88100.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88100.h,v 1.2 2004/08/01 17:18:05 miod Exp $ */
+/* $OpenBSD: m88100.h,v 1.3 2006/11/18 22:58:28 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1992 Carnegie Mellon University
@@ -57,19 +57,21 @@
#define DMT_ENBITS(x) (((x) & DMT_EN) >> DMT_ENSHIFT)
#if defined(_KERNEL) && !defined(_LOCORE)
-void dae_print(unsigned *eframe);
-void data_access_emulation(unsigned *eframe);
+
+void dae_print(unsigned *);
+void data_access_emulation(unsigned *);
u_int32_t do_load_word(vaddr_t, int);
u_int16_t do_load_half(vaddr_t, int);
-u_int8_t do_load_byte(vaddr_t, int);
+u_int8_t do_load_byte(vaddr_t, int);
+void do_store_word(vaddr_t, u_int32_t, int);
+void do_store_half(vaddr_t, u_int16_t, int);
+void do_store_byte(vaddr_t, u_int8_t, int);
+u_int32_t do_xmem_word(vaddr_t, u_int32_t, int);
+u_int8_t do_xmem_byte(vaddr_t, u_int8_t, int);
-void do_store_word(vaddr_t, u_int32_t, int);
-void do_store_half(vaddr_t, u_int16_t, int);
-void do_store_byte(vaddr_t, u_int8_t, int);
+void m88100_apply_patches(void);
-u_int32_t do_xmem_word(vaddr_t, u_int32_t, int);
-u_int8_t do_xmem_byte(vaddr_t, u_int8_t, int);
#endif
#endif /* __M88K_M88100_H__ */
diff --git a/sys/arch/m88k/m88k/m88100_machdep.c b/sys/arch/m88k/m88k/m88100_machdep.c
index c0cbb795d4c..61a1bef371c 100644
--- a/sys/arch/m88k/m88k/m88100_machdep.c
+++ b/sys/arch/m88k/m88k/m88100_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88100_machdep.c,v 1.1 2004/08/01 17:18:05 miod Exp $ */
+/* $OpenBSD: m88100_machdep.c,v 1.2 2006/11/18 22:58:28 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
@@ -31,10 +31,11 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <machine/asm_macro.h>
#include <m88k/m88100.h>
/*
- * data access emulation for M88100 exceptions
+ * Data Access Emulation for M88100 exceptions
*/
#define DMT_BYTE 1
@@ -260,3 +261,34 @@ data_access_emulation(unsigned *eframe)
}
eframe[EF_DMT0] = 0;
}
+
+/*
+ * Routines to patch the kernel code on 88100 systems not affected by
+ * the xxx.usr bug.
+ */
+
+void
+m88100_apply_patches()
+{
+#ifdef ERRATA__XXX_USR
+ if (((get_cpu_pid() & PID_VN) >> VN_SHIFT) >= 2) {
+ /*
+ * Patch DAE helpers.
+ * before after
+ * branch branch
+ * NOP jmp.n r1
+ * xxx.usr xxx.usr
+ * NOP; NOP; NOP
+ * jmp r1
+ */
+ ((u_int32_t *)(do_load_word))[1] = 0xf400c401;
+ ((u_int32_t *)(do_load_half))[1] = 0xf400c401;
+ ((u_int32_t *)(do_load_byte))[1] = 0xf400c401;
+ ((u_int32_t *)(do_store_word))[1] = 0xf400c401;
+ ((u_int32_t *)(do_store_half))[1] = 0xf400c401;
+ ((u_int32_t *)(do_store_byte))[1] = 0xf400c401;
+ ((u_int32_t *)(do_xmem_word))[1] = 0xf400c401;
+ ((u_int32_t *)(do_xmem_byte))[1] = 0xf400c401;
+ }
+#endif
+}
diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c
index b6b8d2270dd..3bdd8849c79 100644
--- a/sys/arch/mvme88k/mvme88k/machdep.c
+++ b/sys/arch/mvme88k/mvme88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.184 2006/07/07 19:36:56 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.185 2006/11/18 22:58:28 miod Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -74,6 +74,9 @@
#include <machine/cpu.h>
#include <machine/kcore.h>
#include <machine/reg.h>
+#ifdef M88100
+#include <machine/m88100.h>
+#endif
#include <dev/cons.h>
@@ -1043,6 +1046,12 @@ mvme_bootstrap()
master_cpu = cmmu_init();
set_cpu_number(master_cpu);
+#ifdef M88100
+ if (CPU_IS88100) {
+ m88100_apply_patches();
+ }
+#endif
+
/*
* Now that set_cpu_number() set us with a valid cpu_info pointer,
* we need to initialize p_addr and curpcb before autoconf, for the