xref: /openbsd/share/man/man9/hardclock.9 (revision 952f302f)
1.\"	$OpenBSD: hardclock.9,v 1.13 2020/06/26 18:48:31 cheloha Exp $
2.\"
3.\" Copyright (c) 2001 Kenneth R Westerback
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer,
11.\"    without modification, immediately at the beginning of the file.
12.\" 2. The name of the author may not be used to endorse or promote products
13.\"    derived from this software without specific prior written permission.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18.\" IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
19.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21.\" SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
23.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
24.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25.\" THE POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd $Mdocdate: June 26 2020 $
28.Dt HARDCLOCK 9
29.Os
30.Sh NAME
31.Nm hardclock
32.Nd real-time system clock
33.Sh SYNOPSIS
34.In sys/systm.h
35.Ft void
36.Fo hardclock
37.Fa "struct clockframe *frame"
38.Fc
39.Sh DESCRIPTION
40.Fn hardclock
41implements the real-time system clock, interrupting
42.Xr hz 9
43times a second.
44The argument
45.Fa frame
46is an opaque, machine dependent structure that encapsulates the
47previous machine state.
48.Pp
49.Fn hardclock
50performs a variety of time related housekeeping tasks, such as:
51.Bl -bullet -offset indent
52.It
53If the current process has virtual or profiling interval
54timers, update the timers and deliver appropriate signals.
55.It
56If there is no separate statistics clock, execute
57.Fn statclock .
58.It
59Increment the time of day, implementing any adjustments requested by
60.Xr adjtime 2
61or required as a result of running an NTP daemon or other configured
62external clock.
63.It
64Update the real-time timeout queue, calling
65.Fn softclock
66directly if the current interrupt priority is low enough.
67.El
68.Sh CODE REFERENCES
69.Fn hardclock
70is implemented in the file
71.Pa sys/kern/kern_clock.c .
72.Sh SEE ALSO
73.Xr adjtime 2 ,
74.Xr hz 9 ,
75.Xr microtime 9 ,
76.Xr spl 9 ,
77.Xr timeout 9
78