POK(kernelpart)
|
Leon3 timer management. More...
#include <errno.h>
#include <bsp.h>
#include <core/time.h>
#include <core/sched.h>
#include <arch.h>
#include "ioports.h"
#include "sparc_conf.h"
#include "timer.h"
#include "irq.h"
#include "../traps.h"
Go to the source code of this file.
Functions | |
void | timer_isr (void) |
pok_ret_t | pok_bsp_time_init () |
Leon3 timer management.
Definition in file timer.c.
Initialize the timer, register the ISR and unmask the interrupt.
Definition at line 50 of file timer.c.
{ outw(TIMER1 + TIMER_SCALER_OFFSET, 1); outw(TIMER1 + TIMER_SCAL_RELOAD_OFFSET, 1); outw(TIMER1 + TIMER_CNT_VAL_OFFSET, 1); outw(TIMER1 + TIMER_RELOAD_OFFSET, SPARC_PROC_FREQ / POK_TIMER_FREQUENCY); outw(TIMER1 + TIMER_CTRL_OFFSET, TIMER_CTRL_EN | TIMER_CTRL_RS | TIMER_CTRL_LD | TIMER_CTRL_IE); pok_arch_event_register(SPARC_TRAP_IRQ_BASE + TIMER_IRQ, timer_isr); unmask_irq(TIMER_IRQ); return (POK_ERRNO_OK); }