Changeset 205 for trunk/kernel


Ignore:
Timestamp:
Jul 17, 2017, 11:41:25 AM (5 years ago)
Author:
alain
Message:

Change dev_pic_enable_irq() and dev_pic_disable_irq() prototypes
to handle remote IRQs.

Location:
trunk/kernel/devices
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/devices/dev_pic.c

    r204 r205  
    7878
    7979    // get pointer on extend_init function
    80     pic_init_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.extend_init ) );
     80    extend_init_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.extend_init ) );
    8181
    8282    // call relevant driver function
     
    9393
    9494    // get pointer on bind_irq function
    95     pic_bind_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.bind_irq ) );
     95    bind_irq_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.bind_irq ) );
    9696
    9797    // call relevant driver function
     
    9999}
    100100
    101 ///////////////////////////////////////
    102 void dev_pic_enable_irq( lid_t     lid,
    103                          chdev_t * src_chdev )
     101/////////////////////////////////////
     102void dev_pic_enable_irq( lid_t   lid,
     103                         xptr_t  src_chdev_xp )
    104104{
    105105    // get pointer on PIC chdev
     
    108108
    109109    // get pointer on enable_irq function
    110     pic_enable_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.enable_irq ) );
     110    enable_irq_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.enable_irq ) );
    111111
    112112    // call relevant driver function
    113     f( lid , src_chdev );
     113    f( lid , src_chdev_xp );
    114114}
    115115
    116 ////////////////////////////////////////
    117 void dev_pic_disable_irq( lid_t     lid,
    118                           chdev_t * src_chdev )
     116//////////////////////////////////////
     117void dev_pic_disable_irq( lid_t   lid,
     118                          xptr_t  src_chdev_xp )
    119119{
    120120    // get pointer on PIC chdev
     
    123123
    124124    // get pointer on disable_irq function
    125     pic_disable_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.disable_irq ) );
     125    disable_irq_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.disable_irq ) );
    126126
    127127    // call relevant driver function
    128     f( lid , src_chdev );
     128    f( lid , src_chdev_xp );
    129129}
    130130
     
    137137
    138138    // get pointer on enable_timer function
    139     pic_timer_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.enable_timer ) );
     139    enable_timer_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.enable_timer ) );
    140140
    141141    // call relevant driver function
     
    152152
    153153    // get pointer on send_ipi function
    154     pic_ipi_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.send_ipi ) );
     154    send_ipi_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.send_ipi ) );
    155155
    156156    // call relevant driver function
  • trunk/kernel/devices/dev_pic.h

    r201 r205  
    8383 ****************************************************************************************/
    8484
    85 typedef void   (pic_bind_t)    ( lid_t lid , struct chdev_s * src_chdev );   
    86 typedef void   (pic_enable_t)  ( lid_t lid , struct chdev_s * src_chdev );   
    87 typedef void   (pic_disable_t) ( lid_t lid , struct chdev_s * src_chdev );   
    88 typedef void   (pic_timer_t)  ( uint32_t period );   
    89 typedef void   (pic_ipi_t)     ( cxy_t cxy , lid_t lid );
    90 typedef void   (pic_init_t)    ( uint32_t * lapic_base );
     85typedef void   (bind_irq_t)     ( lid_t lid , struct chdev_s * src_chdev );   
     86typedef void   (enable_irq_t)   ( lid_t lid , xptr_t src_chdev_xp );   
     87typedef void   (disable_irq_t)  ( lid_t lid , xptr_t src_chdev_xp );   
     88typedef void   (enable_timer_t) ( uint32_t period );   
     89typedef void   (send_ipi_t)     ( cxy_t cxy , lid_t lid );
     90typedef void   (extend_init_t)  ( uint32_t * lapic_base );
    9191 
    9292typedef struct pic_extend_s
    9393{
    94     pic_bind_t    * bind_irq;      /*! pointer on the driver "bind_irq" function        */
    95     pic_enable_t  * enable_irq;    /*! pointer on the driver "enable_irq" function      */
    96     pic_disable_t * disable_irq;   /*! pointer on the driver "disable_irq" function     */
    97     pic_timer_t   * enable_timer;  /*! pointer on the driver "enable_timer" function    */
    98     pic_ipi_t     * send_ipi;      /*! pointer on the driver "send_ipi" function        */
    99     pic_init_t    * extend_init;   /*! pointer on the driver "init_extend" function     */
     94    bind_irq_t      * bind_irq;      /*! pointer on the driver "bind_irq" function      */
     95    enable_irq_t    * enable_irq;    /*! pointer on the driver "enable_irq" function    */
     96    disable_irq_t   * disable_irq;   /*! pointer on the driver "disable_irq" function   */
     97    enable_timer_t  * enable_timer;  /*! pointer on the driver "enable_timer" function  */
     98    send_ipi_t      * send_ipi;      /*! pointer on the driver "send_ipi" function      */
     99    extend_init_t   * extend_init;   /*! pointer on the driver "init_extend" function   */
    100100}
    101101pic_extend_t;
    102102
    103 /******************************************************************************************
     103/*****************************************************************************************
    104104 * This structure defines the input IRQS for the external IOPIC controller, that is used
    105105 * by external peripherals (IOC, NIC, TXT, etc.) to signal completion of an I/O operation.
     
    186186
    187187/*****************************************************************************************
    188  * This function disables the IRQ generated by a local chdev, defined by the <src_chdev>
    189  * argument. It can be used for both internal & external IRQs.
    190  *****************************************************************************************
    191  * @ lid        : target core local index.
    192  * @ src_chdev  : local pointer on source chdev descriptor.
    193  ****************************************************************************************/
    194 void dev_pic_disable_irq( lid_t            lid,
    195                           struct chdev_s * src_chdev );
    196 
    197 /*****************************************************************************************
    198  * This function enables the IRQ generated by a local chdev, defined by the <src_chdev>
    199  * argument. It can be used for both internal & external IRQs.
    200  *****************************************************************************************
    201  * @ lid        : target core local index.
    202  * @ src_chdev  : local pointer on source chdev descriptor.
    203  ****************************************************************************************/
    204 void dev_pic_enable_irq( lid_t            lid,
    205                          struct chdev_s * src_chdev );
     188 * This function enables remote IRQ generated by a remote chdev, defined by the
     189 * <src_chdev_xp> argument. It can be called by any thread running in any cluster,
     190 * and can be used for both internal & external IRQs.
     191 *****************************************************************************************
     192 * @ lid           : target core local index (in cluster containing the source chdev).
     193 * @ src_chdev_xp  : extended  pointer on source chdev descriptor.
     194 ****************************************************************************************/
     195void dev_pic_enable_irq( lid_t   lid,
     196                         xptr_t  src_chdev_xp );
     197
     198/*****************************************************************************************
     199 * This function disables remote IRQ generated by a remote chdev, defined by the
     200 * <src_chdev_xp> argument. It can be called by any thread running in any cluster,
     201 * and can be used for both internal & external IRQs.
     202 *****************************************************************************************
     203 * @ lid           : target core local index (in cluster containing the source chdev).
     204 * @ src_chdev_xp  : extended pointer on sour chdev descriptor.
     205 ****************************************************************************************/
     206void dev_pic_disable_irq( lid_t   lid,
     207                          xptr_t  src_chdev_xp );
    206208
    207209/*****************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.