Date: Sat, 02 May 2009 15:38:08 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: mav@FreeBSD.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r191733 - in head/sys: amd64/isa isa Message-ID: <20090502.153808.-896932641.imp@bsdimp.com> In-Reply-To: <200905012143.n41Lh4uS054073@svn.freebsd.org> References: <200905012143.n41Lh4uS054073@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <200905012143.n41Lh4uS054073@svn.freebsd.org> Alexander Motin <mav@FreeBSD.org> writes: : Author: mav : Date: Fri May 1 21:43:04 2009 : New Revision: 191733 : URL: http://svn.freebsd.org/changeset/base/191733 : : Log: : Add resume methods to i8254 and atrtc devices. This likely obviates the need for pmtimer.c now. You might want to investigate... : Modified: : head/sys/amd64/isa/clock.c : head/sys/isa/atrtc.c Shouldn't there be one for i386 too? Warner : Modified: head/sys/amd64/isa/clock.c : ============================================================================== : --- head/sys/amd64/isa/clock.c Fri May 1 21:31:39 2009 (r191732) : +++ head/sys/amd64/isa/clock.c Fri May 1 21:43:04 2009 (r191733) : @@ -376,6 +376,17 @@ set_i8254_freq(u_int freq, int intr_freq : mtx_unlock_spin(&clock_lock); : } : : +static void : +i8254_restore(void) : +{ : + : + mtx_lock_spin(&clock_lock); : + outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT); : + outb(TIMER_CNTR0, i8254_real_max_count & 0xff); : + outb(TIMER_CNTR0, i8254_real_max_count >> 8); : + mtx_unlock_spin(&clock_lock); : +} : + : /* This is separate from startrtclock() so that it can be called early. */ : void : i8254_init(void) : @@ -558,6 +569,14 @@ attimer_attach(device_t dev) : return(0); : } : : +static int : +attimer_resume(device_t dev) : +{ : + : + i8254_restore(); : + return(0); : +} : + : static device_method_t attimer_methods[] = { : /* Device interface */ : DEVMETHOD(device_probe, attimer_probe), : @@ -565,7 +584,7 @@ static device_method_t attimer_methods[] : DEVMETHOD(device_detach, bus_generic_detach), : DEVMETHOD(device_shutdown, bus_generic_shutdown), : DEVMETHOD(device_suspend, bus_generic_suspend), : - DEVMETHOD(device_resume, bus_generic_resume), : + DEVMETHOD(device_resume, attimer_resume), : { 0, 0 } : }; : : : Modified: head/sys/isa/atrtc.c : ============================================================================== : --- head/sys/isa/atrtc.c Fri May 1 21:31:39 2009 (r191732) : +++ head/sys/isa/atrtc.c Fri May 1 21:43:04 2009 (r191733) : @@ -190,6 +190,13 @@ atrtc_attach(device_t dev) : return(0); : } : : +static int : +atrtc_resume(device_t dev) : +{ : + : + atrtc_restore(); : + return(0); : +} : : static int : atrtc_settime(device_t dev __unused, struct timespec *ts) : @@ -264,8 +271,7 @@ static device_method_t atrtc_methods[] = : DEVMETHOD(device_shutdown, bus_generic_shutdown), : DEVMETHOD(device_suspend, bus_generic_suspend), : /* XXX stop statclock? */ : - DEVMETHOD(device_resume, bus_generic_resume), : - /* XXX restart statclock? */ : + DEVMETHOD(device_resume, atrtc_resume), : : /* clock interface */ : DEVMETHOD(clock_gettime, atrtc_gettime), :
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090502.153808.-896932641.imp>