Module Name: src
Committed By: rin
Date: Mon Jan 18 04:35:05 UTC 2021
Modified Files:
src/sys/arch/powerpc/ibm4xx: clock.c
Log Message:
Invoke hardclock() and statclock() in the interrupt context.
Otherwise, entropy_enter() is used instead of entropy_enter_intr() in
statclock(), which results in KASSERT() failure.
To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/powerpc/ibm4xx/clock.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/clock.c
diff -u src/sys/arch/powerpc/ibm4xx/clock.c:1.30 src/sys/arch/powerpc/ibm4xx/clock.c:1.31
--- src/sys/arch/powerpc/ibm4xx/clock.c:1.30 Mon Jan 18 04:30:12 2021
+++ src/sys/arch/powerpc/ibm4xx/clock.c Mon Jan 18 04:35:04 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: clock.c,v 1.30 2021/01/18 04:30:12 rin Exp $ */
+/* $NetBSD: clock.c,v 1.31 2021/01/18 04:35:04 rin Exp $ */
/* $OpenBSD: clock.c,v 1.3 1997/10/13 13:42:53 pefo Exp $ */
/*
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.30 2021/01/18 04:30:12 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.31 2021/01/18 04:35:04 rin Exp $");
#ifdef _KERNEL_OPT
#include "opt_ppcarch.h"
@@ -104,8 +104,11 @@ stat_intr(struct clockframe *frame)
*/
__asm volatile ("wrteei 1");
- if (IPL_CLOCK > s)
+ if (IPL_CLOCK > s) {
+ ci->ci_idepth++;
statclock(frame);
+ ci->ci_idepth--;
+ }
splx(s);
}
@@ -156,8 +159,10 @@ decr_intr(struct clockframe *frame)
/*
* Do standard timer interrupt stuff.
*/
+ ci->ci_idepth++;
while (nticks-- > 0)
hardclock(frame);
+ ci->ci_idepth--;
}
splx(pcpl);
}