139 |
static void |
static void |
140 |
receive_continuation (void) |
receive_continuation (void) |
141 |
{ |
{ |
142 |
trace_printf ("WE ARE IN THE AWSOME CONTINUATION"); |
struct thread *thread = THREAD_CURRENT (); |
143 |
thread_exception_return (); |
struct rtmk_msg_header *msgh; |
144 |
} |
struct ipc_kmsg *kmsg; |
145 |
|
kern_return_t kr; |
146 |
|
|
147 |
|
kr = thread->ipc_result; |
148 |
|
msgh = (struct rtmk_msg_header *) thread->scratch_area [0]; |
149 |
|
kmsg = thread->ipc_kmsg; |
150 |
|
|
151 |
|
if (kr == KERN_SUCCESS) |
152 |
|
{ |
153 |
|
kr = ipc_kmsg_copyout (thread->task, msgh, kmsg); |
154 |
|
ipc_kmsg_free (kmsg); |
155 |
|
} |
156 |
|
|
157 |
|
thread_syscall_return (kr); |
158 |
|
} |
159 |
|
|
160 |
|
|
161 |
/* User entry point for IPC send/receive. |
/* User entry point for IPC send/receive. |
362 |
|
|
363 |
/* If there's not room for the message we continue to the |
/* If there's not room for the message we continue to the |
364 |
next thread (reporting error to thread). */ |
next thread (reporting error to thread). */ |
365 |
|
if (target->ipc_length < kmsg->length) |
|
if (thread->ipc_length < kmsg->length) |
|
366 |
{ |
{ |
367 |
thread->ipc_result = MSG_RCV_TOO_SMALL; |
target->ipc_result = MSG_RCV_TOO_SMALL; |
368 |
|
|
369 |
thread_unlock (thread); |
thread_unlock (target); |
370 |
SPLON (spl); |
SPLON (spl); |
371 |
thread_interrupt (thread); |
thread_interrupt (target); |
372 |
|
|
373 |
if (! ipc_tqueue_empty (&port->waiting_threads)) |
if (! ipc_tqueue_empty (&port->waiting_threads)) |
374 |
goto retry_waiting_thread; |
goto retry_waiting_thread; |