Changeset 7b616e2 in mainline for uspace/srv/ns/service.c


Ignore:
Timestamp:
2017-09-27T22:40:09Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d076f16
Parents:
8d6bcc8c
Message:

Name service should communicate using async.h.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/ns/service.c

    r8d6bcc8c r7b616e2  
    3131 */
    3232
    33 #include <ipc/ipc.h>
    3433#include <adt/hash_table.h>
    3534#include <assert.h>
     35#include <async.h>
    3636#include <errno.h>
    3737#include <stdio.h>
     
    4747        service_t service;
    4848       
    49         /** Phone registered with the interface */
    50         sysarg_t phone;
    51        
    52         /** Incoming phone hash */
    53         sysarg_t in_phone_hash;
     49        /** Session to the service */
     50        async_sess_t *sess;
    5451} hashed_service_t;
    5552
     
    121118               
    122119                hashed_service_t *hashed_service = hash_table_get_inst(link, hashed_service_t, link);
    123                 (void) ipc_forward_fast(pending->callid, hashed_service->phone,
    124                     pending->iface, pending->arg3, 0, IPC_FF_NONE);
     120                async_exch_t *exch = async_exchange_begin(hashed_service->sess);
     121                async_forward_fast(pending->callid, exch, pending->iface,
     122                    pending->arg3, 0, IPC_FF_NONE);
     123                async_exchange_end(exch);
    125124               
    126125                list_remove(&pending->link);
     
    151150       
    152151        hashed_service->service = service;
    153         hashed_service->phone = phone;
    154         hashed_service->in_phone_hash = call->in_phone_hash;
     152        hashed_service->sess = async_callback_receive(EXCHANGE_SERIALIZE);
     153        if (hashed_service->sess == NULL)
     154                return EIO;
    155155       
    156156        hash_table_insert(&service_hash_table, &hashed_service->link);
    157        
    158157        return EOK;
    159158}
     
    202201       
    203202        hashed_service_t *hashed_service = hash_table_get_inst(link, hashed_service_t, link);
    204         (void) ipc_forward_fast(callid, hashed_service->phone, iface, arg3,
    205             0, IPC_FF_NONE);
     203        async_exch_t *exch = async_exchange_begin(hashed_service->sess);
     204        async_forward_fast(callid, exch, iface, arg3, 0, IPC_FF_NONE);
     205        async_exchange_end(exch);
    206206        return;
    207207       
    208208out:
    209         if (!(callid & IPC_CALLID_NOTIFICATION))
    210                 ipc_answer_0(callid, retval);
     209        async_answer_0(callid, retval);
    211210}
    212211
Note: See TracChangeset for help on using the changeset viewer.