source: rtems/c/src/lib/libbsp/m68k/sim68000/clock/clockdrv.c @ cba119c9

4.104.114.84.95
Last change on this file since cba119c9 was f05b2ac, checked in by Ralf Corsepius <ralf.corsepius@…>, on Apr 21, 2004 at 4:01:48 PM

Remove duplicate white lines.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  Instantiate the clock driver shell.
3 *
4 *  $Id$
5 */
6
7#include <bsp.h>
8
9#define CLOCK_VECTOR 84
10
11#define Clock_driver_support_install_isr( _new, _old )  \
12  do { _old = (rtems_isr_entry) set_vector( _new, CLOCK_VECTOR, 1 ); } while(0)
13
14typedef struct {
15  volatile uint8_t    cr;       /*  0 -  0 : Timer Control Register */
16  volatile uint8_t    pad0;     /*  1 -  1 : pad */
17  volatile uint8_t    ivr;      /*  2 -  2 : Timer Interrupt Vector Register */
18  volatile uint8_t    pad1;     /*  3 -  3 : pad */
19  volatile uint32_t   cpr;      /*  4 -  7 : Timer Counter Preload Register */
20  volatile uint8_t    pad2[12]; /*  8 - 19 : pad */
21  volatile uint32_t   sr;       /* 20 - 23 : Timer Status Register */
22} timer_hw_t;
23
24#define TIMER_BASE (timer_hw_t *)0x72001
25
26/* 8 microseconds per click, 125,000 per second */
27
28/* XXX should check that microseconds_per_tick is >= 8 */
29void Clock_driver_support_initialize_hardware()
30{
31  timer_hw_t *t = TIMER_BASE;
32
33  t->ivr = CLOCK_VECTOR;
34  t->cpr = rtems_configuration_get_microseconds_per_tick() / 8;
35  t->cr  = 0xA0;  /* initialize with timer disabled */
36  t->cr  = 0xA1;  /* enable timer */
37}
38
39void Clock_driver_support_at_tick()
40{
41  timer_hw_t *t = TIMER_BASE;
42
43  t->sr  = 0xA0;  /* Negate timer interrupt request */
44}
45
46void Clock_driver_support_shutdown_hardware()
47{
48  timer_hw_t *t = TIMER_BASE;
49
50  t->cr  = 0xA0;  /* initialize with timer disabled */
51}
52
53#include "../../../shared/clockdrv_shell.c"
Note: See TracBrowser for help on using the repository browser.