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/mbr_part/mbr_part.c

    re26a4633 r46b881c  
    5757#include <stdlib.h>
    5858#include <unistd.h>
    59 #include <ipc/ipc.h>
    6059#include <ipc/bd.h>
    6160#include <async.h>
     
    413412
    414413        if (part == NULL) {
    415                 ipc_answer_0(iid, EINVAL);
     414                async_answer_0(iid, EINVAL);
    416415                return;
    417416        }
     
    420419
    421420        /* Answer the IPC_M_CONNECT_ME_TO call. */
    422         ipc_answer_0(iid, EOK);
     421        async_answer_0(iid, EOK);
    423422
    424423        if (!async_share_out_receive(&callid, &comm_size, &flags)) {
    425                 ipc_answer_0(callid, EHANGUP);
     424                async_answer_0(callid, EHANGUP);
    426425                return;
    427426        }
     
    429428        fs_va = as_get_mappable_page(comm_size);
    430429        if (fs_va == NULL) {
    431                 ipc_answer_0(callid, EHANGUP);
     430                async_answer_0(callid, EHANGUP);
    432431                return;
    433432        }
     
    441440                case IPC_M_PHONE_HUNGUP:
    442441                        /* The other side has hung up. */
    443                         ipc_answer_0(callid, EOK);
     442                        async_answer_0(callid, EOK);
    444443                        return;
    445444                case BD_READ_BLOCKS:
     
    464463                        break;
    465464                case BD_GET_BLOCK_SIZE:
    466                         ipc_answer_1(callid, EOK, block_size);
     465                        async_answer_1(callid, EOK, block_size);
    467466                        continue;
    468467                case BD_GET_NUM_BLOCKS:
    469                         ipc_answer_2(callid, EOK, LOWER32(part->length),
     468                        async_answer_2(callid, EOK, LOWER32(part->length),
    470469                            UPPER32(part->length));
    471470                        continue;
     
    474473                        break;
    475474                }
    476                 ipc_answer_0(callid, retval);
     475                async_answer_0(callid, retval);
    477476        }
    478477}
Note: See TracChangeset for help on using the changeset viewer.