0001-callout-9-introduce-callout_reset_-m-s-similarly-to-.patch

C++, 03/20/2010 01:39 AM

Download (1.98 KB)

View differences:

sys/kern/kern_timeout.c
109 109
#include <sys/thread2.h>
110 110
#include <sys/mplock2.h>
111 111

  
112
#include <machine/limits.h>
113

  
112 114
#ifndef MAX_SOFTCLOCK_STEPS
113 115
#define MAX_SOFTCLOCK_STEPS 100 /* Maximum allowed value of steps. */
114 116
#endif
......
385 387
	crit_exit_gd(gd);
386 388
}
387 389

  
390
void
391
callout_reset_s(struct callout *c, int s, void (*ftn)(void *),
392
    void *arg)
393
{
394
	uintmax_t t;
395

  
396
	t = (uintmax_t)s * hz;
397
	if (t > INT_MAX)
398
		t = INT_MAX;
399
	callout_reset(c, t, ftn, arg);
400
}
401

  
402
void
403
callout_reset_ms(struct callout *c, int ms, void (*ftn)(void *),
404
    void *arg)
405
{
406
	uintmax_t t;
407

  
408
	t = (uintmax_t)ms * hz / 1000;
409
	if (t > INT_MAX)
410
		t = INT_MAX;
411
	callout_reset(c, t, ftn, arg);
412
}
413

  
388 414
/*
389 415
 * Stop a running timer.  WARNING!  If called on a cpu other then the one
390 416
 * the callout was started on this function will liveloop on its IPI to
sys/sys/callout.h
92 92
void	callout_init (struct callout *);
93 93
void	callout_init_mp (struct callout *);
94 94
void	callout_reset (struct callout *, int, void (*)(void *), void *);
95
void	callout_reset_s (struct callout *, int, void (*)(void *), void *);
96
void	callout_reset_ms (struct callout *, int, void (*)(void *), void *);
95 97
int	callout_stop (struct callout *);
96 98

  
97 99
#endif
98
-