Changeset 9b1baac in mainline for uspace/srv/loader/main.c


Ignore:
Timestamp:
2018-07-18T08:35:42Z (7 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/loader/main.c

    redc64c0 r9b1baac  
    399399int main(int argc, char *argv[])
    400400{
    401         async_set_fallback_port_handler(ldr_connection, NULL);
    402 
    403401        /* Introduce this task to the NS (give it our task ID). */
    404402        task_id_t id = task_get_id();
     
    407405                return rc;
    408406
    409         /* Create port */
    410         port_id_t port;
    411         rc = async_create_port(INTERFACE_LOADER, ldr_connection, NULL, &port);
     407        /* Register at naming service. */
     408        rc = service_register(SERVICE_LOADER, INTERFACE_LOADER,
     409            ldr_connection, NULL);
    412410        if (rc != EOK)
    413411                return rc;
    414412
    415         /* Register at naming service. */
    416         rc = service_register(SERVICE_LOADER);
    417         if (rc != EOK)
    418                 return rc;
    419 
    420413        async_manager();
    421414
Note: See TracChangeset for help on using the changeset viewer.