2 * \brief DOpE timer module
4 * \author Norman Feske <nf2@inf.tu-dresden.de>
8 * Copyright (C) 2002-2004 Norman Feske <nf2@os.inf.tu-dresden.de>
9 * Technische Universitaet Dresden, Operating Systems Research Group
11 * This file is part of the DOpE package, which is distributed under
12 * the terms of the GNU General Public Licence 2. Please see the
13 * COPYING file for details.
21 int init_timer(struct dope_services *d);
24 /*************************
25 *** SERVICE FUNCTIONS ***
26 *************************/
28 /*** RETURN CURRENT SYSTEM TIME COUNTER IN MICROSECONDS ***/
29 static u32 get_time(void) {
30 return SDL_GetTicks()*1000;
34 /*** RETURN DIFFERENCE BETWEEN TWO TIMES ***/
35 static u32 get_diff(u32 time1,u32 time2) {
40 return (u32)0xffffffff - time1;
46 /*** WAIT SPECIFIED NUMBER OF MICROSECONDS ***/
47 static void wait_usec(u32 num_usec) {
52 /****************************************
53 *** SERVICE STRUCTURE OF THIS MODULE ***
54 ****************************************/
56 static struct timer_services services = {
63 /**************************
64 *** MODULE ENTRY POINT ***
65 **************************/
67 int init_timer(struct dope_services *d) {
69 d->register_module("Timer 1.0",&services);