Changeset 241f1985 in mainline for uspace/lib/c/generic/task_event.c


Ignore:
Timestamp:
2019-08-31T10:45:17Z (5 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

File:
1 edited

Legend:

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

    rf92b315 r241f1985  
    3737#include <macros.h>
    3838#include <task.h>
     39#include <assert.h>
    3940
    4041#include "private/taskman.h"
     
    4243static task_event_handler_t task_event_handler = NULL;
    4344
    44 static void taskman_task_event(ipc_callid_t iid, ipc_call_t *icall)
     45static void taskman_task_event(ipc_call_t *icall)
    4546{
    4647        task_id_t tid = (task_id_t)
    47             MERGE_LOUP32(IPC_GET_ARG1(*icall), IPC_GET_ARG2(*icall));
    48         int flags = IPC_GET_ARG3(*icall);
    49         task_exit_t texit = IPC_GET_ARG4(*icall);
    50         int retval = IPC_GET_ARG5(*icall);
     48            MERGE_LOUP32(ipc_get_arg1(icall), ipc_get_arg2(icall));
     49        int flags = ipc_get_arg3(icall);
     50        task_exit_t texit = ipc_get_arg4(icall);
     51        int retval = ipc_get_arg5(icall);
    5152
    5253        task_event_handler(tid, flags, texit, retval);
    5354
    54         async_answer_0(iid, EOK);
     55        async_answer_0(icall, EOK);
    5556}
    5657
    57 static void taskman_event_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
     58static void taskman_event_conn(ipc_call_t *icall, void *arg)
    5859{
    5960        /* Accept connection */
    60         async_answer_0(iid, EOK);
     61        async_answer_0(icall, EOK);
    6162
    6263        while (true) {
    6364                ipc_call_t call;
    64                 ipc_callid_t callid = async_get_call(&call);
    65 
    66                 if (!IPC_GET_IMETHOD(call)) {
     65               
     66                if (!async_get_call(&call) || !ipc_get_imethod(&call)) {
    6767                        /* Hangup, end of game */
    6868                        break;
    6969                }
    7070
    71                 switch (IPC_GET_IMETHOD(call)) {
     71                switch (ipc_get_imethod(&call)) {
    7272                case TASKMAN_EV_TASK:
    73                         taskman_task_event(callid, &call);
     73                        taskman_task_event(&call);
    7474                        break;
    7575                default:
    76                         async_answer_0(callid, ENOTSUP);
     76                        async_answer_0(&call, ENOTSUP);
    7777                        break;
    7878                }
     
    8383 * Blocks, calls handler in another fibril
    8484 */
    85 int task_register_event_handler(task_event_handler_t handler, bool past_events)
     85errno_t task_register_event_handler(task_event_handler_t handler, bool past_events)
    8686{
    8787        /*
     
    9797        aid_t req = async_send_1(exch, TASKMAN_EVENT_CALLBACK, past_events, NULL);
    9898
    99         int rc = async_connect_to_me(exch, 0, 0, 0, taskman_event_conn, NULL);
     99        port_id_t port;
     100        errno_t rc = async_create_callback_port(exch, INTERFACE_TASKMAN_CB, 0, 0,
     101                taskman_event_conn, NULL, &port);
    100102        taskman_exchange_end(exch);
    101103
     
    104106        }
    105107
    106         sysarg_t retval;
     108        errno_t retval;
    107109        async_wait_for(req, &retval);
    108110        return retval;
Note: See TracChangeset for help on using the changeset viewer.