12 lines
No EOL
303 B
C
12 lines
No EOL
303 B
C
#include <stdint.h>
|
|
#include <kernel/interrupts.h>
|
|
#include <kernel/plic.h>
|
|
#include <kernel/timer.h>
|
|
|
|
void timer_handle_interrupt()
|
|
{
|
|
static volatile uint64_t *mtime = (uint64_t *)CLINT_MTIME;
|
|
static volatile uint64_t *mtimecmp = (uint64_t *)CLINT_MTIMECMP(0);
|
|
|
|
*mtimecmp = *mtime + TIMER_FREQ;
|
|
} |