timer: repeat support and running status

This commit is contained in:
Matheus
2023-04-27 23:33:55 -03:00
parent 06e755e36a
commit 16f1823897
2 changed files with 72 additions and 50 deletions
+3
View File
@@ -4,10 +4,12 @@
#include <time.h>
#include <arch/context.h>
#include <spinlock.h>
#include <stdbool.h>
typedef struct timerentry_t {
struct timerentry_t *next;
time_t absolutetick;
time_t repeatus;
void *private;
void (*func)(void *private, context_t* context);
} timerentry_t;
@@ -16,6 +18,7 @@ typedef struct {
spinlock_t lock;
time_t ticksperus;
time_t tickcurrent;
bool running;
void (*arm)(time_t);
time_t (*stop)();
timerentry_t *queue;