set_hardware_timer() would sometimes (on boot) pass a negative timeout to

arch_timer_set_hardware_timer(). This was harmless, at least with our
current x86 timers implementation, since they checked for minimum timeouts.
Very small cleanup (now that the file is compiled as C++).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35505 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2010-02-17 09:12:43 +00:00
parent 202a4e9c1e
commit 03bab65450

View File

@ -147,8 +147,11 @@ timer_interrupt()
// setup the next hardware timer
if (cpuData.events != NULL) {
arch_timer_set_hardware_timer(
(bigtime_t)cpuData.events->schedule_time - system_time());
bigtime_t timeout = (bigtime_t)cpuData.events->schedule_time
- system_time();
if (timeout <= 0)
timeout = 1;
arch_timer_set_hardware_timer(timeout);
}
release_spinlock(spinlock);