Module Name: src
Committed By: jmcneill
Date: Mon Sep 5 21:38:05 UTC 2011
Modified Files:
src/sys/arch/usermode/usermode: trap.c
Log Message:
adjust cpu_lwp_inkernel in mem access and illegal insn handlers
To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/usermode/usermode/trap.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/usermode/usermode/trap.c
diff -u src/sys/arch/usermode/usermode/trap.c:1.27 src/sys/arch/usermode/usermode/trap.c:1.28
--- src/sys/arch/usermode/usermode/trap.c:1.27 Mon Sep 5 18:50:34 2011
+++ src/sys/arch/usermode/usermode/trap.c Mon Sep 5 21:38:05 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.27 2011/09/05 18:50:34 reinoud Exp $ */
+/* $NetBSD: trap.c,v 1.28 2011/09/05 21:38:05 jmcneill Exp $ */
/*-
* Copyright (c) 2011 Reinoud Zandijk <[email protected]>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.27 2011/09/05 18:50:34 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.28 2011/09/05 21:38:05 jmcneill Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -48,6 +48,7 @@
//#include <machine/instr.h>
//#include <machine/userret.h>
+extern int cpu_lwp_inkernel;
/* forwards and externals */
void setup_signal_handlers(void);
@@ -117,6 +118,8 @@
void *onfault;
int kmem, lwp_errno, rv;
+ cpu_lwp_inkernel++;
+
recurse++;
if (recurse > 1)
printf("enter trap recursion level %d\n", recurse);
@@ -229,6 +232,7 @@
if (recurse > 1)
printf("leaving trap recursion level %d\n", recurse);
recurse--;
+ cpu_lwp_inkernel--;
}
static void
@@ -240,6 +244,7 @@
struct pcb *pcb;
vaddr_t va;
+ cpu_lwp_inkernel++;
recurse++;
if (recurse > 1)
printf("enter trap recursion level %d\n", recurse);
@@ -287,4 +292,5 @@
panic("illegal instruction encountered\n");
}
+ cpu_lwp_inkernel--;
}