move clkstart macro into clock.c, where clock code is now
[unix-history] / usr / src / sys / vax / include / clock.h
CommitLineData
d21d4302 1/* clock.h 4.8 82/10/31 */
dc9546ae
BJ
2
3/*
4 * VAX clock registers
5 */
6
dd259ba3
BJ
7#define ICCS_RUN 0x00000001
8#define ICCS_TRANS 0x00000010
9#define ICCS_SS 0x00000020
10#define ICCS_IE 0x00000040
11#define ICCS_INT 0x00000080
dc9546ae
BJ
12#define ICCS_ERR 0x80000000
13
93359143
BJ
14#define SECDAY ((unsigned)(24*60*60)) /* seconds per day */
15#define SECYR ((unsigned)(365*SECDAY)) /* per common year */
16/*
17 * TODRZERO is the what the TODR should contain when the ``year'' begins.
18 * The TODR should always contain a number between 0 and SECYR+SECDAY.
19 */
20#define TODRZERO ((unsigned)(1<<28))
21
22#define YRREF 1970
768f552e 23#define LEAPYEAR(year) ((year)%4==0) /* good till time becomes negative */
93359143
BJ
24
25/*
d21d4302 26 * Has the time-of-day clock wrapped around?
93359143 27 */
93359143 28#define clkwrap() (((unsigned)mfpr(TODR) - TODRZERO)/100 > SECYR+SECDAY)
546011e3
BJ
29
30/*
17e0f483
BJ
31 * Software clock is software interrupt level 8,
32 * implemented as mtpr(SIRR, 0x8) in asm.sed.
546011e3 33 */