xref: /original-bsd/sys/tahoe/include/clock.h (revision 092d9b4e)
1 /*
2  * Copyright (c) 1988 Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that this notice is preserved and that due credit is given
7  * to the University of California at Berkeley. The name of the University
8  * may not be used to endorse or promote products derived from this
9  * software without specific prior written permission. This software
10  * is provided ``as is'' without express or implied warranty.
11  *
12  *	@(#)clock.h	7.1 (Berkeley) 05/21/88
13  */
14 
15 #define	SECDAY		((unsigned)(24*60*60))		/* seconds per day */
16 #define	SECYR		((unsigned)(365*SECDAY))	/* per common year */
17 
18 #define	YRREF		1970
19 #define	LEAPYEAR(year)	((year)%4==0)	/* good till time becomes negative */
20 
21 /*
22  * Software clock is software interrupt level 8
23  */
24 #define	setsoftclock()	mtpr(SIRR, 0x8)
25 
26 /*
27  * To calculate value for interval timer register, we
28  * use the fact that 20512 yields a 60hz clock.
29  */
30 #define	hztocount(v)	((20512*60) / (v))
31