Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 4d6629f in mainline


Ignore:
Timestamp:
2017-09-03T14:15:32Z (3 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
9306cd7
Parents:
8a45bf09
Message:

Remove unused connection cloning

Files:
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • abi/include/abi/ipc/methods.h

    r8a45bf09 r4d6629f  
    5858         */
    5959        IPC_M_PHONE_HUNGUP = 0,
    60 
    61         /** Clone connection.
    62          *
    63          * The calling task clones one of its phones for the callee.
    64          *
    65          * - ARG1 - The caller sets ARG1 to the phone of the cloned connection.
    66          *        - The callee gets the new phone from ARG1.
    67          *
    68          * - on answer, the callee acknowledges the new connection by sending EOK back
    69          *   or the kernel closes it
    70          */
    71         IPC_M_CONNECTION_CLONE,
    72 
    73         /** Protocol for establishing a cloned connection.
    74          *
    75          * Through this call, the recipient learns about the new cloned connection.
    76          *
    77          * - ARG5 - the kernel sets ARG5 to contain the hash of the used phone
    78          * - on answer, the callee acknowledges the new connection by sending EOK back
    79          *   or the kernel closes it
    80          */
    81         IPC_M_CLONE_ESTABLISH,
    8260
    8361        /** Protocol for initializing callback connections.
  • kernel/Makefile

    r8a45bf09 r4d6629f  
    271271        generic/src/ipc/sysipc.c \
    272272        generic/src/ipc/sysipc_ops.c \
    273         generic/src/ipc/ops/clnestab.c \
    274273        generic/src/ipc/ops/conctmeto.c \
    275274        generic/src/ipc/ops/concttome.c \
    276         generic/src/ipc/ops/connclone.c \
    277275        generic/src/ipc/ops/dataread.c \
    278276        generic/src/ipc/ops/datawrite.c \
  • kernel/generic/src/ipc/sysipc.c

    r8a45bf09 r4d6629f  
    8585{
    8686        switch (imethod) {
    87         case IPC_M_CONNECTION_CLONE:
    88         case IPC_M_CLONE_ESTABLISH:
    8987        case IPC_M_PHONE_HUNGUP:
    9088                /* This message is meant only for the original recipient. */
     
    135133{
    136134        switch (IPC_GET_IMETHOD(call->data)) {
    137         case IPC_M_CONNECTION_CLONE:
    138         case IPC_M_CLONE_ESTABLISH:
    139135        case IPC_M_CONNECT_TO_ME:
    140136        case IPC_M_CONNECT_ME_TO:
  • kernel/generic/src/ipc/sysipc_ops.c

    r8a45bf09 r4d6629f  
    3838
    3939/* Forward declarations. */
    40 sysipc_ops_t ipc_m_connection_clone_ops;
    41 sysipc_ops_t ipc_m_clone_establish_ops;
    4240sysipc_ops_t ipc_m_connect_to_me_ops;
    4341sysipc_ops_t ipc_m_connect_me_to_ops;
     
    5149
    5250static sysipc_ops_t *sysipc_ops[] = {
    53         [IPC_M_CONNECTION_CLONE] = &ipc_m_connection_clone_ops,
    54         [IPC_M_CLONE_ESTABLISH] = &ipc_m_clone_establish_ops,
    5551        [IPC_M_CONNECT_TO_ME] = &ipc_m_connect_to_me_ops,
    5652        [IPC_M_CONNECT_ME_TO] = &ipc_m_connect_me_to_ops,
  • uspace/app/trace/ipc_desc.c

    r8a45bf09 r4d6629f  
    4040        /* System methods */
    4141        { IPC_M_PHONE_HUNGUP,     "PHONE_HUNGUP" },
    42         { IPC_M_CONNECTION_CLONE, "CONNECTION_CLONE" },
    43         { IPC_M_CLONE_ESTABLISH,  "CLONE_ESTABLISH" },
    4442        { IPC_M_CONNECT_ME_TO,    "CONNECT_ME_TO" },
    4543        { IPC_M_CONNECT_TO_ME,    "CONNECT_TO_ME" },
  • uspace/lib/c/generic/async.c

    r8a45bf09 r4d6629f  
    13571357                async_new_connection(call->in_task_id, in_phone_hash, callid,
    13581358                    call, handler, data);
    1359                 return;
    1360         }
    1361        
    1362         /* Cloned connection */
    1363         if (IPC_GET_IMETHOD(*call) == IPC_M_CLONE_ESTABLISH) {
    1364                 // TODO: Currently ignores ports altogether
    1365                
    1366                 /* Open new connection with fibril, etc. */
    1367                 async_new_connection(call->in_task_id, IPC_GET_ARG5(*call),
    1368                     callid, call, fallback_port_handler, fallback_port_data);
    13691359                return;
    13701360        }
     
    20842074       
    20852075        return EOK;
    2086 }
    2087 
    2088 /** Wrapper for making IPC_M_CLONE_ESTABLISH calls using the async framework.
    2089  *
    2090  * Ask for a cloned connection to some service.
    2091  *
    2092  * @param mgmt Exchange management style.
    2093  * @param exch Exchange for sending the message.
    2094  *
    2095  * @return New session on success or NULL on error.
    2096  *
    2097  */
    2098 async_sess_t *async_clone_establish(exch_mgmt_t mgmt, async_exch_t *exch)
    2099 {
    2100         if (exch == NULL) {
    2101                 errno = ENOENT;
    2102                 return NULL;
    2103         }
    2104        
    2105         async_sess_t *sess = (async_sess_t *) malloc(sizeof(async_sess_t));
    2106         if (sess == NULL) {
    2107                 errno = ENOMEM;
    2108                 return NULL;
    2109         }
    2110        
    2111         ipc_call_t result;
    2112        
    2113         amsg_t *msg = amsg_create();
    2114         if (!msg) {
    2115                 free(sess);
    2116                 errno = ENOMEM;
    2117                 return NULL;
    2118         }
    2119        
    2120         msg->dataptr = &result;
    2121         msg->wdata.active = true;
    2122        
    2123         ipc_call_async_0(exch->phone, IPC_M_CLONE_ESTABLISH, msg,
    2124             reply_received);
    2125        
    2126         sysarg_t rc;
    2127         async_wait_for((aid_t) msg, &rc);
    2128        
    2129         if (rc != EOK) {
    2130                 errno = rc;
    2131                 free(sess);
    2132                 return NULL;
    2133         }
    2134        
    2135         int phone = (int) IPC_GET_ARG5(result);
    2136        
    2137         if (phone < 0) {
    2138                 errno = phone;
    2139                 free(sess);
    2140                 return NULL;
    2141         }
    2142        
    2143         sess->iface = 0;
    2144         sess->mgmt = mgmt;
    2145         sess->phone = phone;
    2146         sess->arg1 = 0;
    2147         sess->arg2 = 0;
    2148         sess->arg3 = 0;
    2149        
    2150         fibril_mutex_initialize(&sess->remote_state_mtx);
    2151         sess->remote_state_data = NULL;
    2152        
    2153         list_initialize(&sess->exch_list);
    2154         fibril_mutex_initialize(&sess->mutex);
    2155         atomic_set(&sess->refcnt, 0);
    2156        
    2157         return sess;
    21582076}
    21592077
     
    31263044}
    31273045
    3128 /** Wrapper for sending an exchange over different exchange for cloning
    3129  *
    3130  * @param exch       Exchange to be used for sending.
    3131  * @param clone_exch Exchange to be cloned.
    3132  *
    3133  */
    3134 int async_exchange_clone(async_exch_t *exch, async_exch_t *clone_exch)
    3135 {
    3136         return async_req_1_0(exch, IPC_M_CONNECTION_CLONE, clone_exch->phone);
    3137 }
    3138 
    3139 /** Wrapper for receiving the IPC_M_CONNECTION_CLONE calls.
    3140  *
    3141  * If the current call is IPC_M_CONNECTION_CLONE then a new
    3142  * async session is created for the accepted phone.
    3143  *
    3144  * @param mgmt Exchange management style.
    3145  *
    3146  * @return New async session or NULL on failure.
    3147  *
    3148  */
    3149 async_sess_t *async_clone_receive(exch_mgmt_t mgmt)
    3150 {
    3151         /* Accept the phone */
    3152         ipc_call_t call;
    3153         ipc_callid_t callid = async_get_call(&call);
    3154         int phone = (int) IPC_GET_ARG1(call);
    3155        
    3156         if ((IPC_GET_IMETHOD(call) != IPC_M_CONNECTION_CLONE) ||
    3157             (phone < 0)) {
    3158                 async_answer_0(callid, EINVAL);
    3159                 return NULL;
    3160         }
    3161        
    3162         async_sess_t *sess = (async_sess_t *) malloc(sizeof(async_sess_t));
    3163         if (sess == NULL) {
    3164                 async_answer_0(callid, ENOMEM);
    3165                 return NULL;
    3166         }
    3167        
    3168         sess->iface = 0;
    3169         sess->mgmt = mgmt;
    3170         sess->phone = phone;
    3171         sess->arg1 = 0;
    3172         sess->arg2 = 0;
    3173         sess->arg3 = 0;
    3174        
    3175         fibril_mutex_initialize(&sess->remote_state_mtx);
    3176         sess->remote_state_data = NULL;
    3177        
    3178         list_initialize(&sess->exch_list);
    3179         fibril_mutex_initialize(&sess->mutex);
    3180         atomic_set(&sess->refcnt, 0);
    3181        
    3182         /* Acknowledge the cloned phone */
    3183         async_answer_0(callid, EOK);
    3184        
    3185         return sess;
    3186 }
    3187 
    31883046/** Wrapper for receiving the IPC_M_CONNECT_TO_ME calls.
    31893047 *
  • uspace/lib/c/include/async.h

    r8a45bf09 r4d6629f  
    343343    sysarg_t *, sysarg_t *);
    344344
    345 extern async_sess_t *async_clone_establish(exch_mgmt_t, async_exch_t *);
    346345extern async_sess_t *async_connect_me_to(exch_mgmt_t, async_exch_t *, sysarg_t,
    347346    sysarg_t, sysarg_t);
     
    472471    sysarg_t, sysarg_t, sysarg_t, ipc_call_t *);
    473472
    474 extern int async_exchange_clone(async_exch_t *, async_exch_t *);
    475 extern async_sess_t *async_clone_receive(exch_mgmt_t);
    476473extern async_sess_t *async_callback_receive(exch_mgmt_t);
    477474extern async_sess_t *async_callback_receive_start(exch_mgmt_t, ipc_call_t *);
Note: See TracChangeset for help on using the changeset viewer.