Changeset eadaeae8 in mainline for kernel/generic/src/ipc/ops
- Timestamp:
- 2018-03-21T20:58:49Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3be9d10
- Parents:
- 874381a
- Location:
- kernel/generic/src/ipc/ops
- Files:
-
- 3 edited
-
conctmeto.c (modified) (5 diffs)
-
concttome.c (modified) (4 diffs)
-
stchngath.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ops/conctmeto.c
r874381a readaeae8 46 46 * That will be done once the phone is connected. 47 47 */ 48 cap_ handle_t phone_handle;48 cap_phone_handle_t phone_handle; 49 49 kobject_t *phone_obj; 50 50 errno_t rc = phone_alloc(TASK, false, &phone_handle, &phone_obj); … … 58 58 59 59 /* Remember the handle */ 60 call->priv = phone_handle;60 call->priv = CAP_HANDLE_RAW(phone_handle); 61 61 62 62 return EOK; … … 65 65 static errno_t request_forget(call_t *call) 66 66 { 67 cap_ handle_t phone_handle = (cap_handle_t) call->priv;67 cap_phone_handle_t phone_handle = (cap_handle_t) call->priv; 68 68 69 if ( phone_handle< 0)69 if (CAP_HANDLE_RAW(phone_handle) < 0) 70 70 return EOK; 71 71 … … 103 103 static errno_t answer_process(call_t *answer) 104 104 { 105 cap_ handle_t phone_handle = (cap_handle_t) answer->priv;105 cap_phone_handle_t phone_handle = (cap_handle_t) answer->priv; 106 106 phone_t *phone = (phone_t *) IPC_GET_ARG5(answer->data); 107 107 108 108 if (IPC_GET_RETVAL(answer->data)) { 109 if ( phone_handle>= 0) {109 if (CAP_HANDLE_RAW(phone_handle) >= 0) { 110 110 /* 111 111 * Cleanup the unpublished capability and drop … … 123 123 cap_publish(TASK, phone_handle, phone->kobject); 124 124 125 IPC_SET_ARG5(answer->data, phone_handle);125 IPC_SET_ARG5(answer->data, CAP_HANDLE_RAW(phone_handle)); 126 126 } 127 127 -
kernel/generic/src/ipc/ops/concttome.c
r874381a readaeae8 42 42 static int request_process(call_t *call, answerbox_t *box) 43 43 { 44 cap_ handle_t phone_handle;44 cap_phone_handle_t phone_handle; 45 45 kobject_t *phone_obj; 46 46 errno_t rc = phone_alloc(TASK, false, &phone_handle, &phone_obj); 47 47 call->priv = (sysarg_t) phone_obj; 48 IPC_SET_ARG5(call->data, (rc == EOK) ? phone_handle : -1); 48 IPC_SET_ARG5(call->data, 49 (rc == EOK) ? CAP_HANDLE_RAW(phone_handle) : CAP_NIL); 49 50 return 0; 50 51 } … … 52 53 static errno_t answer_cleanup(call_t *answer, ipc_data_t *olddata) 53 54 { 54 cap_ handle_t phone_handle = (cap_handle_t) IPC_GET_ARG5(*olddata);55 cap_phone_handle_t phone_handle = (cap_handle_t) IPC_GET_ARG5(*olddata); 55 56 kobject_t *phone_obj = (kobject_t *) answer->priv; 56 57 57 if ( phone_handle >= 0) {58 if (CAP_HANDLE_VALID(phone_handle)) { 58 59 kobject_put(phone_obj); 59 60 cap_free(TASK, phone_handle); … … 65 66 static errno_t answer_preprocess(call_t *answer, ipc_data_t *olddata) 66 67 { 67 cap_ handle_t phone_handle = (cap_handle_t) IPC_GET_ARG5(*olddata);68 cap_phone_handle_t phone_handle = (cap_handle_t) IPC_GET_ARG5(*olddata); 68 69 kobject_t *phone_obj = (kobject_t *) answer->priv; 69 70 … … 71 72 /* The connection was not accepted */ 72 73 answer_cleanup(answer, olddata); 73 } else if ( phone_handle >= 0) {74 } else if (CAP_HANDLE_VALID(phone_handle)) { 74 75 /* 75 76 * The connection was accepted -
kernel/generic/src/ipc/ops/stchngath.c
r874381a readaeae8 45 45 task_t *other_task_s; 46 46 47 kobject_t *sender_obj = kobject_get(TASK, IPC_GET_ARG5(call->data),48 KOBJECT_TYPE_PHONE);47 kobject_t *sender_obj = kobject_get(TASK, 48 (cap_handle_t) IPC_GET_ARG5(call->data), KOBJECT_TYPE_PHONE); 49 49 if (!sender_obj) 50 50 return ENOENT; … … 78 78 79 79 kobject_t *recipient_obj = kobject_get(TASK, 80 IPC_GET_ARG1(answer->data), KOBJECT_TYPE_PHONE); 80 (cap_handle_t) IPC_GET_ARG1(answer->data), 81 KOBJECT_TYPE_PHONE); 81 82 if (!recipient_obj) { 82 83 IPC_SET_RETVAL(answer->data, ENOENT);
Note:
See TracChangeset
for help on using the changeset viewer.
