Mtvec register

Im trying to set up timer interrupt that will trigger a handler routine. I will be using DIRECT mode for mtvec. Where would i get the address of the routine I have written and how would I fit a 32 bit adress in the 30 bit of mtvec.BASE ???

you can use something like :
void interrupt_handler(void) __attribute__((interrupt, aligned(16)));

before writing your handler. this will make sure that your fonction will be 16 byte aligned and will fit in mtvec .
to register it :

unsigned int mtvec = (unsigned int) interrupt_handler;
__asm__ volatile("csrw mtvec, %0" :: "r" (mtvec));