source: rtems/bsps/arm/edb7312/clock/clockdrv.c

Last change on this file was 7ee59313, checked in by Sebastian Huber <sebastian.huber@…>, on 06/01/18 at 05:11:12

Remove Clock_driver_support_shutdown_hardware()

The aim of this clock driver hook was to stop clock tick interrupts at
some late point in the exit() procedure.

The use of atexit() pulls in malloc() which pulls in errno. It is
incompatible with the intention of the
CONFIGURE_DISABLE_NEWLIB_REENTRANCY configuration option.

The exit() function must be called from thread context, so accompanied
clock tick interrupts should cause no harm. On the contrary, someone
may assume a normal operating system operation, e.g. working timeouts.

Remove the Clock_driver_support_shutdown_hardware() clock driver hook.

Close #3436.

  • Property mode set to 100644
File size: 1.9 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
21void Clock_isr(void * arg);
22
23#define Clock_driver_support_at_tick()                \
24  do {                                                \
25    *EP7312_TC1EOI = 0xffffffff;                      \
26  } while(0)
27
28#define Clock_driver_support_install_isr( _new )       \
29  do {                                                 \
30    rtems_status_code status = RTEMS_SUCCESSFUL;       \
31    status = rtems_interrupt_handler_install(          \
32        BSP_TC1OI,                                     \
33        "Clock",                                       \
34        RTEMS_INTERRUPT_UNIQUE,                        \
35        Clock_isr,                                     \
36        NULL                                           \
37    );                                                 \
38    assert(status == RTEMS_SUCCESSFUL);                \
39  } while(0)
40
41/*
42 * Set up the clock hardware
43 */
44#if ON_SKYEYE
45  #define TCD_VALUE \
46    (rtems_configuration_get_microseconds_per_tick() * 2000)/25000
47#else
48  #define TCD_VALUE \
49    (rtems_configuration_get_microseconds_per_tick() * 2000)/1000000
50#endif
51
52#define Clock_driver_support_initialize_hardware()  \
53  do {                                              \
54    *EP7312_SYSCON1 |= EP7312_SYSCON1_TC1_PRESCALE; \
55    *EP7312_TC1D = TCD_VALUE;                       \
56    *EP7312_TC1EOI = 0xFFFFFFFF;                    \
57  } while (0)
58
59#define CLOCK_DRIVER_USE_DUMMY_TIMECOUNTER
60
61#include "../../../shared/dev/clock/clockimpl.h"
Note: See TracBrowser for help on using the repository browser.