Changeset 241f1985 in mainline for uspace/lib/c/generic/async


Ignore:
Timestamp:
2019-08-31T10:45:17Z (6 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
102f641
Parents:
f92b315
git-author:
Matthieu Riolo <matthieu.riolo@…> (2019-08-23 22:04:34)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-31 10:45:17)
Message:

Correcting failure from previous merge

The commits from Michal Koutný from the branch system-daemon
where built on a old version of Helenos. Because of this
many types and API functions have changed. This commit
upgrades the merge code

Location:
uspace/lib/c/generic/async
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/async/client.c

    rf92b315 r241f1985  
    9999#include <async.h>
    100100#include "../private/async.h"
    101 #include "../private/ns.h"
    102101#undef _LIBC_ASYNC_C_
    103102
     
    114113#include <stdbool.h>
    115114#include <stdlib.h>
     115#include <stdatomic.h>
    116116#include <mem.h>
    117 #include <stdlib.h>
    118117#include <macros.h>
    119118#include <as.h>
     
    174173    sysarg_t arg1, sysarg_t arg2, sysarg_t arg3)
    175174{
    176         async_sess_t *session = (async_sess_t *) malloc(sizeof(async_sess_t));
     175        async_sess_t *session = (async_sess_t *) calloc(1, sizeof(async_sess_t));
    177176
    178177        if (session != NULL) {
    179                 session->iface = 0;
    180178                session->mgmt = mgmt;
    181179                session->phone = phone;
     
    189187                list_initialize(&session->exch_list);
    190188                fibril_mutex_initialize(&session->mutex);
    191                 atomic_set(&session->refcnt, 0);
    192                 &session.exchanges = 0;
    193189        } else {
    194190                errno = ENOMEM;
     
    198194}
    199195
    200 int async_session_phone(async_sess_t *sess)
     196cap_phone_handle_t async_session_phone(async_sess_t *sess)
    201197{
    202198        return sess->phone;
     
    859855        }
    860856
    861         async_sess_t *sess = create_session(phone, mgmt, iface, arg2, arg3);
     857        async_sess_t *sess = create_session(phone, iface & IFACE_EXCHANGE_MASK, iface, arg2, arg3);
    862858        if (sess == NULL) {
    863859                ipc_hangup(phone);
    864860        }
     861        sess->iface = iface;
    865862
    866863        return sess;
     
    912909        if (rc != EOK) {
    913910                errno = rc;
    914                 free(sess);
    915911                return NULL;
    916912        }
    917913
    918         async_sess_t *sess = create_session(phone, mgmt, iface, arg2, arg3);
     914        async_sess_t *sess = create_session(phone, iface & IFACE_EXCHANGE_MASK, iface, arg2, arg3);
    919915        if (sess == NULL) {
    920916                ipc_hangup(phone);
    921917        }
     918        sess->iface = iface;
    922919
    923920        return sess;
  • uspace/lib/c/generic/async/server.c

    rf92b315 r241f1985  
    216216}
    217217
    218 static async_client_conn_t implicit_connection = NULL;
     218static async_port_handler_t implicit_connection = NULL;
     219
     220/** Setter for implicit_connection function pointer.
     221 *
     222 * @param conn Function that will implement a new connection fibril for
     223 *             unrouted calls.
     224 *
     225 */
     226void async_set_implicit_connection(async_port_handler_t conn)
     227{
     228        assert(implicit_connection == NULL);
     229        implicit_connection = conn;
     230}
     231
     232
    219233static fibril_rmutex_t client_mutex;
    220234static hash_table_t client_hash_table;
     
    969983                return;
    970984        } else if (implicit_connection != NULL) {
    971                 async_new_connection(call->in_task_id, call->in_phone_hash,
    972                     callid, call, implicit_connection, NULL);
     985                connection_t *conn = calloc(1, sizeof(connection_t));
     986                if (!conn) {
     987                        ipc_answer_0(call->cap_handle, ENOMEM);
     988                        return;
     989                }
     990
     991                async_new_connection(conn, call->task_id, call, implicit_connection, NULL);
    973992                return;
    974993        }
     
    17491768        async_sess_t *sess = create_session(phandle, mgmt, 0, 0, 0);
    17501769        if (sess == NULL) {
    1751                 ipc_hangup(phone);
     1770                ipc_hangup(phandle);
    17521771                async_answer_0(&call, errno);
    17531772        } else {
Note: See TracChangeset for help on using the changeset viewer.