Ignore:
Timestamp:
2011-01-29T11:36:41Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0b6931a, 8add9ca5
Parents:
e26a4633 (diff), ffa2c8ef (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

IPC/async: strictly isolate the use of low-level IPC methods (ipc_*) and async framework methods (async_*) in user code, do not allow a mixture of both in a single source file

Benefits for future plans

  • The async framework could use different communication style under the hood, but keeping the same high-level API
  • The async framework can be integrated more tightly with sessions without potential problems of intermixing session-aware async methods with session-unaware low-level methods in user code
  • The async_serialize_start()/_end() can be deprecated more easily
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/part/guid_part/guid_part.c

    re26a4633 r46b881c  
    4747#include <stdlib.h>
    4848#include <unistd.h>
    49 #include <ipc/ipc.h>
    5049#include <ipc/bd.h>
    5150#include <async.h>
     
    335334
    336335        if (part == NULL) {
    337                 ipc_answer_0(iid, EINVAL);
     336                async_answer_0(iid, EINVAL);
    338337                return;
    339338        }
     
    342341
    343342        /* Answer the IPC_M_CONNECT_ME_TO call. */
    344         ipc_answer_0(iid, EOK);
     343        async_answer_0(iid, EOK);
    345344
    346345        if (!async_share_out_receive(&callid, &comm_size, &flags)) {
    347                 ipc_answer_0(callid, EHANGUP);
     346                async_answer_0(callid, EHANGUP);
    348347                return;
    349348        }
     
    351350        fs_va = as_get_mappable_page(comm_size);
    352351        if (fs_va == NULL) {
    353                 ipc_answer_0(callid, EHANGUP);
     352                async_answer_0(callid, EHANGUP);
    354353                return;
    355354        }
     
    363362                case IPC_M_PHONE_HUNGUP:
    364363                        /* The other side has hung up. */
    365                         ipc_answer_0(callid, EOK);
     364                        async_answer_0(callid, EOK);
    366365                        return;
    367366                case BD_READ_BLOCKS:
     
    386385                        break;
    387386                case BD_GET_BLOCK_SIZE:
    388                         ipc_answer_1(callid, EOK, block_size);
     387                        async_answer_1(callid, EOK, block_size);
    389388                        continue;
    390389                case BD_GET_NUM_BLOCKS:
    391                         ipc_answer_2(callid, EOK, LOWER32(part->length),
     390                        async_answer_2(callid, EOK, LOWER32(part->length),
    392391                            UPPER32(part->length));
    393392                        continue;
     
    396395                        break;
    397396                }
    398                 ipc_answer_0(callid, retval);
     397                async_answer_0(callid, retval);
    399398        }
    400399}
Note: See TracChangeset for help on using the changeset viewer.