2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
26 * - timer source based on <kern/thread_call.h>
30 #ifndef _NET_DEVTIMER_H
31 #define _NET_DEVTIMER_H
33 #include <sys/types.h>
34 #include <sys/systm.h>
36 #define DEVTIMER_USECS_PER_SEC (1000 * 1000)
39 devtimer_process_func_event_lock
,
40 devtimer_process_func_event_unlock
,
42 typedef int devtimer_process_func_event
;
44 typedef struct devtimer_s
* devtimer_ref
;
45 typedef void (*devtimer_process_func
)(devtimer_ref timer
,
46 devtimer_process_func_event event
);
47 typedef void (*devtimer_timeout_func
)(void * arg0
, void * arg1
, void * arg2
);
50 devtimer_valid(devtimer_ref timer
);
53 devtimer_retain(devtimer_ref timer
);
56 devtimer_arg0(devtimer_ref timer
);
59 devtimer_create(devtimer_process_func process_func
, void * arg0
);
62 devtimer_invalidate(devtimer_ref timer
);
65 devtimer_release(devtimer_ref timer
);
68 devtimer_set_absolute(devtimer_ref t
,
69 struct timeval abs_time
,
70 devtimer_timeout_func func
,
71 void * arg1
, void * arg2
);
74 devtimer_set_relative(devtimer_ref t
,
75 struct timeval rel_time
,
76 devtimer_timeout_func func
,
77 void * arg1
, void * arg2
);
79 devtimer_cancel(devtimer_ref t
);
82 devtimer_enabled(devtimer_ref t
);
85 devtimer_current_time(void);
88 devtimer_current_secs(void);
90 #endif _NET_DEVTIMER_H