From 324f4b04e0878b995b836bdbbb069e524a5b6615 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sat, 23 Jun 2012 21:53:39 +0000 Subject: Fix ITLBNOPFIX macro definition on RM7000-capable kernels, and use it in cp0_set_config() for consistency. --- sys/arch/mips64/include/asm.h | 11 ++++++++--- sys/arch/mips64/mips64/cp0access.S | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'sys/arch') diff --git a/sys/arch/mips64/include/asm.h b/sys/arch/mips64/include/asm.h index 65289dcaf37..bc538953caa 100644 --- a/sys/arch/mips64/include/asm.h +++ b/sys/arch/mips64/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.14 2011/03/23 16:54:36 pirofti Exp $ */ +/* $OpenBSD: asm.h,v 1.15 2012/06/23 21:53:38 miod Exp $ */ /* * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -30,8 +30,13 @@ #include -#ifdef NEED_OLD_RM7KFIX -#define ITLBNOPFIX nop;nop;nop;nop;nop;nop;nop;nop;nop;nop; +/* + * Due to a flaw in RM7000 1.x processors a pipeline 'drain' is + * required after some mtc0 instructions. + * Ten nops in sequence does the trick. + */ +#ifdef CPU_RM7000 +#define ITLBNOPFIX nop;nop;nop;nop;nop;nop;nop;nop;nop;nop #else #define ITLBNOPFIX nop;nop;nop;nop #endif diff --git a/sys/arch/mips64/mips64/cp0access.S b/sys/arch/mips64/mips64/cp0access.S index 7bb04346f0c..aa2d67f780f 100644 --- a/sys/arch/mips64/mips64/cp0access.S +++ b/sys/arch/mips64/mips64/cp0access.S @@ -1,4 +1,4 @@ -/* $OpenBSD: cp0access.S,v 1.15 2012/03/28 20:44:23 miod Exp $ */ +/* $OpenBSD: cp0access.S,v 1.16 2012/06/23 21:53:38 miod Exp $ */ /* * Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -157,6 +157,7 @@ END(cp0_get_config) /* WARNING! Needs to be invoked from uncached address. */ LEAF(cp0_set_config, 0) mtc0 a0, COP_0_CONFIG + ITLBNOPFIX j ra nop END(cp0_set_config) -- cgit v1.2.3