Changeset 338a1a76 in mainline
- Timestamp:
- 2020-01-09T01:03:40Z (5 years ago)
- Children:
- e7faeba
- Parents:
- 7dd7bc0
- git-author:
- Matthieu Riolo <matthieu.riolo@…> (2019-12-14 18:05:37)
- git-committer:
- Matthieu Riolo <matthieu.riolo@…> (2020-01-09 01:03:40)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
abi/include/abi/ipc/interfaces.h
r7dd7bc0 r338a1a76 186 186 INTERFACE_PCI = 187 187 FOURCC_COMPACT('p', 'c', 'i', ' ') | IFACE_EXCHANGE_SERIALIZE, 188 INTERFACE_SYSMAN = 189 FOURCC_COMPACT('s', 'y', 's', 'm') | IFACE_EXCHANGE_SERIALIZE, 188 190 INTERFACE_TASKMAN_CB = 189 FOURCC_COMPACT('t', 'a', 's', 'k') | IFACE_EXCHANGE_SERIALIZE | IFACE_MOD_CALLBACK, 190 INTERFACE_SYSMAN = 191 FOURCC_COMPACT('s', 'y', 's', 'm') | IFACE_EXCHANGE_SERIALIZE 191 FOURCC_COMPACT('t', 'a', 's', 'k') | IFACE_EXCHANGE_SERIALIZE | IFACE_MOD_CALLBACK 192 192 } iface_t; 193 193 -
uspace/lib/c/generic/task_event.c
r7dd7bc0 r338a1a76 41 41 #include "private/taskman.h" 42 42 43 static task_event_handler_t task_event_handler = NULL; 44 45 static void taskman_task_event(ipc_call_t *icall) 43 static void taskman_task_event(ipc_call_t *icall, task_event_handler_t handler) 46 44 { 47 45 task_id_t tid = (task_id_t) … … 51 49 int retval = ipc_get_arg5(icall); 52 50 53 task_event_handler(tid, flags, texit, retval);51 handler(tid, flags, texit, retval); 54 52 55 53 async_answer_0(icall, EOK); … … 58 56 static void taskman_event_conn(ipc_call_t *icall, void *arg) 59 57 { 60 /* Accept connection */61 async_answer_0(icall, EOK);62 63 58 while (true) { 64 59 ipc_call_t call; … … 66 61 if (!async_get_call(&call) || !ipc_get_imethod(&call)) { 67 62 /* Hangup, end of game */ 68 break; 63 async_answer_0(&call, EOK); 64 return; 69 65 } 70 66 71 67 switch (ipc_get_imethod(&call)) { 72 68 case TASKMAN_EV_TASK: 73 taskman_task_event(&call );69 taskman_task_event(&call, (task_event_handler_t)arg); 74 70 break; 75 71 default: … … 85 81 errno_t task_register_event_handler(task_event_handler_t handler, bool past_events) 86 82 { 87 /*88 * so far support assign once, modification cannot be naïve due to89 * races90 */91 assert(task_event_handler == NULL);92 83 assert(handler != NULL); /* no support for "unregistration" */ 93 94 task_event_handler = handler;95 84 96 85 async_exch_t *exch = taskman_exchange_begin(); … … 99 88 port_id_t port; 100 89 errno_t rc = async_create_callback_port(exch, INTERFACE_TASKMAN_CB, 0, 0, 101 taskman_event_conn, NULL, &port);90 taskman_event_conn, handler, &port); 102 91 taskman_exchange_end(exch); 103 92
Note:
See TracChangeset
for help on using the changeset viewer.