Changeset 492 for trunk/kernel/devices


Ignore:
Timestamp:
Aug 22, 2018, 11:55:48 PM (6 years ago)
Author:
viala@…
Message:

Refactoring assert calling to conform with new assert macro.

Made with this command for the general case.
find ./kernel/ hal/ -name "*.c" | xargs sed -i -e '/assert(/ s/,[ ]*FUNCTION[ ]*,/,/'

And some done by hand.

Location:
trunk/kernel/devices
Files:
6 edited

Legend:

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

    r457 r492  
    6969    if( error )
    7070    {
    71         assert( false , __FUNCTION__ , "cannot create server thread" );
     71        assert( false , "cannot create server thread" );
    7272    }
    7373
     
    103103    xptr_t  dev_xp = chdev_dir.dma[channel];
    104104
    105     assert( (dev_xp != XPTR_NULL) , __FUNCTION__ , "undefined DMA chdev descriptor" );
     105    assert( (dev_xp != XPTR_NULL) , "undefined DMA chdev descriptor" );
    106106
    107107    // register command in calling thread descriptor
  • trunk/kernel/devices/dev_fbf.c

    r483 r492  
    5959    else
    6060    {
    61         assert( false , __FUNCTION__ , "undefined FBF device implementation" );
     61        assert( false , "undefined FBF device implementation" );
    6262    }
    6363
     
    7171    xptr_t  dev_xp = chdev_dir.fbf[0];
    7272
    73     assert( (dev_xp != XPTR_NULL) , __FUNCTION__ , "undefined FBF chdev descriptor" );
     73    assert( (dev_xp != XPTR_NULL) , "undefined FBF chdev descriptor" );
    7474
    7575    // get FBF chdev cluster and local pointer
     
    8989    xptr_t  dev_xp = chdev_dir.fbf[0];
    9090
    91     assert( (dev_xp != XPTR_NULL) , __FUNCTION__ , "undefined FBF chdev descriptor" );
     91    assert( (dev_xp != XPTR_NULL) , "undefined FBF chdev descriptor" );
    9292
    9393    // get FBF chdev cluster and local pointer
     
    106106    xptr_t  dev_xp = chdev_dir.fbf[0];
    107107
    108     assert( (dev_xp != XPTR_NULL) , __FUNCTION__ , "undefined FBF chdev descriptor" );
     108    assert( (dev_xp != XPTR_NULL) , "undefined FBF chdev descriptor" );
    109109
    110110    // get FBF chdev cluster and local pointer
     
    132132    xptr_t  fbf_xp = chdev_dir.fbf[0];
    133133
    134     assert( (fbf_xp != XPTR_NULL) , __FUNCTION__ , "undefined FBF chdev descriptor" );
     134    assert( (fbf_xp != XPTR_NULL) , "undefined FBF chdev descriptor" );
    135135
    136136    // get FBF chdev cluster and local pointer
     
    144144
    145145    // check offset and length versus FBF size
    146     assert( ((offset + length) <= (width * height)) , __FUNCTION__ ,
     146    assert( ((offset + length) <= (width * height)) ,
    147147    "offset %d / length %d / width %d / height %d\n", offset, length, width, height );
    148148
  • trunk/kernel/devices/dev_ioc.c

    r457 r492  
    4444    xptr_t  pic_xp  = chdev_dir.pic;
    4545
    46     assert( (pic_xp != XPTR_NULL) , __FUNCTION__ , "PIC not initialised before IOC" );
     46    assert( (pic_xp != XPTR_NULL) , "PIC not initialised before IOC" );
    4747
    4848    // get implementation and channel from chdev descriptor
     
    7575                                  lid );
    7676
    77     assert( (error == 0) , __FUNCTION__ , "cannot create server thread" );
     77    assert( (error == 0) , "cannot create server thread" );
    7878
    7979    // set "server" field in chdev descriptor
     
    111111    xptr_t  dev_xp = chdev_dir.ioc[0];
    112112
    113     assert( (dev_xp != XPTR_NULL) , __FUNCTION__ , "undefined IOC chdev descriptor" );
     113    assert( (dev_xp != XPTR_NULL) , "undefined IOC chdev descriptor" );
    114114
    115115    // register command in calling thread descriptor
     
    199199    xptr_t  ioc_xp = chdev_dir.ioc[0];
    200200
    201     assert( (ioc_xp != XPTR_NULL) , __FUNCTION__ , "undefined IOC chdev descriptor" );
     201    assert( (ioc_xp != XPTR_NULL) , "undefined IOC chdev descriptor" );
    202202
    203203    // register command in calling thread descriptor
  • trunk/kernel/devices/dev_mmc.c

    r457 r492  
    6767    xptr_t  dev_xp = this->mmc_cmd.dev_xp;
    6868
    69     assert( (dev_xp != XPTR_NULL) , __FUNCTION__ , "target MMC device undefined" );
     69    assert( (dev_xp != XPTR_NULL) , "target MMC device undefined" );
    7070
    7171    // get MMC device cluster identifier & local pointer
     
    110110    void * buf_ptr = GET_PTR( buf_xp );
    111111   
    112     assert( (((intptr_t)buf_ptr & (CONFIG_CACHE_LINE_SIZE -1)) == 0) , __FUNCTION__ ,
     112    assert( (((intptr_t)buf_ptr & (CONFIG_CACHE_LINE_SIZE -1)) == 0) ,
    113113             "buffer not aligned on cache line" );
    114114
     
    151151    void * buf_ptr = GET_PTR( buf_xp );
    152152   
    153     assert( (((intptr_t)buf_ptr & (CONFIG_CACHE_LINE_SIZE -1)) == 0) , __FUNCTION__ ,
     153    assert( (((intptr_t)buf_ptr & (CONFIG_CACHE_LINE_SIZE -1)) == 0) ,
    154154             "buffer not aligned on cache line" );
    155155
  • trunk/kernel/devices/dev_nic.c

    r457 r492  
    4343    xptr_t  pic_xp  = chdev_dir.pic;
    4444
    45     assert( (pic_xp != XPTR_NULL) , __FUNCTION__ , "ICU not initialised before NIC" );
     45    assert( (pic_xp != XPTR_NULL) , "ICU not initialised before NIC" );
    4646
    4747    // get "impl" , "channel" , "is_rx" fields from chdev descriptor
     
    7474                                  lid );
    7575
    76     assert( (error == 0) , __FUNCTION__ , "cannot create server thread" );
     76    assert( (error == 0) , "cannot create server thread" );
    7777
    7878    // set "server" field in chdev descriptor
     
    112112    chdev_t  * dev_ptr = (chdev_t *)GET_PTR( dev_xp );
    113113
    114     assert( (dev_xp != XPTR_NULL) , __FUNCTION__ , "undefined NIC chdev descriptor" );
    115 
    116     assert( (dev_cxy == local_cxy) , __FUNCTION__ , " chdev must be local" );
     114    assert( (dev_xp != XPTR_NULL) , "undefined NIC chdev descriptor" );
     115
     116    assert( (dev_cxy == local_cxy) , " chdev must be local" );
    117117
    118118    // initialize command in thread descriptor
     
    190190    chdev_t  * dev_ptr = (chdev_t *)GET_PTR( dev_xp );
    191191
    192     assert ( (dev_xp != XPTR_NULL) , __FUNCTION__ , "undefined NIC chdev descriptor" );
    193 
    194     assert( (dev_cxy == local_cxy) , __FUNCTION__ , " chdev must be local" );
     192    assert( (dev_xp != XPTR_NULL) , "undefined NIC chdev descriptor" );
     193
     194    assert( (dev_cxy == local_cxy) , " chdev must be local" );
    195195
    196196    // initialize command in thread descriptor
  • trunk/kernel/devices/dev_txt.c

    r457 r492  
    6969    bool_t    is_rx   = txt->is_rx;
    7070
    71     assert( (pic_xp != XPTR_NULL) || (channel == 0) , __FUNCTION__ ,
     71    assert( (pic_xp != XPTR_NULL) || (channel == 0) ,
    7272            "PIC not initialised before TXT" );
    7373
     
    107107                                      lid );
    108108
    109         assert( (error == 0) , __FUNCTION__ , "cannot create server thread" );
     109        assert( (error == 0) , "cannot create server thread" );
    110110
    111111        // set "server" field in chdev descriptor
     
    132132
    133133    // check channel argument
    134     assert( (channel < CONFIG_MAX_TXT_CHANNELS) , __FUNCTION__ , "illegal channel index" );
     134    assert( (channel < CONFIG_MAX_TXT_CHANNELS) , "illegal channel index" );
    135135
    136136    // get extended pointer on remote TXT chdev descriptor
     
    138138    else                     dev_xp = chdev_dir.txt_rx[channel];
    139139
    140     assert( (dev_xp != XPTR_NULL) , __FUNCTION__ , "undefined TXT chdev descriptor" );
     140    assert( (dev_xp != XPTR_NULL) , "undefined TXT chdev descriptor" );
    141141
    142142    // register command in calling thread descriptor
     
    221221    xptr_t  dev_xp = chdev_dir.txt_tx[0];
    222222
    223     assert( (dev_xp != XPTR_NULL) , __FUNCTION__ ,
     223    assert( (dev_xp != XPTR_NULL) ,
    224224    "undefined TXT0 chdev descriptor" );
    225225
Note: See TracChangeset for help on using the changeset viewer.