summaryrefslogtreecommitdiff
path: root/timer.h
blob: a426b9e95e1a4f9115197e5928a6dbdbfcd02ca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2010  Segher Boessenkool  <segher@kernel.crashing.org>
// Licensed under the terms of the GNU GPL, version 2
// http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt

#ifndef _TIMER_H
#define _TIMER_H

#include "types.h"

extern volatile u32 timer_triggered;

struct timer {
	const char *name;
	u32 time;
	u32 interval;
	void (*run)(void);
	struct timer *next;
};

void timer_debug(void);
void timer_init(void);
void timer_add(struct timer *timer);
void timer_run(void);
u32 timer_now(void);

// XXX: temp
void timer_set(u32 usecs);

#endif