#include "riscv.h"
#include "vsrv.h"
#include "uart.h"
#define MTIME (volatile unsigned long int *)(VSRV_TMR_BASE + 0x0010)
#define MTIMECMP (volatile unsigned long int *)(VSRV_TMR_BASE + 0x000C)

void timer_init() {
    *MTIMECMP = *MTIME + 0xfffff * 5;
    uint32_t mie = r_mie();
    mie |= (1 << 7);
    w_mie(mie);
}
