xref: /freebsd/sys/kern/clock_if.m (revision d7f7792edf3d6c99fe5bc5db110533495f5c0b46)
1d7f7792eSThomas Moestl# Copyright (c) 2001 by Thomas Moestl <tmm@FreeBSD.org>.
2d7f7792eSThomas Moestl# All rights reserved.
3d7f7792eSThomas Moestl#
4d7f7792eSThomas Moestl# Redistribution and use in source and binary forms, with or without
5d7f7792eSThomas Moestl# modification, are permitted provided that the following conditions
6d7f7792eSThomas Moestl# are met:
7d7f7792eSThomas Moestl# 1. Redistributions of source code must retain the above copyright
8d7f7792eSThomas Moestl#    notice, this list of conditions and the following disclaimer.
9d7f7792eSThomas Moestl# 2. Redistributions in binary form must reproduce the above copyright
10d7f7792eSThomas Moestl#    notice, this list of conditions and the following disclaimer in the
11d7f7792eSThomas Moestl#    documentation and/or other materials provided with the distribution.
12d7f7792eSThomas Moestl#
13d7f7792eSThomas Moestl# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14d7f7792eSThomas Moestl# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15d7f7792eSThomas Moestl# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16d7f7792eSThomas Moestl# IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
17d7f7792eSThomas Moestl# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18d7f7792eSThomas Moestl# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19d7f7792eSThomas Moestl# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
20d7f7792eSThomas Moestl# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21d7f7792eSThomas Moestl# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
22d7f7792eSThomas Moestl# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23d7f7792eSThomas Moestl#
24d7f7792eSThomas Moestl# $FreeBSD$
25d7f7792eSThomas Moestl
26d7f7792eSThomas Moestl#include <sys/bus.h>
27d7f7792eSThomas Moestl#include <sys/time.h>
28d7f7792eSThomas Moestl
29d7f7792eSThomas MoestlINTERFACE clock;
30d7f7792eSThomas Moestl
31d7f7792eSThomas Moestl# Interface for clock drivers. This is inspired by the NetBSD device-independent
32d7f7792eSThomas Moestl# clock code (by Gordon W. Ross).
33d7f7792eSThomas Moestl
34d7f7792eSThomas Moestl# An EINVAL error return from this call signifies that the clock has an illegal
35d7f7792eSThomas Moestl# setting.
36d7f7792eSThomas MoestlMETHOD int gettime {
37d7f7792eSThomas Moestl	device_t dev;
38d7f7792eSThomas Moestl	struct timespec *ts;
39d7f7792eSThomas Moestl};
40d7f7792eSThomas Moestl
41d7f7792eSThomas MoestlMETHOD int settime {
42d7f7792eSThomas Moestl	device_t dev;
43d7f7792eSThomas Moestl	struct timespec *ts;
44d7f7792eSThomas Moestl};
45