xref: /csrg-svn/sys/vax/include/clock.h (revision 8987)
1*8987Sroot /*	clock.h	4.8	82/10/31	*/
251Sbill 
351Sbill /*
451Sbill  * VAX clock registers
551Sbill  */
651Sbill 
72633Swnj #define	ICCS_RUN	0x00000001
82633Swnj #define	ICCS_TRANS	0x00000010
92633Swnj #define	ICCS_SS		0x00000020
102633Swnj #define	ICCS_IE		0x00000040
112633Swnj #define	ICCS_INT	0x00000080
1251Sbill #define	ICCS_ERR	0x80000000
1351Sbill 
14880Sbill #define	SECDAY		((unsigned)(24*60*60))		/* seconds per day */
15880Sbill #define	SECYR		((unsigned)(365*SECDAY))	/* per common year */
16880Sbill /*
17880Sbill  * TODRZERO is the what the TODR should contain when the ``year'' begins.
18880Sbill  * The TODR should always contain a number between 0 and SECYR+SECDAY.
19880Sbill  */
20880Sbill #define	TODRZERO	((unsigned)(1<<28))
2151Sbill 
22880Sbill #define	YRREF		1970
232307Swnj #define	LEAPYEAR(year)	((year)%4==0)	/* good till time becomes negative */
24880Sbill 
25880Sbill /*
26*8987Sroot  * Has the time-of-day clock wrapped around?
27880Sbill  */
28880Sbill #define	clkwrap()	(((unsigned)mfpr(TODR) - TODRZERO)/100 > SECYR+SECDAY)
292447Swnj 
302447Swnj /*
318050Sroot  * Software clock is software interrupt level 8,
328050Sroot  * implemented as mtpr(SIRR, 0x8) in asm.sed.
332447Swnj  */
34