clockvar.h revision 1.1
11.1Scgd/* $NetBSD: clockvar.h,v 1.1 1995/06/28 02:44:59 cgd Exp $ */ 21.1Scgd 31.1Scgd/* 41.1Scgd * Copyright (c) 1994, 1995 Carnegie-Mellon University. 51.1Scgd * All rights reserved. 61.1Scgd * 71.1Scgd * Author: Chris G. Demetriou 81.1Scgd * 91.1Scgd * Permission to use, copy, modify and distribute this software and 101.1Scgd * its documentation is hereby granted, provided that both the copyright 111.1Scgd * notice and this permission notice appear in all copies of the 121.1Scgd * software, derivative works or modified versions, and any portions 131.1Scgd * thereof, and that both notices appear in supporting documentation. 141.1Scgd * 151.1Scgd * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 161.1Scgd * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 171.1Scgd * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 181.1Scgd * 191.1Scgd * Carnegie Mellon requests users of this software to return to 201.1Scgd * 211.1Scgd * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 221.1Scgd * School of Computer Science 231.1Scgd * Carnegie Mellon University 241.1Scgd * Pittsburgh PA 15213-3890 251.1Scgd * 261.1Scgd * any improvements or extensions that they make and grant Carnegie the 271.1Scgd * rights to redistribute these changes. 281.1Scgd */ 291.1Scgd 301.1Scgd/* 311.1Scgd * Definitions for "cpu-independent" clock handling for the alpha. 321.1Scgd */ 331.1Scgd 341.1Scgd/* 351.1Scgd * clocktime structure: 361.1Scgd * 371.1Scgd * structure passed to TOY clocks when setting them. broken out this 381.1Scgd * way, so that the time_t -> field conversion can be shared. 391.1Scgd */ 401.1Scgdstruct clocktime { 411.1Scgd int year; /* year - 1900 */ 421.1Scgd int mon; /* month (1 - 12) */ 431.1Scgd int day; /* day (1 - 31) */ 441.1Scgd int hour; /* hour (0 - 23) */ 451.1Scgd int min; /* minute (0 - 59) */ 461.1Scgd int sec; /* second (0 - 59) */ 471.1Scgd int dow; /* day of week (0 - 6; 0 = Sunday) */ 481.1Scgd}; 491.1Scgd 501.1Scgd/* 511.1Scgd * clockdesc structure: 521.1Scgd * 531.1Scgd * provides clock-specific functions to do necessary operations. 541.1Scgd */ 551.1Scgdstruct clock_softc { 561.1Scgd struct device sc_dev; 571.1Scgd 581.1Scgd /* 591.1Scgd * The functions that all types of clock provide. 601.1Scgd */ 611.1Scgd void (*sc_attach) __P((struct device *parent, struct device *self, 621.1Scgd void *aux)); 631.1Scgd void (*sc_init) __P((struct clock_softc *csc)); 641.1Scgd void (*sc_get) __P((struct clock_softc *csc, time_t base, 651.1Scgd struct clocktime *ct)); 661.1Scgd void (*sc_set) __P((struct clock_softc *csc, struct clocktime *ct)); 671.1Scgd 681.1Scgd /* 691.1Scgd * Private storage for particular clock types. 701.1Scgd */ 711.1Scgd void *sc_data; 721.1Scgd 731.1Scgd /* 741.1Scgd * Has the time been initialized? 751.1Scgd */ 761.1Scgd int sc_initted; 771.1Scgd}; 78