Changeset 286e03d in mainline
- Timestamp:
- 2006-03-15T11:44:26Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8965838e
- Parents:
- 91d5ad6
- Location:
- generic
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/include/ipc/ipc.h
r91d5ad6 r286e03d 84 84 answerbox_t *callerbox; 85 85 int flags; 86 task_t *sender; 86 87 __native data[IPC_CALL_LEN]; 87 88 } call_t; -
generic/include/proc/task.h
r91d5ad6 r286e03d 41 41 link_t tasks_link; /**< Link to other tasks within the system. */ 42 42 as_t *as; /**< Address space. */ 43 task_id_t taskid; /**< Unique identity of task */ 44 43 45 /* IPC stuff */ 44 46 answerbox_t answerbox; /**< Communication endpoint */ -
generic/include/syscall/syscall.h
r91d5ad6 r286e03d 38 38 SYS_IPC_CALL_ASYNC_FAST, 39 39 SYS_IPC_CALL_ASYNC, 40 SYS_IPC_ANSWER_FAST, 40 41 SYS_IPC_ANSWER, 41 42 SYS_IPC_WAIT, -
generic/include/typedefs.h
r91d5ad6 r286e03d 38 38 typedef unsigned long count_t; 39 39 typedef unsigned long index_t; 40 41 typedef unsigned long long task_id_t; 40 42 41 43 typedef struct config config_t; -
generic/src/ipc/ipc.c
r91d5ad6 r286e03d 62 62 memsetb((__address)call, sizeof(*call), 0); 63 63 call->callerbox = &TASK->answerbox; 64 call->sender = TASK; 64 65 65 66 return call; -
generic/src/proc/task.c
r91d5ad6 r286e03d 45 45 SPINLOCK_INITIALIZE(tasks_lock); 46 46 LIST_INITIALIZE(tasks_head); 47 static task_id_t task_counter = 0; 47 48 48 49 /** Initialize tasks … … 86 87 ipl = interrupts_disable(); 87 88 spinlock_lock(&tasks_lock); 89 90 ta->taskid = ++task_counter; 88 91 list_append(&ta->tasks_link, &tasks_head); 92 89 93 spinlock_unlock(&tasks_lock); 90 94 interrupts_restore(ipl); -
generic/src/syscall/syscall.c
r91d5ad6 r286e03d 98 98 99 99 /** Synchronous IPC call allowing to send whole message */ 100 static __native sys_ipc_call_sync(__native phoneid, __native *data) 100 static __native sys_ipc_call_sync(__native phoneid, __native *question, 101 __native *reply) 101 102 { 102 103 call_t call; … … 109 110 110 111 ipc_call_init(&call); 111 copy_from_uspace(&call.data, data, sizeof(call.data));112 copy_from_uspace(&call.data, question, sizeof(call.data)); 112 113 113 114 ipc_call_sync(phone, &call); 114 115 115 copy_to_uspace( data, &call.data, sizeof(call.data));116 copy_to_uspace(reply, &call.data, sizeof(call.data)); 116 117 117 118 return 0; … … 185 186 186 187 /** Send IPC answer */ 187 static __native sys_ipc_answer (__native callid, __native retval, __native arg1,188 188 static __native sys_ipc_answer_fast(__native callid, __native retval, 189 __native arg1, __native arg2) 189 190 { 190 191 call_t *call; … … 203 204 } 204 205 206 /** Send IPC answer */ 207 static __native sys_ipc_answer(__native callid, __native *data) 208 { 209 call_t *call; 210 211 /* Check that the user is not sending us answer callid */ 212 ASSERT(! (callid & 1)); 213 /* TODO: Check that the callid is in the dispatch table */ 214 call = (call_t *) callid; 215 copy_from_uspace(&call->data, data, sizeof(call->data)); 216 ipc_answer(&TASK->answerbox, call); 217 218 return 0; 219 } 220 205 221 /** Wait for incoming ipc call or answer 206 222 * … … 209 225 * @return Callid, if callid & 1, then the call is answer 210 226 */ 211 static __native sys_ipc_wait_for_call(__native *calldata, __native flags) 227 static __native sys_ipc_wait_for_call(__native *calldata, task_id_t *taskid, 228 __native flags) 212 229 { 213 230 call_t *call; … … 223 240 return ((__native)call) | IPC_CALLID_ANSWERED; 224 241 } 242 copy_to_uspace(taskid, (void *)&TASK->taskid, sizeof(TASK->taskid)); 225 243 return (__native)call; 226 244 } … … 239 257 sys_ipc_call_async_fast, 240 258 sys_ipc_call_async, 259 sys_ipc_answer_fast, 241 260 sys_ipc_answer, 242 261 sys_ipc_wait_for_call
Note:
See TracChangeset
for help on using the changeset viewer.