Ignore:
Timestamp:
2019-02-06T13:25:12Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fafb8e5
Parents:
bb97118
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-02 14:04:02)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-06 13:25:12)
Message:

Change IPC_GET_* and IPC_SET_* to accept pointer instead of lvalue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/udebug/udebug_ipc.c

    rbb97118 reb13ef8  
    5353errno_t udebug_request_preprocess(call_t *call, phone_t *phone)
    5454{
    55         switch (IPC_GET_ARG1(call->data)) {
     55        switch (IPC_GET_ARG1(&call->data)) {
    5656                /* future UDEBUG_M_REGS_WRITE, UDEBUG_M_MEM_WRITE: */
    5757        default:
     
    7676        rc = udebug_begin(call, &active);
    7777        if (rc != EOK) {
    78                 IPC_SET_RETVAL(call->data, rc);
     78                IPC_SET_RETVAL(&call->data, rc);
    7979                ipc_answer(&TASK->kb.box, call);
    8080                return;
     
    8686         */
    8787        if (active) {
    88                 IPC_SET_RETVAL(call->data, EOK);
     88                IPC_SET_RETVAL(&call->data, EOK);
    8989                ipc_answer(&TASK->kb.box, call);
    9090        }
     
    102102        rc = udebug_end();
    103103
    104         IPC_SET_RETVAL(call->data, rc);
     104        IPC_SET_RETVAL(&call->data, rc);
    105105        ipc_answer(&TASK->kb.box, call);
    106106}
     
    116116        udebug_evmask_t mask;
    117117
    118         mask = IPC_GET_ARG2(call->data);
     118        mask = IPC_GET_ARG2(&call->data);
    119119        rc = udebug_set_evmask(mask);
    120120
    121         IPC_SET_RETVAL(call->data, rc);
     121        IPC_SET_RETVAL(&call->data, rc);
    122122        ipc_answer(&TASK->kb.box, call);
    123123}
     
    133133        errno_t rc;
    134134
    135         t = (thread_t *)IPC_GET_ARG2(call->data);
     135        t = (thread_t *)IPC_GET_ARG2(&call->data);
    136136
    137137        rc = udebug_go(t, call);
    138138        if (rc != EOK) {
    139                 IPC_SET_RETVAL(call->data, rc);
     139                IPC_SET_RETVAL(&call->data, rc);
    140140                ipc_answer(&TASK->kb.box, call);
    141141                return;
     
    153153        errno_t rc;
    154154
    155         t = (thread_t *)IPC_GET_ARG2(call->data);
     155        t = (thread_t *)IPC_GET_ARG2(&call->data);
    156156
    157157        rc = udebug_stop(t, call);
    158         IPC_SET_RETVAL(call->data, rc);
     158        IPC_SET_RETVAL(&call->data, rc);
    159159        ipc_answer(&TASK->kb.box, call);
    160160}
     
    173173        errno_t rc;
    174174
    175         uspace_addr = IPC_GET_ARG2(call->data); /* Destination address */
    176         buf_size = IPC_GET_ARG3(call->data);    /* Dest. buffer size */
     175        uspace_addr = IPC_GET_ARG2(&call->data);        /* Destination address */
     176        buf_size = IPC_GET_ARG3(&call->data);   /* Dest. buffer size */
    177177
    178178        /*
     
    182182        rc = udebug_thread_read(&buffer, buf_size, &copied, &needed);
    183183        if (rc != EOK) {
    184                 IPC_SET_RETVAL(call->data, rc);
     184                IPC_SET_RETVAL(&call->data, rc);
    185185                ipc_answer(&TASK->kb.box, call);
    186186                return;
     
    191191         */
    192192
    193         IPC_SET_RETVAL(call->data, 0);
    194         /*
    195          * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
    196          * same code in process_answer() can be used
    197          * (no way to distinguish method in answer)
    198          */
    199         IPC_SET_ARG1(call->data, uspace_addr);
    200         IPC_SET_ARG2(call->data, copied);
    201         IPC_SET_ARG3(call->data, needed);
     193        IPC_SET_RETVAL(&call->data, 0);
     194        /*
     195         * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
     196         * same code in process_answer() can be used
     197         * (no way to distinguish method in answer)
     198         */
     199        IPC_SET_ARG1(&call->data, uspace_addr);
     200        IPC_SET_ARG2(&call->data, copied);
     201        IPC_SET_ARG3(&call->data, needed);
    202202        call->buffer = buffer;
    203203
     
    219219        void *data;
    220220
    221         uspace_addr = IPC_GET_ARG2(call->data); /* Destination address */
    222         buf_size = IPC_GET_ARG3(call->data);    /* Dest. buffer size */
     221        uspace_addr = IPC_GET_ARG2(&call->data);        /* Destination address */
     222        buf_size = IPC_GET_ARG3(&call->data);   /* Dest. buffer size */
    223223
    224224        /*
     
    238238         */
    239239
    240         IPC_SET_RETVAL(call->data, 0);
    241         /*
    242          * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
    243          * same code in process_answer() can be used
    244          * (no way to distinguish method in answer)
    245          */
    246         IPC_SET_ARG1(call->data, uspace_addr);
    247         IPC_SET_ARG2(call->data, to_copy);
    248 
    249         IPC_SET_ARG3(call->data, data_size);
     240        IPC_SET_RETVAL(&call->data, 0);
     241        /*
     242         * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
     243         * same code in process_answer() can be used
     244         * (no way to distinguish method in answer)
     245         */
     246        IPC_SET_ARG1(&call->data, uspace_addr);
     247        IPC_SET_ARG2(&call->data, to_copy);
     248
     249        IPC_SET_ARG3(&call->data, data_size);
    250250        call->buffer = data;
    251251
     
    268268        as_area_info_t *data;
    269269
    270         uspace_addr = IPC_GET_ARG2(call->data); /* Destination address */
    271         buf_size = IPC_GET_ARG3(call->data);    /* Dest. buffer size */
     270        uspace_addr = IPC_GET_ARG2(&call->data);        /* Destination address */
     271        buf_size = IPC_GET_ARG3(&call->data);   /* Dest. buffer size */
    272272
    273273        /*
     
    276276        data = as_get_area_info(AS, &data_size);
    277277        if (!data) {
    278                 IPC_SET_RETVAL(call->data, ENOMEM);
     278                IPC_SET_RETVAL(&call->data, ENOMEM);
    279279                ipc_answer(&TASK->kb.box, call);
    280280                return;
     
    292292         */
    293293
    294         IPC_SET_RETVAL(call->data, 0);
    295         /*
    296          * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
    297          * same code in process_answer() can be used
    298          * (no way to distinguish method in answer)
    299          */
    300         IPC_SET_ARG1(call->data, uspace_addr);
    301         IPC_SET_ARG2(call->data, to_copy);
    302 
    303         IPC_SET_ARG3(call->data, data_size);
     294        IPC_SET_RETVAL(&call->data, 0);
     295        /*
     296         * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
     297         * same code in process_answer() can be used
     298         * (no way to distinguish method in answer)
     299         */
     300        IPC_SET_ARG1(&call->data, uspace_addr);
     301        IPC_SET_ARG2(&call->data, to_copy);
     302
     303        IPC_SET_ARG3(&call->data, data_size);
    304304        call->buffer = (uint8_t *) data;
    305305
     
    319319        void *buffer;
    320320
    321         t = (thread_t *)IPC_GET_ARG2(call->data);
     321        t = (thread_t *)IPC_GET_ARG2(&call->data);
    322322
    323323        rc = udebug_args_read(t, &buffer);
    324324        if (rc != EOK) {
    325                 IPC_SET_RETVAL(call->data, rc);
     325                IPC_SET_RETVAL(&call->data, rc);
    326326                ipc_answer(&TASK->kb.box, call);
    327327                return;
     
    332332         */
    333333
    334         uspace_addr = IPC_GET_ARG3(call->data);
    335 
    336         IPC_SET_RETVAL(call->data, 0);
    337         /*
    338          * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
    339          * same code in process_answer() can be used
    340          * (no way to distinguish method in answer)
    341          */
    342         IPC_SET_ARG1(call->data, uspace_addr);
    343         IPC_SET_ARG2(call->data, 6 * sizeof(sysarg_t));
     334        uspace_addr = IPC_GET_ARG3(&call->data);
     335
     336        IPC_SET_RETVAL(&call->data, 0);
     337        /*
     338         * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
     339         * same code in process_answer() can be used
     340         * (no way to distinguish method in answer)
     341         */
     342        IPC_SET_ARG1(&call->data, uspace_addr);
     343        IPC_SET_ARG2(&call->data, 6 * sizeof(sysarg_t));
    344344        call->buffer = buffer;
    345345
     
    359359        errno_t rc;
    360360
    361         t = (thread_t *) IPC_GET_ARG2(call->data);
     361        t = (thread_t *) IPC_GET_ARG2(&call->data);
    362362
    363363        rc = udebug_regs_read(t, &buffer);
    364364        if (rc != EOK) {
    365                 IPC_SET_RETVAL(call->data, rc);
     365                IPC_SET_RETVAL(&call->data, rc);
    366366                ipc_answer(&TASK->kb.box, call);
    367367                return;
     
    374374         */
    375375
    376         uspace_addr = IPC_GET_ARG3(call->data);
     376        uspace_addr = IPC_GET_ARG3(&call->data);
    377377        to_copy = sizeof(istate_t);
    378378
    379         IPC_SET_RETVAL(call->data, 0);
    380         /*
    381          * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
    382          * same code in process_answer() can be used
    383          * (no way to distinguish method in answer)
    384          */
    385         IPC_SET_ARG1(call->data, uspace_addr);
    386         IPC_SET_ARG2(call->data, to_copy);
     379        IPC_SET_RETVAL(&call->data, 0);
     380        /*
     381         * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
     382         * same code in process_answer() can be used
     383         * (no way to distinguish method in answer)
     384         */
     385        IPC_SET_ARG1(&call->data, uspace_addr);
     386        IPC_SET_ARG2(&call->data, to_copy);
    387387
    388388        call->buffer = buffer;
     
    404404        errno_t rc;
    405405
    406         uspace_dst = IPC_GET_ARG2(call->data);
    407         uspace_src = IPC_GET_ARG3(call->data);
    408         size = IPC_GET_ARG4(call->data);
     406        uspace_dst = IPC_GET_ARG2(&call->data);
     407        uspace_src = IPC_GET_ARG3(&call->data);
     408        size = IPC_GET_ARG4(&call->data);
    409409
    410410        rc = udebug_mem_read(uspace_src, size, &buffer);
    411411        if (rc != EOK) {
    412                 IPC_SET_RETVAL(call->data, rc);
     412                IPC_SET_RETVAL(&call->data, rc);
    413413                ipc_answer(&TASK->kb.box, call);
    414414                return;
     
    417417        assert(buffer != NULL);
    418418
    419         IPC_SET_RETVAL(call->data, 0);
    420         /*
    421          * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
    422          * same code in process_answer() can be used
    423          * (no way to distinguish method in answer)
    424          */
    425         IPC_SET_ARG1(call->data, uspace_dst);
    426         IPC_SET_ARG2(call->data, size);
     419        IPC_SET_RETVAL(&call->data, 0);
     420        /*
     421         * ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
     422         * same code in process_answer() can be used
     423         * (no way to distinguish method in answer)
     424         */
     425        IPC_SET_ARG1(&call->data, uspace_dst);
     426        IPC_SET_ARG2(&call->data, size);
    427427        call->buffer = buffer;
    428428
     
    439439        int debug_method;
    440440
    441         debug_method = IPC_GET_ARG1(call->data);
     441        debug_method = IPC_GET_ARG1(&call->data);
    442442
    443443        if (debug_method != UDEBUG_M_BEGIN) {
     
    450450                 */
    451451                if (TASK->udebug.debugger != call->sender) {
    452                         IPC_SET_RETVAL(call->data, EINVAL);
     452                        IPC_SET_RETVAL(&call->data, EINVAL);
    453453                        ipc_answer(&TASK->kb.box, call);
    454454                        return;
Note: See TracChangeset for help on using the changeset viewer.