19454b2d8SWarner Losh#- 2d7f7792eSThomas Moestl# Copyright (c) 2001 by Thomas Moestl <tmm@FreeBSD.org>. 3d7f7792eSThomas Moestl# All rights reserved. 4d7f7792eSThomas Moestl# 5d7f7792eSThomas Moestl# Redistribution and use in source and binary forms, with or without 6d7f7792eSThomas Moestl# modification, are permitted provided that the following conditions 7d7f7792eSThomas Moestl# are met: 8d7f7792eSThomas Moestl# 1. Redistributions of source code must retain the above copyright 9d7f7792eSThomas Moestl# notice, this list of conditions and the following disclaimer. 10d7f7792eSThomas Moestl# 2. Redistributions in binary form must reproduce the above copyright 11d7f7792eSThomas Moestl# notice, this list of conditions and the following disclaimer in the 12d7f7792eSThomas Moestl# documentation and/or other materials provided with the distribution. 13d7f7792eSThomas Moestl# 14d7f7792eSThomas Moestl# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15d7f7792eSThomas Moestl# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16d7f7792eSThomas Moestl# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17d7f7792eSThomas Moestl# IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 18d7f7792eSThomas Moestl# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19d7f7792eSThomas Moestl# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20d7f7792eSThomas Moestl# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21d7f7792eSThomas Moestl# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22d7f7792eSThomas Moestl# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 23d7f7792eSThomas Moestl# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24d7f7792eSThomas Moestl# 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