1/* 2 * Copyright 2010, Axel D��rfler, axeld@pinc-software.de. 3 * Copyright 2009, Colin G��nther, coling@gmx.de. 4 * Copyright 2007, Hugo Santos. All Rights Reserved. 5 * Distributed under the terms of the MIT License. 6 */ 7#ifndef _FBSD_COMPAT_SYS_CALLOUT_H_ 8#define _FBSD_COMPAT_SYS_CALLOUT_H_ 9 10 11#include <sys/haiku-module.h> 12#include <sys/_callout.h> 13 14 15#define CALLOUT_MPSAFE 0x0008 /* deprecated */ 16#define CALLOUT_RETURNUNLOCKED 0x0010 /* handler returns with mtx unlocked */ 17 18 19void callout_init(struct callout *c, int mpsafe); 20void callout_init_mtx(struct callout *c, struct mtx *mutex, int flags); 21int callout_schedule(struct callout *c, int _ticks); 22int callout_reset(struct callout *c, int _ticks, void (*func)(void *), void *arg); 23int callout_pending(struct callout *c); 24int callout_active(struct callout *c); 25 26#define callout_reset_on(c, to_ticks, fn, arg, cpu) \ 27 callout_reset(c, to_ticks, fn, arg) 28 29#define callout_drain(c) _callout_stop_safe(c, 1) 30#define callout_stop(c) _callout_stop_safe(c, 0) 31int _callout_stop_safe(struct callout *c, int safe); 32 33 34 35#endif /* _FBSD_COMPAT_SYS_CALLOUT_H_ */ 36