Make algorithm a bit more bulletproof.

This commit is contained in:
Alexander Motin 2009-06-23 23:16:37 +00:00
parent 1946089b52
commit 9f23a6caa4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=194790
2 changed files with 4 additions and 4 deletions

View File

@ -169,7 +169,7 @@ clkintr(struct trapframe *frame)
#endif
hardclockintr(frame);
} else {
if (--pscnt == 0) {
if (--pscnt <= 0) {
pscnt = psratio;
#ifdef SMP
if (smp_started)
@ -262,7 +262,7 @@ rtcintr(struct trapframe *frame)
while (rtcin(RTC_INTR) & RTCIR_PERIOD) {
flag = 1;
if (--pscnt == 0) {
if (--pscnt <= 0) {
pscnt = psdiv;
#ifdef SMP
if (smp_started)

View File

@ -195,7 +195,7 @@ clkintr(struct trapframe *frame)
#endif
hardclockintr(frame);
} else {
if (--pscnt == 0) {
if (--pscnt <= 0) {
pscnt = psratio;
#ifdef SMP
if (smp_started)
@ -293,7 +293,7 @@ rtcintr(struct trapframe *frame)
while (rtcin(RTC_INTR) & RTCIR_PERIOD) {
flag = 1;
if (--pscnt == 0) {
if (--pscnt <= 0) {
pscnt = psdiv;
#ifdef SMP
if (smp_started)