Module Name:    src
Committed By:   matt
Date:           Wed Dec 29 00:41:54 UTC 2010

Modified Files:
        src/sys/arch/mips/mips [matt-nb5-mips64]: spl.S

Log Message:
Add a PARANOIA test to splx to verify the SPL is within range.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.9 -r1.1.2.10 src/sys/arch/mips/mips/spl.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/mips/spl.S
diff -u src/sys/arch/mips/mips/spl.S:1.1.2.9 src/sys/arch/mips/mips/spl.S:1.1.2.10
--- src/sys/arch/mips/mips/spl.S:1.1.2.9	Fri Dec 24 07:13:19 2010
+++ src/sys/arch/mips/mips/spl.S	Wed Dec 29 00:41:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: spl.S,v 1.1.2.9 2010/12/24 07:13:19 matt Exp $	*/
+/*	$NetBSD: spl.S,v 1.1.2.10 2010/12/29 00:41:54 matt Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #include <mips/asm.h>
 #include <mips/cpuregs.h>
 
-RCSID("$NetBSD: spl.S,v 1.1.2.9 2010/12/24 07:13:19 matt Exp $")
+RCSID("$NetBSD: spl.S,v 1.1.2.10 2010/12/29 00:41:54 matt Exp $")
 
 #include "assym.h"
 
@@ -111,6 +111,11 @@
 
 STATIC_LEAF(_splsw_splx)
 STATIC_XLEAF(_splsw_splx_noprof)		# does not get mcount hooks
+#ifdef PARANOIA
+	sltiu	v0, a0, IPL_HIGH+1		# v0 = a0 <= IPL_HIGH
+98:	beqz	v0, 98b
+	 nop
+#endif
 	PTR_L	a3, L_CPU(MIPS_CURLWP)		# get cpu_info
 	NOP_L					# load delay
 	INT_L	a2, CPU_INFO_CPL(a3)		# get IPL from cpu_info

Reply via email to