Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/bd.c

    rb2f542a rb7fd2a0  
    4848static void bd_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg);
    4949
    50 int bd_open(async_sess_t *sess, bd_t **rbd)
     50errno_t bd_open(async_sess_t *sess, bd_t **rbd)
    5151{
    5252        bd_t *bd = calloc(1, sizeof(bd_t));
     
    5959       
    6060        port_id_t port;
    61         int rc = async_create_callback_port(exch, INTERFACE_BLOCK_CB, 0, 0,
     61        errno_t rc = async_create_callback_port(exch, INTERFACE_BLOCK_CB, 0, 0,
    6262            bd_cb_conn, bd, &port);
    6363       
     
    8383}
    8484
    85 int bd_read_blocks(bd_t *bd, aoff64_t ba, size_t cnt, void *data, size_t size)
     85errno_t bd_read_blocks(bd_t *bd, aoff64_t ba, size_t cnt, void *data, size_t size)
    8686{
    8787        async_exch_t *exch = async_exchange_begin(bd->sess);
     
    9090        aid_t req = async_send_3(exch, BD_READ_BLOCKS, LOWER32(ba),
    9191            UPPER32(ba), cnt, &answer);
    92         int rc = async_data_read_start(exch, data, size);
     92        errno_t rc = async_data_read_start(exch, data, size);
    9393        async_exchange_end(exch);
    9494
     
    9898        }
    9999
    100         sysarg_t retval;
     100        errno_t retval;
    101101        async_wait_for(req, &retval);
    102102
     
    107107}
    108108
    109 int bd_read_toc(bd_t *bd, uint8_t session, void *buf, size_t size)
     109errno_t bd_read_toc(bd_t *bd, uint8_t session, void *buf, size_t size)
    110110{
    111111        async_exch_t *exch = async_exchange_begin(bd->sess);
     
    113113        ipc_call_t answer;
    114114        aid_t req = async_send_1(exch, BD_READ_TOC, session, &answer);
    115         int rc = async_data_read_start(exch, buf, size);
     115        errno_t rc = async_data_read_start(exch, buf, size);
    116116        async_exchange_end(exch);
    117117
     
    121121        }
    122122
    123         sysarg_t retval;
     123        errno_t retval;
    124124        async_wait_for(req, &retval);
    125125
     
    130130}
    131131
    132 int bd_write_blocks(bd_t *bd, aoff64_t ba, size_t cnt, const void *data,
     132errno_t bd_write_blocks(bd_t *bd, aoff64_t ba, size_t cnt, const void *data,
    133133    size_t size)
    134134{
     
    138138        aid_t req = async_send_3(exch, BD_WRITE_BLOCKS, LOWER32(ba),
    139139            UPPER32(ba), cnt, &answer);
    140         int rc = async_data_write_start(exch, data, size);
     140        errno_t rc = async_data_write_start(exch, data, size);
    141141        async_exchange_end(exch);
    142142
     
    146146        }
    147147
    148         sysarg_t retval;
     148        errno_t retval;
    149149        async_wait_for(req, &retval);
    150150        if (retval != EOK)
     
    154154}
    155155
    156 int bd_sync_cache(bd_t *bd, aoff64_t ba, size_t cnt)
    157 {
    158         async_exch_t *exch = async_exchange_begin(bd->sess);
    159 
    160         int rc = async_req_3_0(exch, BD_SYNC_CACHE, LOWER32(ba),
     156errno_t bd_sync_cache(bd_t *bd, aoff64_t ba, size_t cnt)
     157{
     158        async_exch_t *exch = async_exchange_begin(bd->sess);
     159
     160        errno_t rc = async_req_3_0(exch, BD_SYNC_CACHE, LOWER32(ba),
    161161            UPPER32(ba), cnt);
    162162        async_exchange_end(exch);
     
    165165}
    166166
    167 int bd_get_block_size(bd_t *bd, size_t *rbsize)
     167errno_t bd_get_block_size(bd_t *bd, size_t *rbsize)
    168168{
    169169        sysarg_t bsize;
    170170        async_exch_t *exch = async_exchange_begin(bd->sess);
    171171
    172         int rc = async_req_0_1(exch, BD_GET_BLOCK_SIZE, &bsize);
     172        errno_t rc = async_req_0_1(exch, BD_GET_BLOCK_SIZE, &bsize);
    173173        async_exchange_end(exch);
    174174
     
    180180}
    181181
    182 int bd_get_num_blocks(bd_t *bd, aoff64_t *rnb)
     182errno_t bd_get_num_blocks(bd_t *bd, aoff64_t *rnb)
    183183{
    184184        sysarg_t nb_l;
     
    186186        async_exch_t *exch = async_exchange_begin(bd->sess);
    187187
    188         int rc = async_req_0_2(exch, BD_GET_NUM_BLOCKS, &nb_l, &nb_h);
     188        errno_t rc = async_req_0_2(exch, BD_GET_NUM_BLOCKS, &nb_l, &nb_h);
    189189        async_exchange_end(exch);
    190190
Note: See TracChangeset for help on using the changeset viewer.