* Fix a sysclock_t comparison that was attempting to detect an overflow
by checking if an unsigned field was negative. The field has
to be cast to signed for the test to work as expected.
Reported-by: enjolras
*/
ttlticks = (cpbase - lp->lwp_cpbase) /
gd->gd_schedclock.periodic;
- if (ttlticks < 0) {
+ if ((ssysclock_t)ttlticks < 0) {
ttlticks = 0;
lp->lwp_cpbase = cpbase;
}
*/
ttlticks = (cpbase - lp->lwp_cpbase) /
gd->gd_schedclock.periodic;
- if (ttlticks < 0) {
+ if ((ssysclock_t)ttlticks < 0) {
ttlticks = 0;
lp->lwp_cpbase = cpbase;
}
struct intrframe;
typedef __uint32_t sysclock_t;
+typedef int32_t ssysclock_t;
typedef TAILQ_HEAD(systimerq, systimer) *systimerq_t;
typedef void (*systimer_func_t)(struct systimer *, int, struct intrframe *);