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.


Release 1.0
[palacios.git] / geekos / include / geekos / timer.h
diff --git a/geekos/include/geekos/timer.h b/geekos/include/geekos/timer.h
new file mode 100644 (file)
index 0000000..f5ae13f
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * GeekOS timer interrupt support
+ * Copyright (c) 2001, David H. Hovemeyer <daveho@cs.umd.edu>
+ * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
+ * (c) 2008, The V3VEE Project <http://www.v3vee.org> 
+ * $Revision: 1.2 $
+ * 
+ * This is free software.  You are permitted to use,
+ * redistribute, and modify it as specified in the file "COPYING".
+ */
+
+#ifndef GEEKOS_TIMER_H
+#define GEEKOS_TIMER_H
+
+#define TIMER_IRQ 0
+
+extern volatile unsigned long g_numTicks;
+
+typedef void (*timerCallback)(int, void*);
+
+void Init_Timer(void);
+
+void Micro_Delay(int us);
+
+
+typedef struct {
+  int ticks;                           /* timer code decrements this */
+  int id;                              /* unqiue id for this timer even */
+  timerCallback callBack;              /* Queue to wakeup on timer expire */
+  void * cb_arg;                       /* Argument to add to callback */
+  int origTicks;
+
+} timerEvent;
+
+int Start_Timer_Secs(int seconds, timerCallback cb, void * arg);
+int Start_Timer_MSecs(int msecs, timerCallback cb, void * arg);
+int Start_Timer(int ticks, timerCallback, void * arg);
+
+
+double Get_Remaining_Timer_Secs(int id);
+int Get_Remaining_Timer_MSecs(int id);
+int Get_Remaining_Timer_Ticks(int id);
+int Cancel_Timer(int id);
+
+void Micro_Delay(int us);
+
+unsigned long clock_time(void);  //return elipsed millisecs
+
+#endif  /* GEEKOS_TIMER_H */