Changeset 46b881c in mainline for uspace/srv/bd/file_bd/file_bd.c


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

    re26a4633 r46b881c  
    4141#include <stdio.h>
    4242#include <unistd.h>
    43 #include <ipc/ipc.h>
    4443#include <ipc/bd.h>
    4544#include <async.h>
     
    184183
    185184        /* Answer the IPC_M_CONNECT_ME_TO call. */
    186         ipc_answer_0(iid, EOK);
     185        async_answer_0(iid, EOK);
    187186
    188187        if (!async_share_out_receive(&callid, &comm_size, &flags)) {
    189                 ipc_answer_0(callid, EHANGUP);
     188                async_answer_0(callid, EHANGUP);
    190189                return;
    191190        }
     
    193192        fs_va = as_get_mappable_page(comm_size);
    194193        if (fs_va == NULL) {
    195                 ipc_answer_0(callid, EHANGUP);
     194                async_answer_0(callid, EHANGUP);
    196195                return;
    197196        }
     
    205204                case IPC_M_PHONE_HUNGUP:
    206205                        /* The other side has hung up. */
    207                         ipc_answer_0(callid, EOK);
     206                        async_answer_0(callid, EOK);
    208207                        return;
    209208                case BD_READ_BLOCKS:
     
    228227                        break;
    229228                case BD_GET_BLOCK_SIZE:
    230                         ipc_answer_1(callid, EOK, block_size);
     229                        async_answer_1(callid, EOK, block_size);
    231230                        continue;
    232231                case BD_GET_NUM_BLOCKS:
    233                         ipc_answer_2(callid, EOK, LOWER32(num_blocks),
     232                        async_answer_2(callid, EOK, LOWER32(num_blocks),
    234233                            UPPER32(num_blocks));
    235234                        continue;
     
    238237                        break;
    239238                }
    240                 ipc_answer_0(callid, retval);
     239                async_answer_0(callid, retval);
    241240        }
    242241}
Note: See TracChangeset for help on using the changeset viewer.