From owner-svn-src-head@FreeBSD.ORG Fri Nov 18 09:30:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 463F51065686; Fri, 18 Nov 2011 09:30:25 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BFA58FC13; Fri, 18 Nov 2011 09:30:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAI9UPJh063727; Fri, 18 Nov 2011 09:30:25 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAI9UO0K063723; Fri, 18 Nov 2011 09:30:24 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201111180930.pAI9UO0K063723@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 18 Nov 2011 09:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227658 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 09:30:25 -0000 Author: jchandra Date: Fri Nov 18 09:30:24 2011 New Revision: 227658 URL: http://svn.freebsd.org/changeset/base/227658 Log: Fix COP0 hazards for XLR and XLP The XLR CPUs do not have any software visible hazards for COP0 operations. On XLP the hazard is a ehb, since it is mips64r2. Modified: head/sys/mips/include/asm.h head/sys/mips/include/cpufunc.h head/sys/mips/include/cpuregs.h Modified: head/sys/mips/include/asm.h ============================================================================== --- head/sys/mips/include/asm.h Fri Nov 18 09:12:26 2011 (r227657) +++ head/sys/mips/include/asm.h Fri Nov 18 09:30:24 2011 (r227658) @@ -855,6 +855,15 @@ _C_LABEL(x): * For more info on CP0 hazards see Chapter 7 (p.99) of "MIPS32 Architecture * For Programmers Volume III: The MIPS32 Privileged Resource Architecture" */ +#if defined(CPU_NLM) +#define HAZARD_DELAY sll $0,3 +#define ITLBNOPFIX sll $0,3 +#elif defined(CPU_RMI) +#define HAZARD_DELAY +#define ITLBNOPFIX +#else #define ITLBNOPFIX nop;nop;nop;nop;nop;nop;nop;nop;nop;nop; #define HAZARD_DELAY nop;nop;nop;nop;nop; +#endif + #endif /* !_MACHINE_ASM_H_ */ Modified: head/sys/mips/include/cpufunc.h ============================================================================== --- head/sys/mips/include/cpufunc.h Fri Nov 18 09:12:26 2011 (r227657) +++ head/sys/mips/include/cpufunc.h Fri Nov 18 09:30:24 2011 (r227658) @@ -69,7 +69,7 @@ static __inline void mips_barrier(void) { -#ifdef CPU_CNMIPS +#if defined(CPU_CNMIPS) || defined(CPU_RMI) || defined(CPU_NLM) __asm __volatile("" : : : "memory"); #else __asm __volatile (".set noreorder\n\t" Modified: head/sys/mips/include/cpuregs.h ============================================================================== --- head/sys/mips/include/cpuregs.h Fri Nov 18 09:12:26 2011 (r227657) +++ head/sys/mips/include/cpuregs.h Fri Nov 18 09:30:24 2011 (r227658) @@ -200,6 +200,8 @@ /* CPU dependent mtc0 hazard hook */ #if defined(CPU_CNMIPS) || defined(CPU_RMI) #define COP0_SYNC +#elif defined(CPU_NLM) +#define COP0_SYNC .word 0xc0 /* ehb */ #elif defined(CPU_SB1) #define COP0_SYNC ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop #else