summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>1998-11-23 09:34:19 +0000
committersos <sos@FreeBSD.org>1998-11-23 09:34:19 +0000
commitba9fb96ddbb30995e96142bf949ea174ab702ba0 (patch)
tree972fafcbaab2596e94127ada4dc8873f104c3d44
parente3a7f015db577ee58099f8dc8ed658ddd394704d (diff)
downloadFreeBSD-src-ba9fb96ddbb30995e96142bf949ea174ab702ba0.zip
FreeBSD-src-ba9fb96ddbb30995e96142bf949ea174ab702ba0.tar.gz
Add a kludge to prevent panicing when using VM86 and hitting here
with a NULL curproc. Originally by: Tor Egge (IIRC)
-rw-r--r--sys/kern/kern_clock.c4
-rw-r--r--sys/kern/kern_tc.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index 00c75ed..c712245 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* @(#)kern_clock.c 8.5 (Berkeley) 1/21/94
- * $Id: kern_clock.c,v 1.82 1998/10/25 17:44:50 phk Exp $
+ * $Id: kern_clock.c,v 1.83 1998/10/26 06:13:18 bde Exp $
*/
#include <sys/param.h>
@@ -363,7 +363,7 @@ statclock(frame)
struct rusage *ru;
struct vmspace *vm;
- if (CLKF_USERMODE(frame)) {
+ if (curproc != NULL && CLKF_USERMODE(frame)) {
p = curproc;
if (p->p_flag & P_PROFIL)
addupc_intr(p, CLKF_PC(frame), 1);
diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c
index 00c75ed..c712245 100644
--- a/sys/kern/kern_tc.c
+++ b/sys/kern/kern_tc.c
@@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* @(#)kern_clock.c 8.5 (Berkeley) 1/21/94
- * $Id: kern_clock.c,v 1.82 1998/10/25 17:44:50 phk Exp $
+ * $Id: kern_clock.c,v 1.83 1998/10/26 06:13:18 bde Exp $
*/
#include <sys/param.h>
@@ -363,7 +363,7 @@ statclock(frame)
struct rusage *ru;
struct vmspace *vm;
- if (CLKF_USERMODE(frame)) {
+ if (curproc != NULL && CLKF_USERMODE(frame)) {
p = curproc;
if (p->p_flag & P_PROFIL)
addupc_intr(p, CLKF_PC(frame), 1);
OpenPOWER on IntegriCloud