-#define YRREF 1970 /* reference year for time */
-#define SECHR (60*60) /* seconds/hr */
-#define SECDAY (24*SECHR) /* seconds/day */
-#define SECYR (365*SECDAY) /* seconds/common year */
+/*
+ * Start a 60 HZ clock.
+ */
+#define clkstart() {\
+ mtpr(NICR, -16667); /* 16.667 milli-seconds */\
+ mtpr(ICCS, ICCS_RUN+ICCS_IE+ICCS_TRANS+ICCS_INT+ICCS_ERR);\
+}
+#define clkreld() mtpr(ICCS, ICCS_RUN+ICCS_IE+ICCS_INT+ICCS_ERR)
+
+#define clkwrap() (((unsigned)mfpr(TODR) - TODRZERO)/100 > SECYR+SECDAY)
+
+/*
+ * Software clock is software interrupt level 8
+ */
+#define setsoftclock() mtpr(SIRR, 0x8)