1/*
2 * Copyright 2005, Broadcom Corporation
3 * All Rights Reserved.
4 *
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.
9 *
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.
14 *
15 * $Id: bcmtimer.h,v 1.1.1.1 2008/10/15 03:31:22 james26_jang Exp $
16 */
17#ifndef __bcmtimer_h__
18#define __bcmtimer_h__
19
20/* ANSI headers */
21#include <time.h>
22
23/* timer ID */
24typedef unsigned int bcm_timer_module_id;
25typedef unsigned int bcm_timer_id;
26
27/* timer callback */
28typedef void (*bcm_timer_cb)(bcm_timer_id id, int data);
29
30/* OS-independant interfaces, applications should call these functions only */
31int bcm_timer_module_init(int timer_entries, bcm_timer_module_id *module_id);
32int bcm_timer_module_cleanup(bcm_timer_module_id module_id);
33int bcm_timer_module_enable(bcm_timer_module_id module_id, int enable);
34int bcm_timer_create(bcm_timer_module_id module_id, bcm_timer_id *timer_id);
35int bcm_timer_delete(bcm_timer_id timer_id);
36int bcm_timer_gettime(bcm_timer_id timer_id, struct itimerspec *value);
37int bcm_timer_settime(bcm_timer_id timer_id, const struct itimerspec *value);
38int bcm_timer_connect(bcm_timer_id timer_id, bcm_timer_cb func, int data);
39int bcm_timer_cancel(bcm_timer_id timer_id);
40int bcm_timer_change_expirytime(bcm_timer_id timer_id, const struct itimerspec *timer_spec);
41
42#endif	/* #ifndef __bcmtimer_h__ */
43