xref: /original-bsd/sys/tahoe/include/clock.h (revision 621c8870)
1 /*
2  * Copyright (c) 1988 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)clock.h	7.3 (Berkeley) 06/28/90
8  */
9 
10 #define	SECDAY		((unsigned)(24*60*60))		/* seconds per day */
11 #define	SECYR		((unsigned)(365*SECDAY))	/* per common year */
12 
13 #define	YRREF		1970
14 #define	LEAPYEAR(year)	((year)%4==0)	/* good till time becomes negative */
15 
16 /*
17  * Software clock is software interrupt level 8
18  */
19 #define	setsoftclock()	mtpr(SIRR, 0x8)
20 
21 /*
22  * To calculate value for interval timer register, we
23  * use the fact that 20512 yields a 60hz clock.
24  */
25 #define	hztocount(v)	((20512*60) / (v))
26