1*aa76beb5Smiod /* $OpenBSD: clockvar.h,v 1.1 2002/05/02 22:56:02 miod Exp $ */ 2*aa76beb5Smiod /* $NetBSD: clockvar.h,v 1.4 1997/06/22 08:02:18 jonathan Exp $ */ 3*aa76beb5Smiod 4*aa76beb5Smiod /* 5*aa76beb5Smiod * Copyright (c) 1994, 1995 Carnegie-Mellon University. 6*aa76beb5Smiod * All rights reserved. 7*aa76beb5Smiod * 8*aa76beb5Smiod * Author: Chris G. Demetriou 9*aa76beb5Smiod * 10*aa76beb5Smiod * Permission to use, copy, modify and distribute this software and 11*aa76beb5Smiod * its documentation is hereby granted, provided that both the copyright 12*aa76beb5Smiod * notice and this permission notice appear in all copies of the 13*aa76beb5Smiod * software, derivative works or modified versions, and any portions 14*aa76beb5Smiod * thereof, and that both notices appear in supporting documentation. 15*aa76beb5Smiod * 16*aa76beb5Smiod * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 17*aa76beb5Smiod * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 18*aa76beb5Smiod * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 19*aa76beb5Smiod * 20*aa76beb5Smiod * Carnegie Mellon requests users of this software to return to 21*aa76beb5Smiod * 22*aa76beb5Smiod * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 23*aa76beb5Smiod * School of Computer Science 24*aa76beb5Smiod * Carnegie Mellon University 25*aa76beb5Smiod * Pittsburgh PA 15213-3890 26*aa76beb5Smiod * 27*aa76beb5Smiod * any improvements or extensions that they make and grant Carnegie the 28*aa76beb5Smiod * rights to redistribute these changes. 29*aa76beb5Smiod */ 30*aa76beb5Smiod 31*aa76beb5Smiod /* 32*aa76beb5Smiod * Definitions for cpu-independent clock handling for the alpha and pmax. 33*aa76beb5Smiod */ 34*aa76beb5Smiod 35*aa76beb5Smiod /* 36*aa76beb5Smiod * clocktime structure: 37*aa76beb5Smiod * 38*aa76beb5Smiod * structure passed to TOY clocks when setting them. broken out this 39*aa76beb5Smiod * way, so that the time_t -> field conversion can be shared. 40*aa76beb5Smiod */ 41*aa76beb5Smiod struct clocktime { 42*aa76beb5Smiod int year; /* year - 1900 */ 43*aa76beb5Smiod int mon; /* month (1 - 12) */ 44*aa76beb5Smiod int day; /* day (1 - 31) */ 45*aa76beb5Smiod int hour; /* hour (0 - 23) */ 46*aa76beb5Smiod int min; /* minute (0 - 59) */ 47*aa76beb5Smiod int sec; /* second (0 - 59) */ 48*aa76beb5Smiod int dow; /* day of week (0 - 6; 0 = Sunday) */ 49*aa76beb5Smiod }; 50*aa76beb5Smiod 51*aa76beb5Smiod /* 52*aa76beb5Smiod * clockfns structure: 53*aa76beb5Smiod * 54*aa76beb5Smiod * function switch used by chip-independent clock code, to access 55*aa76beb5Smiod * chip-dependent routines. 56*aa76beb5Smiod */ 57*aa76beb5Smiod struct clockfns { 58*aa76beb5Smiod void (*cf_init)(struct device *); 59*aa76beb5Smiod void (*cf_get)(struct device *, time_t, struct clocktime *); 60*aa76beb5Smiod void (*cf_set)(struct device *, struct clocktime *); 61*aa76beb5Smiod }; 62*aa76beb5Smiod 63*aa76beb5Smiod void clockattach(struct device *, const struct clockfns *); 64