Rev 2472 | Rev 2601 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2472 | Rev 2494 | ||
---|---|---|---|
Line 65... | Line 65... | ||
65 | static void _ipc_call_init(call_t *call) |
65 | static void _ipc_call_init(call_t *call) |
66 | { |
66 | { |
67 | memsetb((uintptr_t) call, sizeof(*call), 0); |
67 | memsetb((uintptr_t) call, sizeof(*call), 0); |
68 | call->callerbox = &TASK->answerbox; |
68 | call->callerbox = &TASK->answerbox; |
69 | call->sender = TASK; |
69 | call->sender = TASK; |
- | 70 | call->buffer = NULL; |
|
70 | } |
71 | } |
71 | 72 | ||
72 | /** Allocate and initialize a call structure. |
73 | /** Allocate and initialize a call structure. |
73 | * |
74 | * |
74 | * The call is initialized, so that the reply will be directed to |
75 | * The call is initialized, so that the reply will be directed to |
Line 105... | Line 106... | ||
105 | * @param call Call structure to be freed. |
106 | * @param call Call structure to be freed. |
106 | */ |
107 | */ |
107 | void ipc_call_free(call_t *call) |
108 | void ipc_call_free(call_t *call) |
108 | { |
109 | { |
109 | ASSERT(!(call->flags & IPC_CALL_STATIC_ALLOC)); |
110 | ASSERT(!(call->flags & IPC_CALL_STATIC_ALLOC)); |
- | 111 | /* Check to see if we have data in the IPC_M_DATA_SEND buffer. */ |
|
- | 112 | if (call->buffer) |
|
- | 113 | free(call->buffer); |
|
110 | slab_free(ipc_call_slab, call); |
114 | slab_free(ipc_call_slab, call); |
111 | } |
115 | } |
112 | 116 | ||
113 | /** Initialize an answerbox structure. |
117 | /** Initialize an answerbox structure. |
114 | * |
118 | * |
Line 290... | Line 294... | ||
290 | { |
294 | { |
291 | answerbox_t *box; |
295 | answerbox_t *box; |
292 | call_t *call; |
296 | call_t *call; |
293 | 297 | ||
294 | spinlock_lock(&phone->lock); |
298 | spinlock_lock(&phone->lock); |
- | 299 | if (phone->state == IPC_PHONE_FREE || |
|
295 | if (phone->state == IPC_PHONE_FREE || phone->state == IPC_PHONE_HUNGUP || |
300 | phone->state == IPC_PHONE_HUNGUP || |
296 | phone->state == IPC_PHONE_CONNECTING) { |
301 | phone->state == IPC_PHONE_CONNECTING) { |
297 | spinlock_unlock(&phone->lock); |
302 | spinlock_unlock(&phone->lock); |
298 | return -1; |
303 | return -1; |
299 | } |
304 | } |
300 | box = phone->callee; |
305 | box = phone->callee; |