Changeset 201 for trunk/kernel/devices


Ignore:
Timestamp:
Jul 13, 2017, 1:48:45 PM (7 years ago)
Author:
max@…
Message:

fix the pointers

Location:
trunk/kernel/devices
Files:
2 edited

Legend:

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

    r200 r201  
    88 * This file is part of ALMOS-MKH.
    99 *
    10  * ALMOS-MKH.is free software; you can redistribute it and/or modify it
     10 * ALMOS-MKH is free software; you can redistribute it and/or modify it
    1111 * under the terms of the GNU General Public License as published by
    1212 * the Free Software Foundation; version 2.0 of the License.
    1313 *
    14  * ALMOS-MKH.is distributed in the hope that it will be useful, but
     14 * ALMOS-MKH is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of
    1616 * MERCHANTABILITY or FITNESS FOR A PARTPICLAR PURPOSE.  See the GNU
     
    1818 *
    1919 * You should have received a copy of the GNU General Public License
    20  * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
     20 * along with ALMOS-MKH; if not, write to the Free Software Foundation,
    2121 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
    2222 */
     
    3939void dev_pic_init( chdev_t  * pic )
    4040{
    41     // get implementation 
     41    // get implementation
    4242    uint32_t impl = pic->impl;
    4343
     
    7070
    7171    // get pointer on extend_init function
    72     pic_init_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.extend_init ) ); 
     72    pic_init_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.extend_init ) );
    7373
    7474    // call relevant driver function
     
    8181{
    8282    // get pointer on PIC chdev
    83     chdev_t * pic = (chdev_t *)GET_PTR( chdev_dir.pic );
     83    chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic );
     84    cxy_t     pic_cxy = GET_CXY( chdev_dir.pic );
     85
     86    // get pointer on bind_irq function
     87    pic_bind_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.bind_irq ) );
    8488
    8589    // call relevant driver function
    86     pic->ext.pic.bind_irq( lid , src_chdev );
    87 } 
     90    f( lid , src_chdev );
     91}
    8892
    8993///////////////////////////////////////
     
    9296{
    9397    // get pointer on PIC chdev
    94     chdev_t * pic = (chdev_t *)GET_PTR( chdev_dir.pic );
     98    chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic );
     99    cxy_t     pic_cxy = GET_CXY( chdev_dir.pic );
     100
     101    // get pointer on enable_irq function
     102    pic_enable_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.enable_irq ) );
    95103
    96104    // call relevant driver function
    97     pic->ext.pic.enable_irq( lid , src_chdev );
     105    f( lid , src_chdev );
    98106}
    99107
     
    103111{
    104112    // get pointer on PIC chdev
    105     chdev_t * pic = (chdev_t *)GET_PTR( chdev_dir.pic );
     113    chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic );
     114    cxy_t     pic_cxy = GET_CXY( chdev_dir.pic );
     115
     116    // get pointer on disable_irq function
     117    pic_disable_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.disable_irq ) );
    106118
    107119    // call relevant driver function
    108     pic->ext.pic.disable_irq( lid , src_chdev );
     120    f( lid , src_chdev );
    109121}
    110122
     
    113125{
    114126    // get pointer on PIC chdev
    115     chdev_t * pic = (chdev_t *)GET_PTR( chdev_dir.pic );
     127    chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic );
     128    cxy_t     pic_cxy = GET_CXY( chdev_dir.pic );
     129
     130    // get pointer on enable_timer function
     131    pic_timer_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.enable_timer ) );
    116132
    117133    // call relevant driver function
    118     pic->ext.pic.enable_timer( period );
     134    f( period );
    119135}
    120136
     
    124140{
    125141    // get pointer on PIC chdev
    126     chdev_t * pic = (chdev_t *)GET_PTR( chdev_dir.pic );
     142    chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic );
     143    cxy_t     pic_cxy = GET_CXY( chdev_dir.pic );
     144
     145    // get pointer on send_ipi function
     146    pic_ipi_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.send_ipi ) );
    127147
    128148    // call relevant driver function
    129     pic->ext.pic.send_ipi( cxy , lid );
     149    f( cxy , lid );
    130150}
    131151
    132 
  • trunk/kernel/devices/dev_pic.h

    r188 r201  
    8484
    8585typedef void   (pic_bind_t)    ( lid_t lid , struct chdev_s * src_chdev );   
    86 typedef void   (pic_enable_t)  ( struct chdev_s * src_chdev );   
    87 typedef void   (pic_disable_t) ( struct chdev_s * src_chdev );   
     86typedef void   (pic_enable_t)  ( lid_t lid , struct chdev_s * src_chdev );   
     87typedef void   (pic_disable_t) ( lid_t lid , struct chdev_s * src_chdev );   
    8888typedef void   (pic_timer_t)   ( uint32_t period );   
    8989typedef void   (pic_ipi_t)     ( cxy_t cxy , lid_t lid );
Note: See TracChangeset for help on using the changeset viewer.