summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2011-05-25 21:22:28 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2011-05-25 21:22:28 +0000
commit9e363f9da59a23bb25eec4cbc9ccc02d9bd5f61c (patch)
treefcb60405ccbd27755b5c5244fd479d5f41f5497e
parentc5c4621a5cf4b6a6d2e8b59055e95898e06bf1b4 (diff)
Set UX and SX in the system register early in boot. While not necessary on
the real hardware, some emulators (such as those which name start with `qe' and end in `mu' and are four letters long) expect the cpu behaviour to honour the value of these bits. This is not worth doing but it's cheap.
-rw-r--r--sys/arch/loongson/loongson/machdep.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c
index f43be417862..4851338ad5c 100644
--- a/sys/arch/loongson/loongson/machdep.c
+++ b/sys/arch/loongson/loongson/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.27 2011/03/31 20:37:44 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.28 2011/05/25 21:22:27 miod Exp $ */
/*
* Copyright (c) 2009, 2010 Miodrag Vallat.
@@ -209,6 +209,13 @@ mips_init(int32_t argc, int32_t argv, int32_t envp, int32_t cv,
extern void xtlb_miss;
/*
+ * Make sure we can access the extended address space.
+ * This is not necessary on real hardware, but some emulators
+ * are not aware of this.
+ */
+ setsr(getsr() | SR_KX | SR_UX);
+
+ /*
* Clear the compiled BSS segment in OpenBSD code.
* PMON is supposed to have done this, though.
*/