Ignore:
Timestamp:
Apr 26, 2017, 2:10:21 PM (8 years ago)
Author:
alain
Message:

Introduce the chdev_t structure in place of device_t.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/drivers/soclib/soclib_iob.c

    r1 r4  
    2727#include <soclib_iob.h>
    2828
    29 /////////////////////////////////////
    30 void soclib_iob_init( xptr_t iox_xp )
     29///////////////////////////////////////
     30void soclib_iob_init( chdev_t * chdev )
    3131{
    32     // get IOX device cluster and local pointer
    33     cxy_t      iox_cxy = GET_CXY( iox_xp );
    34     device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );
    35 
    36     // get extended pointer on SOCLIB_IOB base_xp segment
    37     xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iox_cxy , &iox_ptr->base ) );
    38 
    3932    // desactivate IOMMU
    40     hal_remote_sw( base_xp + (IOB_IOMMU_ACTIVE<<2) , 0 );
     33    hal_remote_sw( chdev->base + (IOB_IOMMU_ACTIVE<<2) , 0 );
    4134}
    4235
    4336////////////////////////////////////////////
    44 void soclib_iob_set_active( xptr_t   iox_xp,
     37void soclib_iob_set_active( xptr_t   iob_xp,
    4538                            uint32_t value )
    4639{
    4740    // get IOX device cluster and local pointer
    48     cxy_t      iox_cxy = GET_CXY( iox_xp );
    49     device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );
     41    cxy_t     iob_cxy = GET_CXY( iob_xp );
     42    chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp );
    5043
    5144    // get extended pointer on SOCLIB_IOB base_xp segment
    52     xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iox_cxy , &iox_ptr->base ) );
     45    xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) );
    5346
    5447    // set ACTIVE register
     
    5750
    5851//////////////////////////////////////////
    59 void soclib_iob_set_ptpr( xptr_t   iox_xp,
     52void soclib_iob_set_ptpr( xptr_t   iob_xp,
    6053                          uint32_t value )
    6154{
    6255    // get IOX device cluster and local pointer
    63     cxy_t      iox_cxy = GET_CXY( iox_xp );
    64     device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );
     56    cxy_t     iob_cxy = GET_CXY( iob_xp );
     57    chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp );
    6558
    6659    // get extended pointer on SOCLIB_IOB base_xp segment
    67     xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iox_cxy , &iox_ptr->base ) );
     60    xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) );
    6861
    6962    // set PTPR register
     
    7265
    7366///////////////////////////////////////////
    74 void soclib_iob_inval_page( xptr_t  iox_xp,
     67void soclib_iob_inval_page( xptr_t  iob_xp,
    7568                            vpn_t   vpn )
    7669{
    7770    // get IOX device cluster and local pointer
    78     cxy_t      iox_cxy = GET_CXY( iox_xp );
    79     device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );
     71    cxy_t     iob_cxy = GET_CXY( iob_xp );
     72    chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp );
    8073
    8174    // get extended pointer on SOCLIB_IOB base_xp segment
    82     xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iox_cxy , &iox_ptr->base ) );
     75    xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) );
    8376
    8477    // invalidate TLB entry
     
    8780
    8881//////////////////////////////////////////////
    89 uint32_t soclib_iob_get_bvar( xptr_t  iox_xp )
     82uint32_t soclib_iob_get_bvar( xptr_t  iob_xp )
    9083{
    9184    // get IOX device cluster and local pointer
    92     cxy_t      iox_cxy = GET_CXY( iox_xp );
    93     device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );
     85    cxy_t     iob_cxy = GET_CXY( iob_xp );
     86    chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp );
    9487
    9588    // get extended pointer on SOCLIB_IOB base_xp segment
    96     xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iox_cxy , &iox_ptr->base ) );
     89    xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) );
    9790
    9891    // get BVAR register
     
    10194
    10295///////////////////////////////////////////////
    103 uint32_t soclib_iob_get_srcid( xptr_t  iox_xp )
     96uint32_t soclib_iob_get_srcid( xptr_t  iob_xp )
    10497{
    10598    // get IOX device cluster and local pointer
    106     cxy_t      iox_cxy = GET_CXY( iox_xp );
    107     device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );
     99    cxy_t     iob_cxy = GET_CXY( iob_xp );
     100    chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp );
    108101
    109102    // get extended pointer on SOCLIB_IOB base_xp segment
    110     xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iox_cxy , &iox_ptr->base ) );
     103    xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) );
    111104
    112105    // get BVAR register
     
    115108
    116109///////////////////////////////////////////////
    117 uint32_t soclib_iob_get_error( xptr_t  iox_xp )
     110uint32_t soclib_iob_get_error( xptr_t  iob_xp )
    118111{
    119112    // get IOX device cluster and local pointer
    120     cxy_t      iox_cxy = GET_CXY( iox_xp );
    121     device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );
     113    cxy_t     iob_cxy = GET_CXY( iob_xp );
     114    chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp );
    122115
    123116    // get extended pointer on SOCLIB_IOB base_xp segment
    124     xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iox_cxy , &iox_ptr->base ) );
     117    xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) );
    125118
    126119    // get BVAR register
Note: See TracChangeset for help on using the changeset viewer.