Subject: Question about a probrem in evbppc/ev64260/clock.c
To: None <port-powerpc@netbsd.org>
From: Tomofumi Hayashi <s1061123@cronos.ocn.ne.jp>
List: port-powerpc
Date: 10/21/2005 14:05:20
Hi,

I have a question about "decr_intr(...)" in "evbppc/ev64260/clock.c".
In this file, value "lasttb" is updated in every time when it called, and
function "microtime(...)", it called by "hardclock(...)", is called only
in interrupts less than IPL_CLOCK.

It may be clock mismatch, because, during IPL_SCHED that is higher than 
IPL_CLOCK, only "ci->ci_lasttb" is updated, but other value is not updated.
In NetBSD/macppc, "clock.c" is changed, however, other PowerPC ports are not changed.

I don't have skills enough to assert it.
I'd like to have more opinion to assert it.

thanks.

Tomofumi Hayashi 

------------------------------ evbppc/ev64260/clock.c
void
decr_intr(struct clockframe *frame)
{
        struct cpu_info * const ci = curcpu();
        :
        :
        /*
         * lasttb is used during microtime. Set it to the virtual
         * start of this tick interval.
         */
        ci->ci_lasttb = tb + (decrtick - ticks_per_intr); // (*1)

        :
        :
        if (ci->ci_cpl >= IPL_CLOCK) {
                /*
                 * we interrupted while at higher
                 * priority, so defer this tick.
                 */
                ci->ci_tickspending += nticks;
                EXT_INTR_STATS_PEND_IRQ(SIR_HWCLOCK);
        } else {
                int oframepri;
                EXT_INTR_STATS_DECL(tstart);

                EXT_INTR_STATS_COMMIT_IRQ(SIR_HWCLOCK);
                EXT_INTR_STATS_PRE(SIR_HWCLOCK, tstart);

        // (*1) should be move to here ????

                nticks += ci->ci_tickspending;
                ci->ci_tickspending = 0;
                :
                :
                :

----------------------------------