Date: Tue, 13 Jul 2010 12:46:06 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r209990 - in head/sys: dev/acpica x86/isa x86/x86 Message-ID: <201007131246.o6DCk6Yq027768@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Tue Jul 13 12:46:06 2010 New Revision: 209990 URL: http://svn.freebsd.org/changeset/base/209990 Log: 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. Modified: head/sys/dev/acpica/acpi_hpet.c head/sys/x86/isa/atrtc.c head/sys/x86/isa/clock.c head/sys/x86/x86/local_apic.c head/sys/x86/x86/timeevents.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Tue Jul 13 11:04:46 2010 (r209989) +++ head/sys/dev/acpica/acpi_hpet.c Tue Jul 13 12:46:06 2010 (r209990) @@ -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); } Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Tue Jul 13 11:04:46 2010 (r209989) +++ head/sys/x86/isa/atrtc.c Tue Jul 13 12:46:06 2010 (r209990) @@ -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); } Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Tue Jul 13 11:04:46 2010 (r209989) +++ head/sys/x86/isa/clock.c Tue Jul 13 12:46:06 2010 (r209990) @@ -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 */ Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Tue Jul 13 11:04:46 2010 (r209989) +++ head/sys/x86/x86/local_apic.c Tue Jul 13 12:46:06 2010 (r209990) @@ -802,8 +802,7 @@ lapic_handle_timer(struct trapframe *fra 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(); Modified: head/sys/x86/x86/timeevents.c ============================================================================== --- head/sys/x86/x86/timeevents.c Tue Jul 13 11:04:46 2010 (r209989) +++ head/sys/x86/x86/timeevents.c Tue Jul 13 12:46:06 2010 (r209990) @@ -165,7 +165,7 @@ timer1cb(struct eventtimer *et, void *ar } } } - hardclockhandler((struct trapframe *)arg); + hardclockhandler(curthread->td_intr_frame); } /* timer2 callback. */ @@ -188,7 +188,7 @@ timer2cb(struct eventtimer *et, void *ar } } } - statclockhandler((struct trapframe *)arg); + statclockhandler(curthread->td_intr_frame); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007131246.o6DCk6Yq027768>