Changeset 291c5391 in rtems


Ignore:
Timestamp:
Apr 13, 2015, 11:12:33 AM (5 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
4.11, master
Children:
628e739
Parents:
4c9c46d
git-author:
Daniel Hellstrom <daniel@…> (04/13/15 11:12:33)
git-committer:
Daniel Hellstrom <daniel@…> (04/16/15 23:10:30)
Message:

DRVMGR: remove struct driver registration func

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/leon2/startup/bsppredriver.c

    r4c9c46d r291c5391  
    3232 * is not drvmgr drivers.
    3333 */
    34 struct drvmgr_drv_reg_func drvmgr_drivers[] __attribute__((weak)) =
     34drvmgr_drv_reg_func drvmgr_drivers[] __attribute__((weak)) =
    3535{
    36   {NULL} /* End array with NULL */
     36  NULL /* End array with NULL */
    3737};
    3838
  • c/src/lib/libbsp/sparc/leon3/amba/amba.c

    r4c9c46d r291c5391  
    3939 * the drvmgr_confdefs.h. By default the Timer and UART driver are included.
    4040 */
    41 struct drvmgr_drv_reg_func drvmgr_drivers[] __attribute__((weak)) =
     41drvmgr_drv_reg_func drvmgr_drivers[] __attribute__((weak)) =
    4242{
    43   {gptimer_register_drv},
    44   {apbuart_cons_register_drv},
    45   {NULL} /* End array with NULL */
     43  gptimer_register_drv,
     44  apbuart_cons_register_drv,
     45  NULL /* End array with NULL */
    4646};
    4747
  • cpukit/libdrvmgr/drvmgr.c

    r4c9c46d r291c5391  
    8484void _DRV_Manager_initialization(void)
    8585{
    86         struct drvmgr_drv_reg_func *drvreg;
     86        drvmgr_drv_reg_func *drvreg;
    8787
    8888        /* drvmgr is already initialized statically by compiler except
     
    9393        /* Call driver register functions. */
    9494        drvreg = &drvmgr_drivers[0];
    95         while (drvreg->drv_reg) {
     95        while (*drvreg) {
    9696                /* Make driver register */
    97                 drvreg->drv_reg();
     97                (*drvreg)();
    9898                drvreg++;
    9999        }
  • cpukit/libdrvmgr/drvmgr.h

    r4c9c46d r291c5391  
    316316 *  driver manager.
    317317 */
    318 struct drvmgr_drv_reg_func {
    319         void (*drv_reg)(void);
    320 };
     318typedef void (*drvmgr_drv_reg_func)(void);
    321319
    322320/*** DRIVER | DEVICE | BUS FUNCTIONS ***/
  • cpukit/libdrvmgr/drvmgr_confdefs.h

    r4c9c46d r291c5391  
    2525#endif
    2626
    27 extern struct drvmgr_drv_reg_func drvmgr_drivers[];
     27extern drvmgr_drv_reg_func drvmgr_drivers[];
    2828
    2929#ifdef CONFIGURE_INIT
    3030
    3131/*** AMBA Plug & Play Drivers ***/
    32 #define DRIVER_AMBAPP_GAISLER_GPTIMER_REG {gptimer_register_drv}
    3332extern void gptimer_register_drv(void);
    34 
    35 #define DRIVER_AMBAPP_GAISLER_APBUART_REG {apbuart_cons_register_drv}
    3633extern void apbuart_cons_register_drv(void);
    37 
    38 #define DRIVER_AMBAPP_GAISLER_GRETH_REG {greth_register_drv}
    3934extern void greth_register_drv(void);
    40 
    41 #define DRIVER_AMBAPP_GAISLER_GRSPW_REG {grspw_register_drv}
    4235extern void grspw_register_drv(void);
    43 
    44 #define DRIVER_AMBAPP_GAISLER_GRSPW2_REG {grspw2_register_drv}
    4536extern void grspw2_register_drv(void);
    46 
    47 #define DRIVER_AMBAPP_GAISLER_GRCAN_REG {grcan_register_drv}
    4837extern void grcan_register_drv(void);
    49 
    50 #define DRIVER_AMBAPP_GAISLER_OCCAN_REG {occan_register_drv}
    5138extern void occan_register_drv(void);
    52 
    53 #define DRIVER_AMBAPP_GAISLER_GR1553B_REG {gr1553_register}
    5439extern void gr1553_register(void);
    55 
    56 #define DRIVER_AMBAPP_GAISLER_GR1553BC_REG {gr1553bc_register}
    5740extern void gr1553bc_register(void);
    58 
    59 #define DRIVER_AMBAPP_GAISLER_GR1553BM_REG {gr1553bm_register}
    6041extern void gr1553bm_register(void);
    61 
    62 #define DRIVER_AMBAPP_GAISLER_GR1553RT_REG {gr1553rt_register}
    6342extern void gr1553rt_register(void);
    64 
    65 #define DRIVER_AMBAPP_GAISLER_B1553BRM_REG {b1553brm_register_drv}
    6643extern void b1553brm_register_drv(void);
    67 
    68 #define DRIVER_AMBAPP_GAISLER_B1553RT_REG {b1553rt_register_drv}
    6944extern void b1553rt_register_drv(void);
    70 
    71 #define DRIVER_AMBAPP_GAISLER_GRTM_REG {grtm_register_drv}
    7245extern void grtm_register_drv(void);
    73 
    74 #define DRIVER_AMBAPP_GAISLER_GRTC_REG {grtc_register_drv}
    7546extern void grtc_register_drv(void);
    76 
    77 #define DRIVER_AMBAPP_MCTRL_REG {mctrl_register_drv}
     47extern void pcif_register_drv(void);
     48extern void grpci_register_drv(void);
    7849extern void mctrl_register_drv(void);
    79 
    80 #define DRIVER_AMBAPP_GAISLER_PCIF_REG {pcif_register_drv}
    81 extern void pcif_register_drv(void);
    82 
    83 #define DRIVER_AMBAPP_GAISLER_GRPCI_REG {grpci_register_drv}
    84 extern void grpci_register_drv(void);
    85 
    86 #define DRIVER_AMBAPP_GAISLER_GRPCI2_REG {grpci2_register_drv}
    8750extern void grpci2_register_drv(void);
    88 
    89 #define DRIVER_AMBAPP_GAISLER_SPICTRL_REG {spictrl_register_drv}
    9051extern void spictrl_register_drv(void);
    91 
    92 #define DRIVER_AMBAPP_GAISLER_I2CMST_REG {i2cmst_register_drv}
    9352extern void i2cmst_register_drv(void);
    94 
    95 #define DRIVER_AMBAPP_GAISLER_GRGPIO_REG {grgpio_register_drv}
    9653extern void grgpio_register_drv(void);
    97 
    98 #define DRIVER_AMBAPP_GAISLER_GRPWM_REG {grpwm_register_drv}
    9954extern void grpwm_register_drv(void);
    100 
    101 #define DRIVER_AMBAPP_GAISLER_GRADCDAC_REG {gradcdac_register_drv}
    10255extern void gradcdac_register_drv(void);
    103 
    104 #define DRIVER_AMBAPP_GAISLER_SPWCUC_REG {spwcuc_register}
    10556extern void spwcuc_register(void);
    106 
    107 #define DRIVER_AMBAPP_GAISLER_GRCTM_REG {grctm_register}
    10857extern void grctm_register(void);
    109 
    110 #define DRIVER_AMBAPP_GAISLER_SPW_ROUTER_REG {router_register_drv}
    11158extern void router_register_drv(void);
    112 
    113 #define DRIVER_AMBAPP_GAISLER_AHBSTAT_REG {ahbstat_register_drv}
    11459extern void ahbstat_register_drv(void);
    11560
    11661
    11762/*** LEON2 AMBA Hard coded bus Drivers ***/
    118 #define DRIVER_LEON2_AT697PCI_REG {at697pci_register_drv}
    11963extern void at697pci_register_drv(void);
    120 
    121 #define DRIVER_LEON2_AMBAPP_REG {ambapp_leon2_register}
    12264extern void ambapp_leon2_register(void);
    12365
    12466
    12567/*** PCI Bus Drivers (PCI Target drivers) ***/
    126 #define DRIVER_PCI_GR_RASTA_ADCDAC {gr_rasta_adcdac_register_drv}
    12768extern void gr_rasta_adcdac_register_drv(void);
    128 
    129 #define DRIVER_PCI_GR_RASTA_IO {gr_rasta_io_register_drv}
    13069extern void gr_rasta_io_register_drv(void);
    131 
    132 #define DRIVER_PCI_GR_RASTA_TMTC {gr_rasta_tmtc_register_drv}
    13370extern void gr_rasta_tmtc_register_drv(void);
    134 
    135 #define DRIVER_PCI_GR_701 {gr701_register_drv}
    13671extern void gr701_register_drv(void);
    137 
    138 #define DRIVER_PCI_GR_TMTC_1553 {gr_tmtc_1553_register_drv}
    13972extern void gr_tmtc_1553_register_drv(void);
    140 
    141 #define DRIVER_PCI_GR_RASTA_SPW_ROUTER {gr_rasta_spw_router_register_drv}
    14273extern void gr_rasta_spw_router_register_drv(void);
    143 
    144 #define DRIVER_PCI_GR_LEON4_N2X {gr_cpci_leon4_n2x_register_drv}
    14574extern void gr_cpci_leon4_n2x_register_drv(void);
    14675
    14776
    14877/* CONFIGURE DRIVER MANAGER */
    149 struct drvmgr_drv_reg_func drvmgr_drivers[] = {
     78drvmgr_drv_reg_func drvmgr_drivers[] = {
    15079        /*** AMBA Plug & Play Drivers ***/
    15180#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER
    152         DRIVER_AMBAPP_GAISLER_GPTIMER_REG,
     81        gptimer_register_drv,
    15382#endif
    15483#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART
    155         DRIVER_AMBAPP_GAISLER_APBUART_REG,
     84        apbuart_cons_register_drv,
    15685#endif
    15786#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GRETH
    158         DRIVER_AMBAPP_GAISLER_GRETH_REG,
     87        greth_register_drv,
    15988#endif
    16089#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW
    161         DRIVER_AMBAPP_GAISLER_GRSPW_REG,
     90        grspw_register_drv,
    16291#endif
    16392#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW2
    164         DRIVER_AMBAPP_GAISLER_GRSPW2_REG,
     93        grspw2_register_drv,
    16594#endif
    16695#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GRCAN
    167         DRIVER_AMBAPP_GAISLER_GRCAN_REG,
     96        grcan_register_drv,
    16897#endif
    16998#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_OCCAN
    170         DRIVER_AMBAPP_GAISLER_OCCAN_REG,
     99        occan_register_drv,
    171100#endif
    172101#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GR1553B
    173         DRIVER_AMBAPP_GAISLER_GR1553B_REG,
     102        gr1553_register,
    174103#endif
    175104#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GR1553BC
    176         DRIVER_AMBAPP_GAISLER_GR1553BC_REG,
     105        gr1553bc_register,
    177106#endif
    178107#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GR1553BM
    179         DRIVER_AMBAPP_GAISLER_GR1553BM_REG,
     108        gr1553bm_register,
    180109#endif
    181110#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GR1553RT
    182         DRIVER_AMBAPP_GAISLER_GR1553RT_REG,
     111        gr1553rt_register,
    183112#endif
    184113#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_B1553BRM
    185         DRIVER_AMBAPP_GAISLER_B1553BRM_REG,
     114        b1553brm_register_drv,
    186115#endif
    187116#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_B1553RT
    188         DRIVER_AMBAPP_GAISLER_B1553RT_REG,
     117        b1553rt_register_drv,
    189118#endif
    190119#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GRTM
    191         DRIVER_AMBAPP_GAISLER_GRTM_REG,
     120        grtm_register_drv,
    192121#endif
    193122#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GRTC
    194         DRIVER_AMBAPP_GAISLER_GRTC_REG,
     123        grtc_register_drv,
    195124#endif
    196125#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_PCIF
    197         DRIVER_AMBAPP_GAISLER_PCIF_REG,
     126        pcif_register_drv,
    198127#endif
    199128#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GRPCI
    200         DRIVER_AMBAPP_GAISLER_GRPCI_REG,
     129        grpci_register_drv,
    201130#endif
    202131#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GRPCI2
    203         DRIVER_AMBAPP_GAISLER_GRPCI2_REG,
     132        grpci2_register_drv,
    204133#endif
    205134#ifdef CONFIGURE_DRIVER_AMBAPP_MCTRL
    206         DRIVER_AMBAPP_MCTRL_REG,
     135        mctrl_register_drv,
    207136#endif
    208137#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_SPICTRL
    209         DRIVER_AMBAPP_GAISLER_SPICTRL_REG,
     138        spictrl_register_drv,
    210139#endif
    211140#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_I2CMST
    212         DRIVER_AMBAPP_GAISLER_I2CMST_REG,
     141        i2cmst_register_drv,
    213142#endif
    214143#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GRGPIO
    215         DRIVER_AMBAPP_GAISLER_GRGPIO_REG,
     144        grgpio_register_drv,
    216145#endif
    217146#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GRPWM
    218         DRIVER_AMBAPP_GAISLER_GRPWM_REG,
     147        grpwm_register_drv,
    219148#endif
    220149#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GRADCDAC
    221         DRIVER_AMBAPP_GAISLER_GRADCDAC_REG,
     150        gradcdac_register_drv,
    222151#endif
    223152#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_SPWCUC
    224         DRIVER_AMBAPP_GAISLER_SPWCUC_REG,
     153        spwcuc_register,
    225154#endif
    226155#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_GRCTM
    227         DRIVER_AMBAPP_GAISLER_GRCTM_REG,
     156        grctm_register,
    228157#endif
    229158#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_SPW_ROUTER
    230         DRIVER_AMBAPP_GAISLER_SPW_ROUTER_REG,
     159        router_register_drv,
    231160#endif
    232161#ifdef CONFIGURE_DRIVER_AMBAPP_GAISLER_AHBSTAT
    233         DRIVER_AMBAPP_GAISLER_AHBSTAT_REG,
     162        ahbstat_register_drv,
    234163#endif
    235164
    236165        /*** LEON2 AMBA Drivers ***/
    237166#ifdef CONFIGURE_DRIVER_LEON2_AT697PCI
    238         DRIVER_LEON2_AT697PCI_REG,
     167        at697pci_register_drv,
    239168#endif
    240169#ifdef CONFIGURE_DRIVER_LEON2_AMBAPP
    241         DRIVER_LEON2_AMBAPP_REG,
     170        ambapp_leon2_register,
    242171#endif
    243172
    244173        /*** PCI Target Drivers ***/
    245174#ifdef CONFIGURE_DRIVER_PCI_GR_RASTA_ADCDAC
    246         DRIVER_PCI_GR_RASTA_ADCDAC,
     175        gr_rasta_adcdac_register_drv,
    247176#endif
    248177#ifdef CONFIGURE_DRIVER_PCI_GR_RASTA_IO
    249         DRIVER_PCI_GR_RASTA_IO,
     178        gr_rasta_io_register_drv,
    250179#endif
    251180#ifdef CONFIGURE_DRIVER_PCI_GR_RASTA_TMTC
    252         DRIVER_PCI_GR_RASTA_TMTC,
     181        gr_rasta_tmtc_register_drv,
    253182#endif
    254183#ifdef CONFIGURE_DRIVER_PCI_GR_701
    255         DRIVER_PCI_GR_701,
     184        gr701_register_drv,
    256185#endif
    257186#ifdef CONFIGURE_DRIVER_PCI_GR_TMTC_1553
    258         DRIVER_PCI_GR_TMTC_1553,
     187        gr_tmtc_1553_register_drv,
    259188#endif
    260189#ifdef CONFIGURE_DRIVER_PCI_GR_RASTA_SPW_ROUTER
    261         DRIVER_PCI_GR_RASTA_SPW_ROUTER,
     190        gr_rasta_spw_router_register_drv,
    262191#endif
    263192#ifdef CONFIGURE_DRIVER_PCI_GR_LEON4_N2X
    264         DRIVER_PCI_GR_LEON4_N2X,
     193        gr_cpci_leon4_n2x_register_drv,
    265194#endif
    266195
Note: See TracChangeset for help on using the changeset viewer.