134407Skarels /* 234407Skarels * Copyright (c) 1988 Regents of the University of California. 334407Skarels * All rights reserved. 434407Skarels * 5*44526Sbostic * %sccs.include.redist.c% 634407Skarels * 7*44526Sbostic * @(#)clock.h 7.3 (Berkeley) 06/28/90 834407Skarels */ 924011Ssam 1024011Ssam #define SECDAY ((unsigned)(24*60*60)) /* seconds per day */ 1124011Ssam #define SECYR ((unsigned)(365*SECDAY)) /* per common year */ 1224011Ssam 1324011Ssam #define YRREF 1970 1424011Ssam #define LEAPYEAR(year) ((year)%4==0) /* good till time becomes negative */ 1524011Ssam 1624011Ssam /* 1724011Ssam * Software clock is software interrupt level 8 1824011Ssam */ 1925678Ssam #define setsoftclock() mtpr(SIRR, 0x8) 2030257Ssam 2130257Ssam /* 2230257Ssam * To calculate value for interval timer register, we 2330257Ssam * use the fact that 20512 yields a 60hz clock. 2430257Ssam */ 2530257Ssam #define hztocount(v) ((20512*60) / (v)) 26