new file mode 100644
@@ -0,0 +1,6 @@
+
+extern void set_timer(int);
+extern int get_timer(void);
+extern int get_sec_ticks(void);
+
+#define TICKS_SEC get_sec_ticks()
@@ -18,6 +18,7 @@
#include <cpu.h>
#include "helpers.h"
#include "paflof.h"
+#include "../lib/libnet/time.h" /* TODO: Get rid of old timer code */
/**
* get msec-timer value
@@ -46,6 +47,23 @@ void SLOF_usleep(uint32_t time)
forth_eval("us");
}
+static unsigned int dest_timer;
+
+void set_timer(int val)
+{
+ dest_timer = SLOF_GetTimer() + val;
+}
+
+int get_timer()
+{
+ return dest_timer - SLOF_GetTimer();
+}
+
+int get_sec_ticks(void)
+{
+ return 1000; /* number of ticks in 1 second */
+}
+
void *SLOF_dma_alloc(long size)
{
forth_push(size);
They are needed for libnet, too. This implementation uses SLOF_GetTimer() instead of using the decrementer like it is done in the net-snk functions. Signed-off-by: Thomas Huth <thuth@redhat.com> --- lib/libnet/time.h | 6 ++++++ slof/helpers.c | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 lib/libnet/time.h