Rise knowledge about curthread->td_intr_frame by one step. Make timer

callback argument really opaque. Not repeat interrupt handler's problem
in case somebody will ever need to have both argument and frame.
This commit is contained in:
mav 2010-07-13 12:46:06 +00:00
parent 26b45a7863
commit b076092fdd
5 changed files with 9 additions and 17 deletions

View File

@ -216,10 +216,8 @@ hpet_intr_single(void *arg)
} else if (t->mode == 2)
t->mode = 0;
mt = (t->pcpu_master < 0) ? t : &sc->t[t->pcpu_master];
if (mt->et.et_active) {
mt->et.et_event_cb(&mt->et,
mt->et.et_arg ? mt->et.et_arg : curthread->td_intr_frame);
}
if (mt->et.et_active)
mt->et.et_event_cb(&mt->et, mt->et.et_arg);
return (FILTER_HANDLED);
}

View File

@ -209,11 +209,8 @@ rtc_intr(void *arg)
while (rtcin(RTC_INTR) & RTCIR_PERIOD) {
flag = 1;
if (sc->et.et_active) {
sc->et.et_event_cb(&sc->et,
sc->et.et_arg ? sc->et.et_arg :
curthread->td_intr_frame);
}
if (sc->et.et_active)
sc->et.et_event_cb(&sc->et, sc->et.et_arg);
}
return(flag ? FILTER_HANDLED : FILTER_STRAY);
}

View File

@ -148,10 +148,8 @@ clkintr(void *arg)
mtx_unlock_spin(&clock_lock);
}
if (sc && sc->et.et_active) {
sc->et.et_event_cb(&sc->et,
sc->et.et_arg ? sc->et.et_arg : curthread->td_intr_frame);
}
if (sc && sc->et.et_active)
sc->et.et_event_cb(&sc->et, sc->et.et_arg);
#ifdef DEV_MCA
/* Reset clock interrupt by asserting bit 7 of port 0x61 */

View File

@ -802,8 +802,7 @@ lapic_handle_timer(struct trapframe *frame)
td = curthread;
oldframe = td->td_intr_frame;
td->td_intr_frame = frame;
lapic_et.et_event_cb(&lapic_et,
lapic_et.et_arg ? lapic_et.et_arg : frame);
lapic_et.et_event_cb(&lapic_et, lapic_et.et_arg);
td->td_intr_frame = oldframe;
}
critical_exit();

View File

@ -165,7 +165,7 @@ timer1cb(struct eventtimer *et, void *arg)
}
}
}
hardclockhandler((struct trapframe *)arg);
hardclockhandler(curthread->td_intr_frame);
}
/* timer2 callback. */
@ -188,7 +188,7 @@ timer2cb(struct eventtimer *et, void *arg)
}
}
}
statclockhandler((struct trapframe *)arg);
statclockhandler(curthread->td_intr_frame);
}
/*