Module Name:    src
Committed By:   rin
Date:           Mon Dec 26 21:25:08 UTC 2016

Modified Files:
        src/sys/arch/powerpc/ibm4xx: ibm4xx_machdep.c

Log Message:
Assert that the size of a trap handler does not exceed its room.

XXX
The debug exception is critical for ibm4xx. Since rev 1.24, we use the critical
trap hundler for it. Sorry for the wrong commit log for rev 1.24.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c

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/powerpc/ibm4xx/ibm4xx_machdep.c
diff -u src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c:1.24 src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c:1.25
--- src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c:1.24	Mon Dec 26 20:28:00 2016
+++ src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c	Mon Dec 26 21:25:08 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibm4xx_machdep.c,v 1.24 2016/12/26 20:28:00 rin Exp $	*/
+/*	$NetBSD: ibm4xx_machdep.c,v 1.25 2016/12/26 21:25:08 rin Exp $	*/
 /*	Original: ibm40x_machdep.c,v 1.3 2005/01/17 17:19:36 shige Exp $ */
 
 /*
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ibm4xx_machdep.c,v 1.24 2016/12/26 20:28:00 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibm4xx_machdep.c,v 1.25 2016/12/26 21:25:08 rin Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -193,6 +193,7 @@ ibm4xx_init(vaddr_t startkernel, vaddr_t
 	}
 
 	for (size_t i = 0; i < __arraycount(trap_table); i++) {
+		KASSERT(trap_table[i].exc_size <= 0x100);
 		trap_copy(trap_table[i].exc_addr, trap_table[i].exc_vector,
 		    trap_table[i].exc_size);
 	}

Reply via email to