| 1 | /* clock.h 4.8 82/10/31 */ |
| 2 | |
| 3 | /* |
| 4 | * VAX clock registers |
| 5 | */ |
| 6 | |
| 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 |
| 12 | #define ICCS_ERR 0x80000000 |
| 13 | |
| 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 |
| 23 | #define LEAPYEAR(year) ((year)%4==0) /* good till time becomes negative */ |
| 24 | |
| 25 | /* |
| 26 | * Has the time-of-day clock wrapped around? |
| 27 | */ |
| 28 | #define clkwrap() (((unsigned)mfpr(TODR) - TODRZERO)/100 > SECYR+SECDAY) |
| 29 | |
| 30 | /* |
| 31 | * Software clock is software interrupt level 8, |
| 32 | * implemented as mtpr(SIRR, 0x8) in asm.sed. |
| 33 | */ |