2 * Copyright 2004, Broadcom Corporation
5 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
6 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
7 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
8 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
10 * Low resolution timer interface. Timer handlers may be called
11 * in a deferred manner in a different task context after the
12 * timer expires or in the task context from which the timer
13 * was created, depending on the implementation.
17 #ifndef __bcmtimer_h__
18 #define __bcmtimer_h__
24 typedef unsigned int bcm_timer_module_id
;
25 typedef unsigned int bcm_timer_id
;
28 typedef void (*bcm_timer_cb
)(bcm_timer_id id
, int data
);
30 /* OS-independant interfaces, applications should call these functions only */
31 int bcm_timer_module_init(int timer_entries
, bcm_timer_module_id
*module_id
);
32 int bcm_timer_module_cleanup(bcm_timer_module_id module_id
);
33 int bcm_timer_create(bcm_timer_module_id module_id
, bcm_timer_id
*timer_id
);
34 int bcm_timer_delete(bcm_timer_id timer_id
);
35 int bcm_timer_gettime(bcm_timer_id timer_id
, struct itimerspec
*value
);
36 int bcm_timer_settime(bcm_timer_id timer_id
, const struct itimerspec
*value
);
37 int bcm_timer_connect(bcm_timer_id timer_id
, bcm_timer_cb func
, int data
);
38 int bcm_timer_cancel(bcm_timer_id timer_id
);
40 #endif /* #ifndef __bcmtimer_h__ */