Changeset 9b1baac in mainline for uspace/srv/ns/clonable.c


Ignore:
Timestamp:
2018-07-18T08:35:42Z (6 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0b05082
Parents:
edc64c0
Message:

ns: register service interfaces individually

Each service interface is now registered individually with the naming
service. This adds a degree of type safety, potentially allows the
individual interfaces to be implemented by independent tasks and moves
the code slightly closer to the full-fledged ports design.

Broker services (e.g. the location service) can still register a
fallback port for receiving connections to all interface types
explicitly using service_register_broker().

File:
1 edited

Legend:

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

    redc64c0 r9b1baac  
    5454static list_t cs_req;
    5555
    56 errno_t clonable_init(void)
     56errno_t ns_clonable_init(void)
    5757{
    5858        list_initialize(&cs_req);
     
    6161
    6262/** Return true if @a service is clonable. */
    63 bool service_clonable(service_t service)
     63bool ns_service_is_clonable(service_t service, iface_t iface)
    6464{
    65         return (service == SERVICE_LOADER);
     65        return (service == SERVICE_LOADER) && (iface == INTERFACE_LOADER);
    6666}
    6767
    6868/** Register clonable service.
    6969 *
    70  * @param service Service to be registered.
    71  * @param phone   Phone to be used for connections to the service.
    72  * @param call    Pointer to call structure.
     70 * @param call Pointer to call structure.
    7371 *
    7472 */
    75 void register_clonable(service_t service, sysarg_t phone, ipc_call_t *call)
     73void ns_clonable_register(ipc_call_t *call)
    7674{
    7775        link_t *req_link = list_first(&cs_req);
     
    8785
    8886        /* Currently we can only handle a single type of clonable service. */
    89         assert(csr->service == SERVICE_LOADER);
     87        assert(ns_service_is_clonable(csr->service, csr->iface));
    9088
    9189        async_answer_0(call, EOK);
     
    113111 *
    114112 */
    115 void connect_to_clonable(service_t service, iface_t iface, ipc_call_t *call)
     113void ns_clonable_forward(service_t service, iface_t iface, ipc_call_t *call)
    116114{
    117         assert(service == SERVICE_LOADER);
     115        assert(ns_service_is_clonable(service, iface));
    118116
    119117        cs_req_t *csr = malloc(sizeof(cs_req_t));
Note: See TracChangeset for help on using the changeset viewer.