Changeset e8039a86 in mainline for kernel/generic/src/ipc/ops/concttome.c
- Timestamp:
- 2012-08-20T23:21:41Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0343a1b
- Parents:
- 642dc72
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ops/concttome.c
r642dc72 re8039a86 1 1 /* 2 * Copyright (c) 2006 Ondrej Palkovsky 2 3 * Copyright (c) 2012 Jakub Jermar 3 4 * All rights reserved. … … 34 35 35 36 #include <ipc/sysipc_ops.h> 37 #include <ipc/ipc.h> 38 #include <ipc/ipcrsc.h> 39 #include <abi/errno.h> 40 #include <arch.h> 41 42 static int request_process(call_t *call, answerbox_t *box) 43 { 44 int phoneid = phone_alloc(TASK); 45 46 if (phoneid < 0) { /* Failed to allocate phone */ 47 IPC_SET_RETVAL(call->data, ELIMIT); 48 ipc_answer(box, call); 49 return -1; 50 } 51 52 IPC_SET_ARG5(call->data, phoneid); 53 54 return EOK; 55 } 56 57 static int answer_preprocess(call_t *answer, ipc_data_t *olddata) 58 { 59 int phoneid = (int) IPC_GET_ARG5(*olddata); 60 61 if (IPC_GET_RETVAL(answer->data) != EOK) { 62 /* The connection was not accepted */ 63 int phoneid = (int) IPC_GET_ARG5(*olddata); 64 65 phone_dealloc(phoneid); 66 } else { 67 /* The connection was accepted */ 68 phone_connect(phoneid, &answer->sender->answerbox); 69 /* Set 'phone hash' as arg5 of response */ 70 IPC_SET_ARG5(answer->data, (sysarg_t) &TASK->phones[phoneid]); 71 } 72 73 return EOK; 74 } 75 36 76 37 77 sysipc_ops_t ipc_m_connect_to_me_ops = { 38 78 .request_preprocess = null_request_preprocess, 39 .request_process = null_request_process,40 .answer_preprocess = null_answer_preprocess,79 .request_process = request_process, 80 .answer_preprocess = answer_preprocess, 41 81 .answer_process = null_answer_process, 42 82 };
Note:
See TracChangeset
for help on using the changeset viewer.