From owner-cvs-src@FreeBSD.ORG Wed Mar 26 20:09:22 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 618B8106564A; Wed, 26 Mar 2008 20:09:22 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 530378FC12; Wed, 26 Mar 2008 20:09:22 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m2QK9Mn5082270; Wed, 26 Mar 2008 20:09:22 GMT (envelope-from phk@repoman.freebsd.org) Received: (from phk@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m2QK9MAo082269; Wed, 26 Mar 2008 20:09:22 GMT (envelope-from phk) Message-Id: <200803262009.m2QK9MAo082269@repoman.freebsd.org> From: Poul-Henning Kamp Date: Wed, 26 Mar 2008 20:09:21 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/amd64/include clock.h timerreg.h src/sys/amd64/isa clock.c src/sys/dev/speaker spkr.c src/sys/dev/syscons syscons.c src/sys/i386/i386 trap.c src/sys/i386/include clock.h timerreg.h src/sys/i386/isa clock.c ... X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2008 20:09:22 -0000 phk 2008-03-26 20:09:21 UTC FreeBSD src repository Modified files: sys/amd64/include clock.h timerreg.h sys/amd64/isa clock.c sys/dev/speaker spkr.c sys/dev/syscons syscons.c sys/i386/i386 trap.c sys/i386/include clock.h timerreg.h sys/i386/isa clock.c sys/ia64/ia64 machdep.c sys/ia64/include clock.h sys/isa syscons_isa.c sys/kern tty_cons.c sys/pc98/cbus clock.c syscons_cbus.c sys/pc98/include clock.h timerreg.h sys/powerpc/aim clock.c sys/powerpc/booke clock.c sys/powerpc/include clock.h sys/sparc64/include clock.h sys/sparc64/sparc64 clock.c sys/sun4v/include clock.h sys/sys systm.h Log: The "free-lance" timer in the i8254 is only used for the speaker these days, so de-generalize the acquire_timer/release_timer api to just deal with speakers. The new (optional) MD functions are: timer_spkr_acquire() timer_spkr_release() and timer_spkr_setfreq() the last of which configures the timer to generate a tone of a given frequency, in Hz instead of 1/1193182th of seconds. Drop entirely timer2 on pc98, it is not used anywhere at all. Move sysbeep() to kern/tty_cons.c and use the timer_spkr*() if they exist, and do nothing otherwise. Remove prototypes and empty acquire-/release-timer() and sysbeep() functions from the non-beeping archs. This eliminate the need for the speaker driver to know about i8254frequency at all. In theory this makes the speaker driver MI, contingent on the timer_spkr_*() functions existing but the driver does not know this yet and still attaches to the ISA bus. Syscons is more tricky, in one function, sc_tone(), it knows the hz and things are just fine. In the other function, sc_bell() it seems to get the period from the KDMKTONE ioctl in terms if 1/1193182th second, so we hardcode the 1193182 and leave it at that. It's probably not important. Change a few other sysbeep() uses which obviously knew that the argument was in terms of i8254 frequency, and leave alone those that look like people thought sysbeep() took frequency in hertz. This eliminates the knowledge of i8254_freq from all but the actual clock.c code and the prof_machdep.c on amd64 and i386, where I think it would be smart to ask for help from the timecounters anyway [TBD]. Revision Changes Path 1.58 +5 -3 src/sys/amd64/include/clock.h 1.3 +0 -11 src/sys/amd64/include/timerreg.h 1.239 +18 -36 src/sys/amd64/isa/clock.c 1.74 +1 -4 src/sys/dev/speaker/spkr.c 1.459 +1 -1 src/sys/dev/syscons/syscons.c 1.313 +2 -2 src/sys/i386/i386/trap.c 1.60 +5 -3 src/sys/i386/include/clock.h 1.3 +0 -11 src/sys/i386/include/timerreg.h 1.244 +19 -36 src/sys/i386/isa/clock.c 1.234 +0 -6 src/sys/ia64/ia64/machdep.c 1.12 +0 -2 src/sys/ia64/include/clock.h 1.31 +1 -1 src/sys/isa/syscons_isa.c 1.143 +51 -0 src/sys/kern/tty_cons.c 1.165 +14 -63 src/sys/pc98/cbus/clock.c 1.26 +1 -1 src/sys/pc98/cbus/syscons_cbus.c 1.3 +0 -5 src/sys/pc98/include/clock.h 1.3 +0 -11 src/sys/pc98/include/timerreg.h 1.31 +0 -10 src/sys/powerpc/aim/clock.c 1.2 +0 -10 src/sys/powerpc/booke/clock.c 1.14 +0 -4 src/sys/powerpc/include/clock.h 1.8 +0 -2 src/sys/sparc64/include/clock.h 1.11 +0 -9 src/sys/sparc64/sparc64/clock.c 1.2 +0 -2 src/sys/sun4v/include/clock.h 1.265 +2 -0 src/sys/sys/systm.h