summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2020-06-05 13:35:22 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2020-06-05 13:35:22 +0000
commita0f3dde5a3e915c50c58719da031e61796ad31d5 (patch)
treef44bb20b66169c1d7dbe96609f439b24d76ab563 /sys/arch/mips64
parent97cc7a3fd21417c0b1a491585132a92bea64ea93 (diff)
cpu_rnd_messybits() for mips64
Use CP0 Count as a basis. Also take noise from virtual memory activity by including BadVAddr. OK deraadt@ dlg@
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r--sys/arch/mips64/mips64/cp0access.S14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/arch/mips64/mips64/cp0access.S b/sys/arch/mips64/mips64/cp0access.S
index 642b800ea79..062293f7335 100644
--- a/sys/arch/mips64/mips64/cp0access.S
+++ b/sys/arch/mips64/mips64/cp0access.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cp0access.S,v 1.20 2016/08/16 13:03:58 visa Exp $ */
+/* $OpenBSD: cp0access.S,v 1.21 2020/06/05 13:35:20 visa Exp $ */
/*
* Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -220,3 +220,15 @@ LEAF(cp0_set_trapbase, 0)
NOP
END(cp0_set_trapbase)
#endif
+
+LEAF(cpu_rnd_messybits, 0)
+ MFC0 v0, COP_0_COUNT
+ MFC0_HAZARD
+#ifndef CPU_R8000
+ MFC0 v1, COP_0_BAD_VADDR
+ MFC0_HAZARD
+ xor v0, v1
+#endif
+ j ra
+ NOP
+END(cpu_rnd_messybits)