Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/powerpc/ibm4xx Invoke hardclock() and statclock() i...



details:   https://anonhg.NetBSD.org/src/rev/da5c1db60291
branches:  trunk
changeset: 958743:da5c1db60291
user:      rin <rin%NetBSD.org@localhost>
date:      Mon Jan 18 04:35:04 2021 +0000

description:
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.

diffstat:

 sys/arch/powerpc/ibm4xx/clock.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (42 lines):

diff -r 871ec07a4165 -r da5c1db60291 sys/arch/powerpc/ibm4xx/clock.c
--- a/sys/arch/powerpc/ibm4xx/clock.c   Mon Jan 18 04:30:12 2021 +0000
+++ b/sys/arch/powerpc/ibm4xx/clock.c   Mon Jan 18 04:35:04 2021 +0000
@@ -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 @@
         */
        __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 @@
                /*
                 * Do standard timer interrupt stuff.
                 */
+               ci->ci_idepth++;
                while (nticks-- > 0)
                        hardclock(frame);
+               ci->ci_idepth--;
        }
        splx(pcpl);
 }



Home | Main Index | Thread Index | Old Index