xref: /freebsd/share/man/man4/attimer.4 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
174f3a46aSAlexander Motin.\" Copyright (c) 2010 Alexander Motin <mav@FreeBSD.org>
274f3a46aSAlexander Motin.\" All rights reserved.
374f3a46aSAlexander Motin.\"
474f3a46aSAlexander Motin.\" Redistribution and use in source and binary forms, with or without
574f3a46aSAlexander Motin.\" modification, are permitted provided that the following conditions
674f3a46aSAlexander Motin.\" are met:
774f3a46aSAlexander Motin.\" 1. Redistributions of source code must retain the above copyright
874f3a46aSAlexander Motin.\"    notice, this list of conditions and the following disclaimer.
974f3a46aSAlexander Motin.\" 2. Redistributions in binary form must reproduce the above copyright
1074f3a46aSAlexander Motin.\"    notice, this list of conditions and the following disclaimer in the
1174f3a46aSAlexander Motin.\"    documentation and/or other materials provided with the distribution.
1274f3a46aSAlexander Motin.\"
1374f3a46aSAlexander Motin.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1474f3a46aSAlexander Motin.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1574f3a46aSAlexander Motin.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1674f3a46aSAlexander Motin.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1774f3a46aSAlexander Motin.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1874f3a46aSAlexander Motin.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1974f3a46aSAlexander Motin.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2074f3a46aSAlexander Motin.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2174f3a46aSAlexander Motin.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2274f3a46aSAlexander Motin.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2374f3a46aSAlexander Motin.\" SUCH DAMAGE.
2474f3a46aSAlexander Motin.\"
25*9bb8172bSChristian Brueffer.Dd May 26, 2014
26a6d11f71SRuslan Ermilov.Dt ATTIMER 4
2774f3a46aSAlexander Motin.Os
2874f3a46aSAlexander Motin.Sh NAME
2974f3a46aSAlexander Motin.Nm attimer
3074f3a46aSAlexander Motin.Nd i8254 Programmable Interval Timer (AT Timer) driver
3174f3a46aSAlexander Motin.Sh SYNOPSIS
3274f3a46aSAlexander MotinThis driver is a mandatory part of x86 kernels.
3374f3a46aSAlexander Motin.Pp
3474f3a46aSAlexander MotinThe following tunables are settable from the
3574f3a46aSAlexander Motin.Xr loader 8 :
3674f3a46aSAlexander Motin.Bl -ohang
3774f3a46aSAlexander Motin.It Va hint.attimer. Ns Ar X Ns Va .clock
38*9bb8172bSChristian Brueffercontrols support for the event timer functionality.
39*9bb8172bSChristian BruefferSetting this value to
40*9bb8172bSChristian Brueffer.Dv 0
41*9bb8172bSChristian Bruefferdisables it.
42*9bb8172bSChristian BruefferThe default value is
43*9bb8172bSChristian Brueffer.Dv 1 .
4474f3a46aSAlexander Motin.It Va hint.attimer. Ns Ar X Ns Va .timecounter
45*9bb8172bSChristian Brueffercontrols support for the time counter functionality.
46*9bb8172bSChristian BruefferSetting this value to
47*9bb8172bSChristian Brueffer.Dv 0
48*9bb8172bSChristian Bruefferdisables it.
49*9bb8172bSChristian BruefferThe default value is
50*9bb8172bSChristian Brueffer.Dv 1 .
5176a6875bSAlexander Motin.It Va hw.i8254.freq
52*9bb8172bSChristian Bruefferallows overriding the default counter frequency.
53*9bb8172bSChristian BruefferThe same value is also available at run-time via the
5476a6875bSAlexander Motin.Va machdep.i8254_freq
5576a6875bSAlexander Motinsysctl.
5674f3a46aSAlexander Motin.El
5774f3a46aSAlexander Motin.Sh DESCRIPTION
5874f3a46aSAlexander MotinThis driver uses i8254 Programmable Interval Timer (AT Timer) hardware
59*9bb8172bSChristian Bruefferto supply the kernel with one timecounter and one event timer, and to generate
60*9bb8172bSChristian Brueffersound tones for the system speaker.
6174f3a46aSAlexander MotinThis hardware includes three channels.
62*9bb8172bSChristian BruefferEach channel includes a 16 bit counter which decreases with a known,
6374f3a46aSAlexander Motinplatform-dependent frequency.
6474f3a46aSAlexander MotinCounters can operate in several different modes, including periodic and
6574f3a46aSAlexander Motinone-shot.
66*9bb8172bSChristian BruefferThe output of each channel has platform-defined wiring: one channel is wired
6774f3a46aSAlexander Motinto the interrupt controller and may be used as event timer, one channel is
68*9bb8172bSChristian Bruefferwired to the speaker and used to generate sound tones, and one timer is reserved
6974f3a46aSAlexander Motinfor platform purposes.
7074f3a46aSAlexander Motin.Pp
71*9bb8172bSChristian BruefferThe
72*9bb8172bSChristian Brueffer.Nm
73*9bb8172bSChristian Bruefferdriver uses a single hardware channel to provide both time counter and event
7474f3a46aSAlexander Motintimer functionality.
75*9bb8172bSChristian BruefferTo make this possible, the respective counter must be running in periodic mode.
76*9bb8172bSChristian BruefferAs a result, the one-shot event timer mode is supported only when time counter
7774f3a46aSAlexander Motinfunctionality is disabled.
7874f3a46aSAlexander Motin.Pp
79*9bb8172bSChristian BruefferThe event timer provided by the driver is irrelevant to CPU power states.
8074f3a46aSAlexander Motin.Sh SEE ALSO
8173889c80SAlexander Motin.Xr apic 4 ,
82c45456fbSAlexander Motin.Xr atrtc 4 ,
8373889c80SAlexander Motin.Xr eventtimers 4 ,
842a6be868SAlexander Motin.Xr hpet 4 ,
852a6be868SAlexander Motin.Xr timecounters 4
86