Changeset bb99cd0d in rtems


Ignore:
Timestamp:
Dec 5, 2019, 6:22:33 PM (14 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
cc466a5
Parents:
a6b2080
git-author:
Sebastian Huber <sebastian.huber@…> (12/05/19 18:22:33)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/11/19 08:05:07)
Message:

clock: Simplify driver initialization

Use a system initialization handler instead of a legacy IO driver.

Update #3834.

Files:
23 edited

Legend:

Unmodified
Added
Removed
  • bsps/bfin/shared/dev/clock.c

    ra6b2080 rbb99cd0d  
    5454}
    5555
    56 /*
    57  *  Clock_initialize
    58  *
    59  *  This routine initializes the clock driver.
    60  */
    61 rtems_device_driver Clock_initialize(
    62   rtems_device_major_number major,
    63   rtems_device_minor_number minor,
    64   void *pargp
    65 )
     56void _Clock_Initialize( void )
    6657{
    6758  Clock_driver_ticks = 0;
     
    7667
    7768  atexit(Clock_exit);
    78 
    79   return RTEMS_SUCCESSFUL;
    8069}
  • bsps/m68k/csb360/dev/ckinit.c

    ra6b2080 rbb99cd0d  
    113113}
    114114
    115 rtems_device_driver
    116 Clock_initialize(
    117   rtems_device_major_number major,
    118   rtems_device_minor_number minor,
    119   void *pargp
    120 )
     115void _Clock_Initialize( void )
    121116{
    122117  Install_clock (Clock_isr);
    123 
    124   return RTEMS_SUCCESSFUL;
    125118}
  • bsps/m68k/gen68340/clock/ckinit.c

    ra6b2080 rbb99cd0d  
    9292}
    9393
    94 rtems_device_driver
    95 Clock_initialize(
    96   rtems_device_major_number major,
    97   rtems_device_minor_number minor,
    98   void *pargp
    99 )
     94void _Clock_Initialize( void )
    10095{
    10196  Install_clock (Clock_isr);
    102 
    103   return RTEMS_SUCCESSFUL;
    10497}
  • bsps/m68k/mcf5206elite/dev/ckinit.c

    ra6b2080 rbb99cd0d  
    103103}
    104104
    105 rtems_device_driver
    106 Clock_initialize(rtems_device_major_number major,
    107                  rtems_device_minor_number minor,
    108                  void *pargp)
     105void _Clock_Initialize( void )
    109106{
    110107  Install_clock (Clock_isr);
    111 
    112   return RTEMS_SUCCESSFUL;
    113108}
  • bsps/m68k/mrm332/clock/ckinit.c

    ra6b2080 rbb99cd0d  
    6464}
    6565
    66 rtems_device_driver Clock_initialize(
    67   rtems_device_major_number major,
    68   rtems_device_minor_number minor,
    69   void *pargp
    70 )
     66void _Clock_Initialize( void )
    7167{
    7268  Install_clock( Clock_isr );
    73 
    74   return RTEMS_SUCCESSFUL;
    7569}
  • bsps/m68k/mvme147/clock/ckinit.c

    ra6b2080 rbb99cd0d  
    7171}
    7272
    73 rtems_device_driver Clock_initialize(
    74   rtems_device_major_number major,
    75   rtems_device_minor_number minor,
    76   void *pargp
    77 )
     73void _Clock_Initialize( void )
    7874{
    7975  Install_clock( Clock_isr );
    80 
    81   return RTEMS_SUCCESSFUL;
    8276}
  • bsps/m68k/mvme162/clock/ckinit.c

    ra6b2080 rbb99cd0d  
    7878}
    7979
    80 rtems_device_driver Clock_initialize(
    81   rtems_device_major_number major,
    82   rtems_device_minor_number minor,
    83   void *pargp
    84 )
     80void _Clock_Initialize( void )
    8581{
    8682  Install_clock( Clock_isr );
    87 
    88   return RTEMS_SUCCESSFUL;
    8983}
  • bsps/m68k/mvme167/clock/ckinit.c

    ra6b2080 rbb99cd0d  
    11/*
    2  *  Implementation of the Clock_initialize() functions
    3  *  prototyped in rtems/c/src/lib/include/clockdrv.h.
    4  *
    52 *  This port does not allow the application to select which timer on the
    63 *  MVME167 to use for the clock, nor does it allow the application to
     
    148145}
    149146
    150 rtems_device_driver Clock_initialize(
    151   rtems_device_major_number major,
    152   rtems_device_minor_number minor,
    153   void *pargp
    154 )
     147void _Clock_Initialize( void )
    155148{
    156149  VMEchip2_T2_initialize();
    157 
    158   return RTEMS_SUCCESSFUL;
    159150}
  • bsps/mips/hurricane/clock/ckinit.c

    ra6b2080 rbb99cd0d  
    199199}
    200200
    201 /*
    202  *  Clock_initialize
    203  *
    204  *  Device driver entry point for clock tick driver initialization.
    205  */
    206 
    207 rtems_device_driver Clock_initialize(
    208   rtems_device_major_number major,
    209   rtems_device_minor_number minor,
    210   void *pargp
    211 )
     201void _Clock_Initialize( void )
    212202{
    213203  Install_clock( Clock_isr );
    214 
    215   return RTEMS_SUCCESSFUL;
    216 }
    217 
     204}
  • bsps/no_cpu/no_bsp/clock/ckinit.c

    ra6b2080 rbb99cd0d  
    110110}
    111111
    112 /*
    113  *  Clock_initialize
    114  *
    115  *  Device driver entry point for clock tick driver initialization.
    116  */
    117 rtems_device_driver Clock_initialize(
    118   rtems_device_major_number major,
    119   rtems_device_minor_number minor,
    120   void *pargp
    121 )
     112void _Clock_Initialize( void )
    122113{
    123114  Install_clock( Clock_isr );
    124 
    125   return RTEMS_SUCCESSFUL;
    126115}
    127 
  • bsps/powerpc/shared/clock/clock-ppc-dec.c

    ra6b2080 rbb99cd0d  
    198198}
    199199
    200 /*
    201  *  Clock_initialize
    202  *
    203  *  This routine initializes the clock driver.
    204  */
    205 rtems_device_driver Clock_initialize(
    206   rtems_device_major_number major,
    207   rtems_device_minor_number minor,
    208   void *pargp
    209 )
     200void _Clock_Initialize( void )
    210201{
    211202  rtems_interrupt_level l,tcr;
  • bsps/powerpc/shared/clock/clock-ppc403.c

    ra6b2080 rbb99cd0d  
    266266}
    267267
    268 rtems_device_driver Clock_initialize(rtems_device_major_number major,
    269                                      rtems_device_minor_number minor,
    270                                      void *pargp)
     268void _Clock_Initialize( void )
    271269{
    272270  Install_clock( Clock_isr );
    273 
    274   return RTEMS_SUCCESSFUL;
    275 }
     271}
  • bsps/powerpc/shared/clock/clock.c

    ra6b2080 rbb99cd0d  
    168168}
    169169
    170 rtems_device_driver Clock_initialize(
    171   rtems_device_major_number major,
    172   rtems_device_minor_number minor,
    173   void *arg
    174 )
     170void _Clock_Initialize( void )
    175171{
    176172  uint64_t frequency = bsp_time_base_frequency;
     
    234230  ppc_tc.tc_quality = RTEMS_TIMECOUNTER_QUALITY_CLOCK_DRIVER;
    235231  rtems_timecounter_install(&ppc_tc);
    236 
    237   return RTEMS_SUCCESSFUL;
    238 }
     232}
  • bsps/powerpc/ss555/clock/clock.c

    ra6b2080 rbb99cd0d  
    131131}
    132132
    133 rtems_device_driver Clock_initialize(
    134   rtems_device_major_number major,
    135   rtems_device_minor_number minor,
    136   void *pargp
    137 )
     133void _Clock_Initialize( void )
    138134{
    139135  Install_clock( Clock_isr );
    140 
    141   return RTEMS_SUCCESSFUL;
    142136}
  • bsps/sh/gensh1/clock/ckinit.c

    ra6b2080 rbb99cd0d  
    289289}
    290290
    291 /*
    292  *  Clock_initialize
    293  *
    294  *  Device driver entry point for clock tick driver initialization.
    295  */
    296 
    297 rtems_device_driver Clock_initialize(
    298   rtems_device_major_number major,
    299   rtems_device_minor_number minor,
    300   void *pargp
    301 )
     291void _Clock_Initialize( void )
    302292{
    303293  Install_clock( Clock_isr );
    304 
    305   return RTEMS_SUCCESSFUL;
    306 }
     294}
  • bsps/sh/gensh2/clock/ckinit.c

    ra6b2080 rbb99cd0d  
    229229}
    230230
    231 /*
    232  *  Clock_initialize
    233  *
    234  *  Device driver entry point for clock tick driver initialization.
    235  */
    236 rtems_device_driver Clock_initialize(
    237   rtems_device_major_number major,
    238   rtems_device_minor_number minor,
    239   void *pargp
    240 )
     231void _Clock_Initialize( void )
    241232{
    242233  Install_clock( Clock_isr );
    243 
    244   return RTEMS_SUCCESSFUL;
    245 }
     234}
  • bsps/sh/gensh4/clock/ckinit.c

    ra6b2080 rbb99cd0d  
    230230}
    231231
    232 /*
    233  * Clock_initialize
    234  *
    235  * Device driver entry point for clock tick driver initialization.
    236  */
    237 rtems_device_driver Clock_initialize(
    238   rtems_device_major_number major,
    239   rtems_device_minor_number minor,
    240   void *pargp
    241 )
     232void _Clock_Initialize( void )
    242233{
    243234    Install_clock( Clock_isr );
    244 
    245     return RTEMS_SUCCESSFUL;
    246 }
     235}
  • bsps/shared/dev/clock/clockimpl.h

    ra6b2080 rbb99cd0d  
    195195}
    196196
    197 /**
    198  * @brief Clock_initialize
    199  *
    200  * This routine initializes the clock driver.
    201  *
    202  * @param[in] major Clock device major number.
    203  * @param[in] minor Clock device minor number.
    204  * @param[in] parg  Pointer to optional device driver arguments
    205  *
    206  * @retval rtems_device_driver status code
    207  */
    208 rtems_device_driver Clock_initialize(
    209   rtems_device_major_number major,
    210   rtems_device_minor_number minor,
    211   void *pargp
    212 )
     197void _Clock_Initialize( void )
    213198{
    214199  Clock_driver_ticks = 0;
     
    241226    Clock_driver_isrs = CLOCK_DRIVER_ISRS_PER_TICK_VALUE;
    242227  #endif
    243 
    244   return RTEMS_SUCCESSFUL;
    245228}
  • bsps/shared/grlib/btimer/tlib_ckinit.c

    ra6b2080 rbb99cd0d  
    164164}
    165165
    166 /* Return a value not equal to RTEMS_SUCCESFUL to make Clock_initialize fail. */
    167 static rtems_device_driver tlib_clock_install_isr(rtems_isr *isr)
     166static void tlib_clock_install_isr(rtems_isr *isr)
    168167{
    169168  int flags = 0;
     
    174173#endif
    175174  tlib_irq_register(priv.tlib_tick, isr, NULL, flags);
    176 
    177   return RTEMS_SUCCESSFUL;
    178175}
    179176
     
    405402
    406403#define Clock_driver_support_install_isr( isr ) \
    407   do { \
    408     rtems_device_driver ret; \
    409     ret = tlib_clock_install_isr( isr ); \
    410     if (RTEMS_SUCCESSFUL != ret) { \
    411       return ret; \
    412     } \
    413   } while (0)
     404  tlib_clock_install_isr( isr )
    414405
    415406#define Clock_driver_support_set_interrupt_affinity(online_processors) \
  • cpukit/include/rtems/clockdrv.h

    ra6b2080 rbb99cd0d  
    22 * @file
    33 *
    4  * @brief Clock Driver for all Boards
     4 * @ingroup RTEMSDriverClock
    55 *
    6  * This file describes the Clock Driver for all boards.
     6 * @brief Clock Driver API
     7 *
     8 * This file defines the Clock Driver API.
    79 */
    810
     
    1921#define _RTEMS_CLOCKDRV_H
    2022
    21 #include <rtems/io.h> /* rtems_device_driver */
     23#include <stdint.h>
    2224
    2325#ifdef __cplusplus
     
    2527#endif
    2628
    27 /* variables */
     29/**
     30 * @defgroup RTEMSDriverClock Clock Driver
     31 *
     32 * @ingroup RTEMSDeviceDrivers
     33 *
     34 * @brief The Clock Driver API.
     35 *
     36 * @{
     37 */
    2838
    29 extern volatile uint32_t   Clock_driver_ticks;
     39/**
     40 * @brief Count of clock driver ticks since system boot or last overflow.
     41 *
     42 * This counter may overflow.
     43 */
     44extern volatile uint32_t Clock_driver_ticks;
    3045
    31 /* default clock driver entry */
     46/**
     47 * @brief Initialize the clock driver.
     48 */
     49void _Clock_Initialize( void );
    3250
    33 #define CLOCK_DRIVER_TABLE_ENTRY \
    34   { Clock_initialize, NULL, NULL, NULL, NULL, NULL }
    35 
    36 rtems_device_driver Clock_initialize(
    37   rtems_device_major_number,
    38   rtems_device_minor_number,
    39   void *
    40 );
     51/** @} */
    4152
    4253#ifdef __cplusplus
  • cpukit/include/rtems/confdefs.h

    ra6b2080 rbb99cd0d  
    15591559#ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
    15601560  #include <rtems/clockdrv.h>
     1561
     1562  #ifdef CONFIGURE_INIT
     1563    RTEMS_SYSINIT_ITEM(
     1564      _Clock_Initialize,
     1565      RTEMS_SYSINIT_DEVICE_DRIVERS,
     1566      RTEMS_SYSINIT_ORDER_THIRD
     1567    );
     1568  #endif
    15611569#endif
    15621570
     
    16201628      CONSOLE_DRIVER_TABLE_ENTRY,
    16211629    #endif
    1622     #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
    1623       CLOCK_DRIVER_TABLE_ENTRY,
    1624     #endif
    16251630    #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
    16261631      RTC_DRIVER_TABLE_ENTRY,
     
    16501655      NULL_DRIVER_TABLE_ENTRY
    16511656    #elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \
    1652         !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \
    16531657        !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \
    16541658        !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \
  • testsuites/sptests/sp21/init.c

    ra6b2080 rbb99cd0d  
    2727#define PRIurtems_device_major_number PRIu32
    2828
    29 #define STUB_DRIVER_MAJOR     0x2
    30 #define ZERO_DRIVER_MAJOR     0x3
    31 #define NO_DRIVER_MAJOR       0x4
     29#define STUB_DRIVER_MAJOR     1
     30#define ZERO_DRIVER_MAJOR     2
     31#define NO_DRIVER_MAJOR       3
    3232#define INVALID_DRIVER_MAJOR  UINT32_MAX
    3333
  • testsuites/sptests/sp40/init.c

    ra6b2080 rbb99cd0d  
    181181#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
    182182#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
     183#define CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
    183184
    184185/* more one more driver slot than are statically configured */
Note: See TracChangeset for help on using the changeset viewer.