source: rtems/c/src/lib/libbsp/mips/shared/clock/clockdrv.c @ f3b29236

Last change on this file since f3b29236 was f3b29236, checked in by Sebastian Huber <sebastian.huber@…>, on Sep 18, 2017 at 6:22:38 AM

bsps: Clock_driver_support_install_isr()

Remove old ISR parameter since is not used by the clock driver shell.
Make an implementation optional.

Update #3139.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2013.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.org/license/LICENSE.
8 */
9
10#include <bsp.h>
11#include <bsp/irq.h>
12#include <bspopts.h>
13
14/* XXX convert to macros? Move to score/cpu? */
15void mips_set_timer(uint32_t timer_clock_interval);
16uint32_t mips_get_timer(void);
17
18/* XXX move to BSP.h or irq.h?? */
19#define EXT_INT5             0x8000  /* external interrupt 5 */
20#define CLOCK_VECTOR_MASK    EXT_INT5
21#define CLOCK_VECTOR         (MIPS_INTERRUPT_BASE+0x7)
22
23extern uint32_t bsp_clicks_per_microsecond;
24
25static uint32_t mips_timer_rate = 0;
26
27/* refresh the internal CPU timer */
28#define Clock_driver_support_at_tick() \
29  mips_set_timer( mips_timer_rate );
30
31#define Clock_driver_support_install_isr( _new ) \
32  rtems_interrupt_handler_install(CLOCK_VECTOR, "PIT clock",0, _new, NULL)
33
34#define Clock_driver_support_initialize_hardware() \
35  do { \
36    mips_timer_rate = rtems_configuration_get_microseconds_per_tick() * \
37      bsp_clicks_per_microsecond; \
38    mips_set_timer( mips_timer_rate ); \
39    mips_enable_in_interrupt_mask(CLOCK_VECTOR_MASK); \
40  } while(0)
41
42#define Clock_driver_support_shutdown_hardware() \
43  do { \
44    mips_disable_in_interrupt_mask(CLOCK_VECTOR_MASK); \
45  } while (0)
46
47#define CLOCK_DRIVER_USE_DUMMY_TIMECOUNTER
48
49#include "../../../shared/clockdrv_shell.h"
Note: See TracBrowser for help on using the repository browser.