xref: /csrg-svn/sys/tahoe/include/clock.h (revision 34407)
1*34407Skarels /*
2*34407Skarels  * Copyright (c) 1988 Regents of the University of California.
3*34407Skarels  * All rights reserved.
4*34407Skarels  *
5*34407Skarels  * Redistribution and use in source and binary forms are permitted
6*34407Skarels  * provided that this notice is preserved and that due credit is given
7*34407Skarels  * to the University of California at Berkeley. The name of the University
8*34407Skarels  * may not be used to endorse or promote products derived from this
9*34407Skarels  * software without specific prior written permission. This software
10*34407Skarels  * is provided ``as is'' without express or implied warranty.
11*34407Skarels  *
12*34407Skarels  *	@(#)clock.h	7.1 (Berkeley) 05/21/88
13*34407Skarels  */
1424011Ssam 
1524011Ssam #define	SECDAY		((unsigned)(24*60*60))		/* seconds per day */
1624011Ssam #define	SECYR		((unsigned)(365*SECDAY))	/* per common year */
1724011Ssam 
1824011Ssam #define	YRREF		1970
1924011Ssam #define	LEAPYEAR(year)	((year)%4==0)	/* good till time becomes negative */
2024011Ssam 
2124011Ssam /*
2224011Ssam  * Software clock is software interrupt level 8
2324011Ssam  */
2425678Ssam #define	setsoftclock()	mtpr(SIRR, 0x8)
2530257Ssam 
2630257Ssam /*
2730257Ssam  * To calculate value for interval timer register, we
2830257Ssam  * use the fact that 20512 yields a 60hz clock.
2930257Ssam  */
3030257Ssam #define	hztocount(v)	((20512*60) / (v))
31