From e7bc50ca8ffcaa6ed68ebd2315f78b0f5a7d10ad Mon Sep 17 00:00:00 2001 From: klaar36 Date: Fri, 20 Mar 2015 17:30:24 +0100 Subject: Initial Pintos --- src/devices/timer.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/devices/timer.h (limited to 'src/devices/timer.h') diff --git a/src/devices/timer.h b/src/devices/timer.h new file mode 100644 index 0000000..45a3f72 --- /dev/null +++ b/src/devices/timer.h @@ -0,0 +1,23 @@ +#ifndef DEVICES_TIMER_H +#define DEVICES_TIMER_H + +#include +#include + +/* Number of timer interrupts per second. */ +#define TIMER_FREQ 100 + +void timer_init (void); +void timer_calibrate (void); + +int64_t timer_ticks (void); +int64_t timer_elapsed (int64_t); + +void timer_sleep (int64_t ticks); +void timer_msleep (int64_t milliseconds); +void timer_usleep (int64_t microseconds); +void timer_nsleep (int64_t nanoseconds); + +void timer_print_stats (void); + +#endif /* devices/timer.h */ -- cgit v1.2.1