Skip to content
Snippets Groups Projects
Commit f15959a7 authored by Joel Beeren's avatar Joel Beeren
Browse files

SELFOUR-220: only delete reply cap when waiting on sync endpoint

parent 25155caf
No related branches found
No related tags found
No related merge requests found
......@@ -178,13 +178,14 @@ The "Wait" system call blocks waiting to receive a message through a specified e
> handleWait :: Kernel ()
> handleWait = do
> thread <- getCurThread
> deleteCallerCap thread
> epCPtr <- asUser thread $ liftM CPtr $ getRegister capRegister
> (capFaultOnFailure epCPtr True $ do
> epCap <- lookupCap thread epCPtr
> case epCap of
> EndpointCap { capEPCanReceive = True } ->
> withoutFailure $ receiveIPC thread epCap
> withoutFailure $ do
> deleteCallerCap thread
> receiveIPC thread epCap
> AsyncEndpointCap { capAEPCanReceive = True } ->
> withoutFailure $ receiveAsyncIPC thread epCap
> _ -> throw $ MissingCapability { missingCapBitsLeft = 0 })
......
......@@ -308,8 +308,6 @@ handleWait(void)
word_t epCPtr;
lookupCap_ret_t lu_ret;
deleteCallerCap(ksCurThread);
epCPtr = getRegister(ksCurThread, capRegister);
lu_ret = lookupCap(ksCurThread, epCPtr);
......@@ -322,6 +320,7 @@ handleWait(void)
switch (cap_get_capType(lu_ret.cap)) {
case cap_endpoint_cap:
if (unlikely(!cap_endpoint_cap_get_capCanReceive(lu_ret.cap))) {
current_lookup_fault = lookup_fault_missing_capability_new(0);
current_fault = fault_cap_fault_new(epCPtr, true);
......@@ -329,6 +328,7 @@ handleWait(void)
break;
}
deleteCallerCap(ksCurThread);
receiveIPC(ksCurThread, lu_ret.cap);
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment