OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [testbench/] [uos/] [tick.c] - Blame information for rev 343

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 222 markom
/* This file is part of test microkernel for OpenRISC 1000. */
2
/* (C) 2001 Simon Srot, srot@opencores.org */
3
 
4
#include "spr_defs.h"
5
#include "int.h"
6 343 erez
#include "support.h"
7 222 markom
 
8
/* Tick timer period */
9
unsigned long tick_period;
10
 
11
/* Inform of tick interrupt */
12
void (*tick_inf)();
13
 
14
/* Tick interrupt routine */
15
void tick_int()
16
{
17
  /* Call inf routine */
18
  (*tick_inf)();
19
 
20
  /* Set new counter period iand clear inet pending bit */
21
/*      mtspr(SPR_TTMR, SPR_TTMR_IE | SPR_TTMR_SR | (period & SPR_TTMR_PERIOD));*/
22
}
23
 
24
/* Initialize routine */
25
int tick_init(unsigned long period, void (* inf)())
26
{
27
  /* Save tick timer period and inform routine */
28
  tick_period = period;
29
  tick_inf = inf;
30
 
31
  /* Add interrupt handler */
32
  int_add(V_TICK, tick_int, 0/*, INT_HIGH_PRI*/);
33
 
34
  /* Set counter period, enable timer and interrupt */
35
  mtspr(SPR_TTMR, SPR_TTMR_IE | SPR_TTMR_CR | (period & SPR_TTMR_PERIOD));
36
 
37
  return 0;
38
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.