Changeset 0a8f070 in mainline for uspace/lib/c/generic/ns.c


Ignore:
Timestamp:
2019-08-07T02:33:03Z (5 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
fe86d9d
Parents:
103939e
git-author:
Michal Koutný <xm.koutny+hos@…> (2015-08-16 16:04:14)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-07 02:33:03)
Message:

Create taskman server (extracts task-related operations from naming service)

  • Exploits initial phones connected to spawn parent instead of NS.
  • session_ns changed to session_primary (setup during taskman-loader handshake).
  • Task creation moved from NS to taskman (no clonable services anymore).
  • Other task-related operations implementation is to come (task_retval is temporarily dummy).
  • Async framework: implicit connections — create fibrils for calls that arrived through initial phone.

Conflicts:

abi/include/abi/ipc/methods.h
boot/Makefile.common
uspace/Makefile
uspace/app/trace/ipcp.c
uspace/lib/c/generic/async.c
uspace/lib/c/generic/libc.c
uspace/lib/c/generic/loader.c
uspace/lib/c/generic/ns.c
uspace/lib/c/generic/private/async.h
uspace/lib/c/generic/private/ns.h
uspace/lib/c/generic/task.c
uspace/lib/c/include/async.h
uspace/lib/c/include/ipc/services.h
uspace/lib/c/include/ipc/taskman.h
uspace/lib/c/include/loader/pcb.h
uspace/lib/c/include/ns.h
uspace/srv/loader/main.c
uspace/srv/ns/clonable.c
uspace/srv/ns/ns.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/ns.c

    r103939e r0a8f070  
    4141
    4242/*
    43  * XXX ns does not know about session_ns, so we create an extra session for
     43 * XXX ns does not know about session_primary, so we create an extra session for
    4444 * actual communicaton
    4545 */
    46 static async_sess_t *sess_ns = NULL;
     46static async_sess_t *sess_primary = NULL;
    4747
    4848errno_t service_register(service_t service, iface_t iface,
    4949    async_port_handler_t handler, void *data)
    5050{
    51         async_sess_t *sess = ns_session_get();
     51        async_sess_t *sess = get_session_primary();
    5252        if (sess == NULL)
    5353                return EIO;
     
    8181        async_set_fallback_port_handler(handler, data);
    8282
    83         async_sess_t *sess = ns_session_get();
     83        async_sess_t *sess = get_session_primary();
    8484        if (sess == NULL)
    8585                return EIO;
     
    105105async_sess_t *service_connect(service_t service, iface_t iface, sysarg_t arg3)
    106106{
    107         async_sess_t *sess = ns_session_get();
     107        async_sess_t *sess = get_session_primary();
    108108        if (sess == NULL)
    109109                return NULL;
     
    133133    sysarg_t arg3)
    134134{
    135         async_sess_t *sess = ns_session_get();
     135        async_sess_t *sess = get_session_primary();
    136136        if (sess == NULL)
    137137                return NULL;
     
    157157errno_t ns_ping(void)
    158158{
    159         async_sess_t *sess = ns_session_get();
     159        async_sess_t *sess = get_session_primary();
    160160        if (sess == NULL)
    161161                return EIO;
     
    168168}
    169169
    170 errno_t ns_intro(task_id_t id)
    171 {
    172         async_exch_t *exch;
    173         async_sess_t *sess = ns_session_get();
    174         if (sess == NULL)
    175                 return EIO;
    176170
    177         exch = async_exchange_begin(sess);
    178         errno_t rc = async_req_2_0(exch, NS_ID_INTRO, LOWER32(id), UPPER32(id));
    179         async_exchange_end(exch);
    180 
    181         return rc;
    182 }
    183 
    184 async_sess_t *ns_session_get(void)
     171async_sess_t *get_session_primary(void)
    185172{
    186173        async_exch_t *exch;
    187174
    188         if (sess_ns == NULL) {
    189                 exch = async_exchange_begin(&session_ns);
    190                 sess_ns = async_connect_me_to(exch, 0, 0, 0);
     175        if (sess_primary == NULL) {
     176                exch = async_exchange_begin(&session_primary);
     177                sess_primary = async_connect_me_to(exch, 0, 0, 0);
    191178                async_exchange_end(exch);
    192                 if (sess_ns == NULL)
     179                if (sess_primary == NULL)
    193180                        return NULL;
    194181        }
    195182
    196         return sess_ns;
     183        return sess_primary;
    197184}
    198185
Note: See TracChangeset for help on using the changeset viewer.