Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Halt handling uses global performance parameters to decide yield strategy
[palacios.git] / geekos / include / geekos / timer.h
1 /*
2  * GeekOS timer interrupt support
3  * Copyright (c) 2001, David H. Hovemeyer <daveho@cs.umd.edu>
4  * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
5  * (c) 2008, The V3VEE Project <http://www.v3vee.org> 
6  * $Revision: 1.2 $
7  * 
8  * This is free software.  You are permitted to use,
9  * redistribute, and modify it as specified in the file "COPYING".
10  */
11
12 #ifndef GEEKOS_TIMER_H
13 #define GEEKOS_TIMER_H
14
15 #define TIMER_IRQ 0
16
17 extern volatile unsigned long g_numTicks;
18
19 typedef void (*timerCallback)(int, void*);
20
21 void Init_Timer(void);
22
23 void Micro_Delay(int us);
24
25
26 typedef struct {
27   int ticks;                           /* timer code decrements this */
28   int id;                              /* unqiue id for this timer even */
29   timerCallback callBack;              /* Queue to wakeup on timer expire */
30   void * cb_arg;                       /* Argument to add to callback */
31   int origTicks;
32
33 } timerEvent;
34
35 int Start_Timer_Secs(int seconds, timerCallback cb, void * arg);
36 int Start_Timer_MSecs(int msecs, timerCallback cb, void * arg);
37 int Start_Timer(int ticks, timerCallback, void * arg);
38
39
40 double Get_Remaining_Timer_Secs(int id);
41 int Get_Remaining_Timer_MSecs(int id);
42 int Get_Remaining_Timer_Ticks(int id);
43 int Cancel_Timer(int id);
44
45 void Micro_Delay(int us);
46
47 unsigned long clock_time(void);  //return elipsed millisecs
48
49 #endif  /* GEEKOS_TIMER_H */