Changeset 012dd8e in mainline for uspace/lib/c
- Timestamp:
- 2019-08-07T09:15:30Z (6 years ago)
- Children:
- e8747bd8
- Parents:
- 780c8ce
- git-author:
- Michal Koutný <xm.koutny+hos@…> (2015-11-01 00:08:04)
- git-committer:
- Matthieu Riolo <matthieu.riolo@…> (2019-08-07 09:15:30)
- Location:
- uspace/lib/c
- Files:
-
- 18 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/async/client.c
r780c8ce r012dd8e 124 124 static fibril_rmutex_t message_mutex; 125 125 126 /** Primary session (spawn parent, later naming service) */127 async_sess_t *session_primary = NULL;128 129 126 /** Message data */ 130 127 typedef struct { … … 169 166 170 167 171 static async_sess_t *create_session_primary(void) 168 /** Create session for existing phone 169 * 170 * @return session on success, NULL on error 171 */ 172 173 async_sess_t *create_session(cap_phone_handle_t phone, exch_mgmt_t mgmt, 174 sysarg_t arg1, sysarg_t arg2, sysarg_t arg3) 172 175 { 173 176 async_sess_t *session = (async_sess_t *) malloc(sizeof(async_sess_t)); 174 177 175 178 if (session != NULL) { 176 // TODO extract common part with async_connect_me_to 177 session_ns->iface = 0; 178 session->mgmt = EXCHANGE_ATOMIC; 179 session->phone = PHONE_INITIAL; 180 session->arg1 = 0; 181 session->arg2 = 0; 182 session->arg3 = 0; 179 session->iface = 0; 180 session->mgmt = mgmt; 181 session->phone = phone; 182 session->arg1 = arg1; 183 session->arg2 = arg2; 184 session->arg3 = arg3; 183 185 184 186 fibril_mutex_initialize(&session->remote_state_mtx); … … 189 191 atomic_set(&session->refcnt, 0); 190 192 &session.exchanges = 0; 193 } else { 194 errno = ENOMEM; 191 195 } 192 196 … … 196 200 197 201 /** Initialize the async framework. 198 * @param arg_session_primary Primary session (to naming service). 199 * 200 */ 201 void __async_client_init(async_sess_t *arg_session_primary) 202 * 203 */ 204 void __async_client_init(void) 202 205 { 203 206 if (fibril_rmutex_initialize(&message_mutex) != EOK) 204 abort();205 206 if (arg_session_primary == NULL) {207 session_primary = create_session_primary();208 } else {209 session_primary = arg_session_primary;210 }211 212 if (session_primary == NULL)213 207 abort(); 214 208 } … … 832 826 } 833 827 834 /** Injects another session instead of original primary session835 *836 * @param session Session to naming service.837 *838 * @return old primary session (to spawn parent)839 */840 async_sess_t *async_session_primary_swap(async_sess_t *session)841 {842 assert(session_primary->phone == PHONE_INITIAL);843 844 async_sess_t *old_primary = session_primary;845 session_primary = session;846 return old_primary;847 }848 849 828 /** Wrapper for making IPC_M_CONNECT_ME_TO calls using the async framework. 850 829 * … … 865 844 if (exch == NULL) { 866 845 errno = ENOENT; 867 return NULL;868 }869 870 async_sess_t *sess = calloc(1, sizeof(async_sess_t));871 if (sess == NULL) {872 errno = ENOMEM;873 846 return NULL; 874 847 } … … 879 852 if (rc != EOK) { 880 853 errno = rc; 881 free(sess);882 854 return NULL; 883 855 } 884 856 885 sess->iface = iface; 886 sess->phone = phone; 887 sess->arg1 = iface; 888 sess->arg2 = arg2; 889 sess->arg3 = arg3; 890 891 fibril_mutex_initialize(&sess->remote_state_mtx); 892 list_initialize(&sess->exch_list); 893 fibril_mutex_initialize(&sess->mutex); 857 async_sess_t *sess = create_session(phone, mgmt, iface, arg2, arg3); 858 if (sess == NULL) { 859 ipc_hangup(phone); 860 } 894 861 895 862 return sess; … … 933 900 if (exch == NULL) { 934 901 errno = ENOENT; 935 return NULL;936 }937 938 async_sess_t *sess = calloc(1, sizeof(async_sess_t));939 if (sess == NULL) {940 errno = ENOMEM;941 902 return NULL; 942 903 } … … 951 912 } 952 913 953 sess->iface = iface; 954 sess->phone = phone; 955 sess->arg1 = iface; 956 sess->arg2 = arg2; 957 sess->arg3 = arg3; 958 959 fibril_mutex_initialize(&sess->remote_state_mtx); 960 list_initialize(&sess->exch_list); 961 fibril_mutex_initialize(&sess->mutex); 914 async_sess_t *sess = create_session(phone, mgmt, iface, arg2, arg3); 915 if (sess == NULL) { 916 ipc_hangup(phone); 917 } 962 918 963 919 return sess; … … 969 925 async_sess_t *async_connect_kbox(task_id_t id) 970 926 { 971 async_sess_t *sess = calloc(1, sizeof(async_sess_t));972 if (sess == NULL) {973 errno = ENOMEM;974 return NULL;975 }976 977 927 cap_phone_handle_t phone; 978 928 errno_t rc = ipc_connect_kbox(id, &phone); 979 929 if (rc != EOK) { 980 930 errno = rc; 981 free(sess);982 931 return NULL; 983 932 } 984 933 985 sess->iface = 0; 986 sess->mgmt = EXCHANGE_ATOMIC; 987 sess->phone = phone; 988 989 fibril_mutex_initialize(&sess->remote_state_mtx); 990 list_initialize(&sess->exch_list); 991 fibril_mutex_initialize(&sess->mutex); 934 async_sess_t *sess = create_session(phone, EXCHANGE_ATOMIC, 0, 0, 0); 935 if (sess == NULL) { 936 ipc_hangup(phone); 937 } 992 938 993 939 return sess; -
uspace/lib/c/generic/async/server.c
r780c8ce r012dd8e 391 391 * calls routed through that phone. 392 392 * @param in_task_id Identification of the incoming connection. 393 * @param call Call data of the opening call. If call is NULL, the 394 * connection was opened by accepting the 395 * IPC_M_CONNECT_TO_ME call and this function is called 396 * directly by the server. 393 * @param call Call data of the opening call. If call is NULL, it's 394 * either a callback connection that was opened by 395 * accepting the IPC_M_CONNECT_TO_ME call. 396 * Alternatively, it is zero when we are opening 397 * implicit connection. 397 398 * @param handler Connection handler. 398 399 * @param data Client argument to pass to the connection handler. … … 1746 1747 } 1747 1748 1748 async_sess_t *sess = c alloc(1, sizeof(async_sess_t));1749 async_sess_t *sess = create_session(phandle, mgmt, 0, 0, 0); 1749 1750 if (sess == NULL) { 1750 async_answer_0(&call, ENOMEM); 1751 return NULL; 1752 } 1753 1754 sess->iface = 0; 1755 sess->mgmt = mgmt; 1756 sess->phone = phandle; 1757 1758 fibril_mutex_initialize(&sess->remote_state_mtx); 1759 list_initialize(&sess->exch_list); 1760 fibril_mutex_initialize(&sess->mutex); 1761 1762 /* Acknowledge the connected phone */ 1763 async_answer_0(&call, EOK); 1751 ipc_hangup(phone); 1752 async_answer_0(&call, errno); 1753 } else { 1754 /* Acknowledge the connected phone */ 1755 async_answer_0(&call, EOK); 1756 } 1764 1757 1765 1758 return sess; … … 1788 1781 return NULL; 1789 1782 1790 async_sess_t *sess = calloc(1, sizeof(async_sess_t)); 1791 if (sess == NULL) 1792 return NULL; 1793 1794 sess->iface = 0; 1795 sess->mgmt = mgmt; 1796 sess->phone = phandle; 1797 1798 fibril_mutex_initialize(&sess->remote_state_mtx); 1799 list_initialize(&sess->exch_list); 1800 fibril_mutex_initialize(&sess->mutex); 1801 1802 return sess; 1783 return create_session(phandle, mgmt, 0, 0, 0); 1803 1784 } 1804 1785 -
uspace/lib/c/generic/libc.c
r780c8ce r012dd8e 51 51 #include "private/fibril.h" 52 52 #include "private/malloc.h" 53 #include "private/ns.h" // TODO maybe better filename for session_primary54 53 #include "private/task.h" 54 #include "private/taskman.h" 55 55 56 56 … … 63 63 static bool env_setup; 64 64 static fibril_t main_fibril; 65 66 static void initialize_taskman(pcb_t *pcb) 67 { 68 if (__pcb == NULL) { 69 async_sess_t *session_tm = taskman_connect(); 70 if (session_tm == NULL) { 71 abort(); 72 } 73 __task_init(session_tm); 74 } else { 75 __task_init(__pcb->session_taskman); 76 } 77 } 65 78 66 79 void __libc_main(void *pcb_ptr) … … 107 120 #endif 108 121 109 /* Setup async framework */122 /* Setup async framework and taskman connection */ 110 123 __async_server_init(); 111 if (__pcb == NULL) { 112 __async_client_init(NULL); 113 __task_init(NULL); 114 } else { 115 __async_client_init(__pcb->session_primary); 116 __task_init(__pcb->session_taskman); 117 } 124 __async_client_init(); 118 125 __async_ports_init(); 126 initialize_taskman(__pcb); 119 127 120 128 /* The basic run-time environment is setup */ -
uspace/lib/c/generic/loader.c
r780c8ce r012dd8e 45 45 #include <task.h> 46 46 #include <vfs/vfs.h> 47 47 48 #include "private/loader.h" 49 #include "private/taskman.h" 48 50 49 51 /** Connect to a new program loader. … … 66 68 if (ldr == NULL) 67 69 return NULL; 68 69 async_sess_t *sess = 70 service_connect_blocking(SERVICE_TASKMAN, TASKMAN_CONNECT_TO_LOADER, 0); 70 71 async_sess_t *sess = taskman_session_loader(); 71 72 if (sess == NULL) { 72 73 free(ldr); -
uspace/lib/c/generic/ns.c
r780c8ce r012dd8e 38 38 #include <macros.h> 39 39 #include <errno.h> 40 #include "private/ns.h" 40 41 #include "private/taskman.h" 42 43 static async_sess_t *session_ns = NULL; 44 45 static async_exch_t *ns_exchange_begin(void) 46 { 47 /* Lazily connect to our NS */ 48 if (session_ns == NULL) { 49 session_ns = taskman_session_ns(); 50 } 51 52 async_exch_t *exch = async_exchange_begin(session_ns); 53 return exch; 54 } 55 56 static void ns_exchange_end(async_exch_t *exch) 57 { 58 async_exchange_end(exch); 59 } 41 60 42 61 /* … … 49 68 async_port_handler_t handler, void *data) 50 69 { 51 async_sess_t *sess = get_session_primary();52 if (sess == NULL)53 return EIO;54 55 70 port_id_t port; 56 71 errno_t rc = async_create_port(iface, handler, data, &port); … … 58 73 return rc; 59 74 60 async_exch_t *exch = async_exchange_begin(sess);75 async_exch_t *exch = ns_exchange_begin(); 61 76 62 77 ipc_call_t answer; … … 64 79 rc = async_connect_to_me(exch, iface, service, 0); 65 80 66 async_exchange_end(exch);81 ns_exchange_end(exch); 67 82 68 83 if (rc != EOK) { … … 105 120 async_sess_t *service_connect(service_t service, iface_t iface, sysarg_t arg3) 106 121 { 107 async_sess_t *sess = get_session_primary(); 108 if (sess == NULL) 109 return NULL; 110 111 async_exch_t *exch = async_exchange_begin(sess); 122 async_exch_t *exch = ns_exchange_begin(); 112 123 if (exch == NULL) 113 124 return NULL; 114 125 115 async_sess_t * csess =126 async_sess_t *sess = 116 127 async_connect_me_to(exch, iface, service, arg3); 117 async_exchange_end(exch);128 ns_exchange_end(exch); 118 129 119 if ( csess == NULL)130 if (sess == NULL) 120 131 return NULL; 121 132 … … 125 136 * first argument for non-initial connections. 126 137 */ 127 async_sess_args_set( csess, iface, arg3, 0);138 async_sess_args_set(sess, iface, arg3, 0); 128 139 129 140 return csess; … … 133 144 sysarg_t arg3) 134 145 { 135 async_sess_t *sess = get_session_primary(); 146 async_exch_t *exch = ns_exchange_begin(); 147 async_sess_t *sess = 148 async_connect_me_to_blocking(exch, iface, service, arg3); 149 ns_exchange_end(exch); 150 136 151 if (sess == NULL) 137 return NULL;138 139 async_exch_t *exch = async_exchange_begin(sess);140 async_sess_t *csess =141 async_connect_me_to_blocking(exch, iface, service, arg3);142 async_exchange_end(exch);143 144 if (csess == NULL)145 152 return NULL; 146 153 … … 150 157 * first argument for non-initial connections. 151 158 */ 152 async_sess_args_set( csess, iface, arg3, 0);159 async_sess_args_set(sess, iface, arg3, 0); 153 160 154 return csess;161 return sess; 155 162 } 156 163 157 164 errno_t ns_ping(void) 158 165 { 159 async_sess_t *sess = get_session_primary(); 160 if (sess == NULL) 161 return EIO; 162 163 async_exch_t *exch = async_exchange_begin(sess); 166 async_exch_t *exch = ns_exchange_begin(sess); 164 167 errno_t rc = async_req_0_0(exch, NS_PING); 165 async_exchange_end(exch);168 ns_exchange_end(exch); 166 169 167 170 return rc; 168 171 } 169 172 170 171 async_sess_t *get_session_primary(void)172 {173 async_exch_t *exch;174 175 if (sess_primary == NULL) {176 exch = async_exchange_begin(&session_primary);177 sess_primary = async_connect_me_to(exch, 0, 0, 0);178 async_exchange_end(exch);179 if (sess_primary == NULL)180 return NULL;181 }182 183 return sess_primary;184 }185 186 173 /** @} 187 174 */ -
uspace/lib/c/generic/private/async.h
r780c8ce r012dd8e 96 96 extern void __async_server_init(void); 97 97 extern void __async_server_fini(void); 98 extern void __async_client_init( async_sess_t *);98 extern void __async_client_init(void); 99 99 extern void __async_client_fini(void); 100 100 extern void __async_ports_init(void); … … 106 106 107 107 extern void async_reply_received(ipc_call_t *); 108 extern async_sess_t *create_session(int, exch_mgmt_t, 109 sysarg_t, sysarg_t, sysarg_t); 108 110 109 111 #endif -
uspace/lib/c/generic/private/task.h
r780c8ce r012dd8e 36 36 #define LIBC_PRIVATE_TASK_H_ 37 37 38 #include <async.h>39 40 void __task_init(async_sess_t *);41 42 38 int task_retval_internal(int, bool); 43 44 async_exch_t *taskman_exchange_begin(void);45 46 void taskman_exchange_end(async_exch_t *);47 39 48 40 #endif -
uspace/lib/c/generic/private/taskman.h
r780c8ce r012dd8e 1 1 /* 2 * Copyright (c) 201 1 Martin Decky2 * Copyright (c) 2015 Michal Koutny 3 3 * All rights reserved. 4 4 * … … 33 33 */ 34 34 35 #ifndef _LIBC_PRIVATE_NS_H_36 #define _LIBC_PRIVATE_NS_H_35 #ifndef LIBC_PRIVATE_TASKMAN_H_ 36 #define LIBC_PRIVATE_TASKMAN_H_ 37 37 38 38 #include <async.h> 39 39 40 extern async_sess_t *session_primary; 40 extern async_sess_t *session_taskman; 41 42 void __task_init(async_sess_t *); 43 44 async_exch_t *taskman_exchange_begin(void); 45 void taskman_exchange_end(async_exch_t *); 46 47 extern async_sess_t *taskman_connect(void); 48 extern async_sess_t *taskman_session_ns(void); 49 extern async_sess_t *taskman_session_loader(void); 41 50 42 51 #endif -
uspace/lib/c/generic/task.c
r780c8ce r012dd8e 49 49 #include <str.h> 50 50 #include <task.h> 51 #include <taskman.h> 51 52 #include <vfs/vfs.h> 52 #include "private/ns.h" 53 53 54 #include "private/task.h" 54 55 static async_sess_t *session_taskman = NULL; 55 #include "private/taskman.h" 56 56 57 57 task_id_t task_get_id(void) … … 69 69 } 70 70 71 async_exch_t *taskman_exchange_begin(void)72 {73 /* Lazy connection */74 if (session_taskman == NULL) {75 // TODO unify exchange mgmt with taskman_handshake/__init76 session_taskman = service_connect_blocking(EXCHANGE_SERIALIZE,77 SERVICE_TASKMAN,78 TASKMAN_CONTROL,79 0);80 }81 82 if (session_taskman == NULL) {83 return NULL;84 }85 86 async_exch_t *exch = async_exchange_begin(session_taskman);87 return exch;88 }89 90 void taskman_exchange_end(async_exch_t *exch)91 {92 async_exchange_end(exch);93 }94 95 71 /** Set the task name. 96 72 * … … 129 105 * 130 106 * @return EOK on success, else error code. 131 * @return TODO check this doesn't return EINVAL -- clash with task_wait132 107 */ 133 108 static errno_t task_setup_wait(task_id_t id, task_wait_t *wait) … … 393 368 * (it can be reused, but must be reinitialized with task_setup_wait first) 394 369 * 395 * @param wait task_wait_t previously initialized by task_setup_wait. 396 * @param texit Store type of task exit here. 397 * @param retval Store return value of the task here. 370 * @param[in/out] wait task_wait_t previously initialized by task_setup_wait 371 * or returned by task_wait with non-zero flags. the 372 * flags are updated so that they represent what can be 373 * still waited for. 374 * @param[out] texit Store type of task exit here. 375 * @param[out] retval Store return value of the task here. 398 376 * 399 377 * @return EOK on success 400 * @return EIN VAL on lost wait TODO other error codes378 * @return EINTR on lost wait 401 379 */ 402 380 errno_t task_wait(task_wait_t *wait, task_exit_t *texit, int *retval) … … 405 383 async_wait_for(wait->aid, &rc); 406 384 407 if (rc == EOK || rc == EIN VAL) {385 if (rc == EOK || rc == EINTR) { 408 386 if (wait->flags & TASK_WAIT_EXIT && texit) 409 387 *texit = ipc_get_arg1(wait->result); … … 471 449 } 472 450 473 void __task_init(async_sess_t *sess)474 {475 assert(session_taskman == NULL);476 session_taskman = sess;477 }478 479 451 /** @} 480 452 */ -
uspace/lib/c/generic/task_event.c
r780c8ce r012dd8e 38 38 #include <task.h> 39 39 40 #include "private/task .h"40 #include "private/taskman.h" 41 41 42 42 static task_event_handler_t task_event_handler = NULL; … … 65 65 66 66 if (!IPC_GET_IMETHOD(call)) { 67 /* Hangup, TODO explain or handle differntly*/67 /* Hangup, end of game */ 68 68 break; 69 69 } -
uspace/lib/c/generic/taskman.c
r780c8ce r012dd8e 33 33 */ 34 34 35 36 #include <async.h> 35 37 #include <errno.h> 38 #include <ipc/common.h> 36 39 #include <ipc/taskman.h> 40 #include <task.h> 37 41 #include <taskman.h> 38 42 39 #include <stdio.h> 43 #include "private/async.h" 44 #include "private/taskman.h" 40 45 41 //TODO better filename? 42 #include "private/ns.h" 46 async_sess_t *session_taskman = NULL; 43 47 44 static int taskman_ask_callback(async_sess_t *session_tm)48 void __task_init(async_sess_t *sess) 45 49 { 46 async_exch_t *exch = async_exchange_begin(session_tm); 50 assert(session_taskman == NULL); 51 session_taskman = sess; 52 } 53 54 async_exch_t *taskman_exchange_begin(void) 55 { 56 assert(session_taskman); 57 58 async_exch_t *exch = async_exchange_begin(session_taskman); 59 return exch; 60 } 61 62 void taskman_exchange_end(async_exch_t *exch) 63 { 64 async_exchange_end(exch); 65 } 66 67 /** Wrap PHONE_INITIAL with session and introduce to taskman 68 */ 69 async_sess_t *taskman_connect(void) 70 { 71 /* 72 * EXCHANGE_ATOMIC would require single calls only, 73 * EXCHANGE_PARALLEL not sure about implementation via multiple phones, 74 * >EXCHANGE_SERIALIZE perhaphs no harm, except the client serialization 75 */ 76 const exch_mgmt_t mgmt = EXCHANGE_SERIALIZE; 77 async_sess_t *sess = create_session(PHONE_INITIAL, mgmt, 0, 0, 0); 78 79 if (sess != NULL) { 80 /* Introduce ourselves and ignore answer */ 81 async_exch_t *exch = async_exchange_begin(sess); 82 aid_t req = async_send_0(exch, TASKMAN_NEW_TASK, NULL); 83 async_exchange_end(exch); 84 85 if (req) { 86 async_forget(req); 87 } 88 } 89 90 return sess; 91 } 92 93 /** Ask taskman to pass/share its NS */ 94 async_sess_t *taskman_session_ns(void) 95 { 96 assert(session_taskman); 97 98 async_exch_t *exch = async_exchange_begin(session_taskman); 99 assert(exch); 100 101 async_sess_t *sess = async_connect_me_to(EXCHANGE_ATOMIC, 102 exch, TASKMAN_CONNECT_TO_NS, 0, 0); 103 async_exchange_end(exch); 104 105 return sess; 106 } 107 108 /** Ask taskman to connect to (a new) loader instance */ 109 async_sess_t *taskman_session_loader(void) 110 { 111 assert(session_taskman); 112 113 async_exch_t *exch = async_exchange_begin(session_taskman); 114 async_sess_t *sess = async_connect_me_to(EXCHANGE_SERIALIZE, 115 exch, TASKMAN_CONNECT_TO_LOADER, 0, 0); 116 async_exchange_end(exch); 117 118 return sess; 119 } 120 121 /** Introduce as loader to taskman 122 * 123 * @return EOK on success, otherwise propagated error code 124 */ 125 int taskman_intro_loader(void) 126 { 127 assert(session_taskman); 128 129 async_exch_t *exch = async_exchange_begin(session_taskman); 47 130 int rc = async_connect_to_me( 48 131 exch, TASKMAN_LOADER_CALLBACK, 0, 0, NULL, NULL); … … 52 135 } 53 136 54 static async_sess_t *taskman_connect_to_ns(async_sess_t *session_tm) 137 /** Tell taskman we are his NS 138 * 139 * @return EOK on success, otherwise propagated error code 140 */ 141 int taskman_intro_ns(void) 55 142 { 56 async_exch_t *exch = async_exchange_begin(session_tm); 57 async_sess_t *session_ns = async_connect_me_to(EXCHANGE_ATOMIC, 58 exch, TASKMAN_LOADER_TO_NS, 0, 0); 59 async_exchange_end(exch); 143 assert(session_taskman); 60 144 61 return session_ns; 145 async_exch_t *exch = async_exchange_begin(session_taskman); 146 aid_t req = async_send_0(exch, TASKMAN_I_AM_NS, NULL); 147 148 int rc = async_connect_to_me(exch, 0, 0, 0, NULL, NULL); 149 taskman_exchange_end(exch); 150 151 if (rc != EOK) { 152 return rc; 153 } 154 155 sysarg_t retval; 156 async_wait_for(req, &retval); 157 return retval; 62 158 } 63 159 64 /** Set up phones upon being spawned by taskman 65 * 66 * Assumes primary session exists that is connected to taskman. 67 * After handshake, taskman is connected to us (see, it's opposite) and broker 68 * session is set up according to taskman. 69 * 70 * 71 * @return Session to broker (naming service) or NULL (sets errno). 72 */ 73 async_sess_t *taskman_handshake(void) 160 async_sess_t *taskman_get_session(void) 74 161 { 75 int rc = taskman_ask_callback(session_primary); 76 if (rc != EOK) { 77 errno = rc; 78 return NULL; 79 } 162 return session_taskman; 163 } 80 164 81 async_sess_t *session_ns = taskman_connect_to_ns(session_primary);82 if (session_ns == NULL) {83 errno = ENOENT;84 }85 165 86 return session_ns;87 }88 166 89 167 /** @} -
uspace/lib/c/include/async.h
r780c8ce r012dd8e 276 276 extern sysarg_t async_get_label(void); 277 277 278 extern async_sess_t *async_session_primary_swap(async_sess_t *);279 278 extern async_sess_t *async_connect_me_to(async_exch_t *, iface_t, sysarg_t, 280 279 sysarg_t); -
uspace/lib/c/include/ipc/common.h
r780c8ce r012dd8e 39 39 #include <abi/ipc/ipc.h> 40 40 41 /* Well known phone descriptors */ 42 #define PHONE_INITIAL 0 43 41 44 #define IPC_FLAG_BLOCKING 0x01 42 45 // TODO autostart flag may be united with blocking, this should be later made -
uspace/lib/c/include/ipc/services.h
r780c8ce r012dd8e 46 46 SERVICE_LOC = FOURCC('l', 'o', 'c', ' '), 47 47 SERVICE_SYSMAN = FOURCC('s', 'y', 's', 'm'), 48 SERVICE_TASKMAN = FOURCC('t', 's', 'k', 'm'),49 48 SERVICE_LOGGER = FOURCC('l', 'o', 'g', 'g'), 50 49 SERVICE_DEVMAN = FOURCC('d', 'e', 'v', 'n'), -
uspace/lib/c/include/ipc/taskman.h
r780c8ce r012dd8e 42 42 TASKMAN_WAIT = IPC_FIRST_USER_METHOD, 43 43 TASKMAN_RETVAL, 44 TASKMAN_EVENT_CALLBACK 44 TASKMAN_EVENT_CALLBACK, 45 TASKMAN_NEW_TASK, 46 TASKMAN_I_AM_NS 45 47 } taskman_request_t; 46 48 … … 50 52 51 53 typedef enum { 52 TASKMAN_CONNECT_TO_LOADER = 0, 53 TASKMAN_LOADER_TO_NS, 54 TASKMAN_LOADER_CALLBACK, 55 TASKMAN_CONTROL 56 } taskman_interface_t; 54 TASKMAN_CONNECT_TO_NS = 0, 55 TASKMAN_CONNECT_TO_LOADER, 56 TASKMAN_LOADER_CALLBACK 57 } taskman_connect_t; 57 58 58 59 #endif -
uspace/lib/c/include/loader/pcb.h
r780c8ce r012dd8e 61 61 entry_point_t entry; 62 62 63 /** Primary session to broker. */64 async_sess_t *session_primary;65 66 63 /** Session to taskman (typically spawn parent) */ 67 64 async_sess_t *session_taskman; -
uspace/lib/c/include/ns.h
r780c8ce r012dd8e 49 49 extern async_sess_t *ns_session_get(void); 50 50 51 extern async_sess_t *ns_get_session(void); 52 51 53 #endif 52 54 -
uspace/lib/c/include/task.h
r780c8ce r012dd8e 76 76 extern errno_t task_retval(int); 77 77 78 /* Implemented in task_event. h*/78 /* Implemented in task_event.c */ 79 79 extern int task_register_event_handler(task_event_handler_t); 80 80 -
uspace/lib/c/include/taskman.h
r780c8ce r012dd8e 36 36 #define LIBC_TASKMAN_H_ 37 37 38 #ifndef TASKMAN_DISABLE_ASYNC 38 39 #include <async.h> 40 #endif 39 41 40 extern async_sess_t *taskman_handshake(void); 42 /* Internal functions to be used by loader only */ 43 #ifndef TASKMAN_DISABLE_ASYNC 44 extern async_sess_t *taskman_get_session(void); 45 #endif 46 extern int taskman_intro_loader(void); 47 48 /* Internal functions to be used by NS only */ 49 extern int taskman_intro_ns(void); 41 50 42 51 #endif
Note:
See TracChangeset
for help on using the changeset viewer.