Last change
on this file was
1eed6f8,
checked in by Sebastian Huber <sebastian.huber@…>, on 03/23/23 at 15:53:30
|
bsps: Avoid unused argument in clock interrupt
Pass the parameter of the clock interrupt handler to
Clock_driver_support_at_tick() and Clock_driver_timecounter_tick(). This makes
it possible to use the interrupt handler argument in clock drivers.
Use the interrupt handler provided by Clock_driver_support_install_isr() to
avoid local delarations of Clock_isr().
Update #4862.
|
-
Property mode set to
100644
|
File size:
1.8 KB
|
Line | |
---|
1 | /* |
---|
2 | * Cirrus EP7312 Clock driver |
---|
3 | * |
---|
4 | * Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com> |
---|
5 | * |
---|
6 | * The license and distribution terms for this file may be |
---|
7 | * found in the file LICENSE in this distribution or at |
---|
8 | * http://www.rtems.org/license/LICENSE. |
---|
9 | */ |
---|
10 | |
---|
11 | #include <rtems.h> |
---|
12 | #include <ep7312.h> |
---|
13 | #include <bsp.h> |
---|
14 | #include <bsp/irq.h> |
---|
15 | #include <assert.h> |
---|
16 | |
---|
17 | #if ON_SKYEYE==1 |
---|
18 | #define CLOCK_DRIVER_USE_FAST_IDLE 1 |
---|
19 | #endif |
---|
20 | |
---|
21 | #define Clock_driver_support_at_tick(arg) \ |
---|
22 | do { \ |
---|
23 | *EP7312_TC1EOI = 0xffffffff; \ |
---|
24 | } while(0) |
---|
25 | |
---|
26 | #define Clock_driver_support_install_isr( _new ) \ |
---|
27 | do { \ |
---|
28 | rtems_status_code status = RTEMS_SUCCESSFUL; \ |
---|
29 | status = rtems_interrupt_handler_install( \ |
---|
30 | BSP_TC1OI, \ |
---|
31 | "Clock", \ |
---|
32 | RTEMS_INTERRUPT_UNIQUE, \ |
---|
33 | _new, \ |
---|
34 | NULL \ |
---|
35 | ); \ |
---|
36 | assert(status == RTEMS_SUCCESSFUL); \ |
---|
37 | } while(0) |
---|
38 | |
---|
39 | /* |
---|
40 | * Set up the clock hardware |
---|
41 | */ |
---|
42 | #if ON_SKYEYE |
---|
43 | #define TCD_VALUE \ |
---|
44 | (rtems_configuration_get_microseconds_per_tick() * 2000)/25000 |
---|
45 | #else |
---|
46 | #define TCD_VALUE \ |
---|
47 | (rtems_configuration_get_microseconds_per_tick() * 2000)/1000000 |
---|
48 | #endif |
---|
49 | |
---|
50 | #define Clock_driver_support_initialize_hardware() \ |
---|
51 | do { \ |
---|
52 | *EP7312_SYSCON1 |= EP7312_SYSCON1_TC1_PRESCALE; \ |
---|
53 | *EP7312_TC1D = TCD_VALUE; \ |
---|
54 | *EP7312_TC1EOI = 0xFFFFFFFF; \ |
---|
55 | } while (0) |
---|
56 | |
---|
57 | #define CLOCK_DRIVER_USE_DUMMY_TIMECOUNTER |
---|
58 | |
---|
59 | #include "../../../shared/dev/clock/clockimpl.h" |
---|
Note: See
TracBrowser
for help on using the repository browser.