mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-12 13:48:30 +00:00
base-hw: remove throw from ipc_reply_wait
Even though the use of the C++ exception mechanism (and the implicit use of the cxx heap) is not a problem at the server side, this patch nevertheless replaces the exception-based return-value handling to make the code consistent with the ipc_call path. Issue #3612
This commit is contained in:
parent
3e4af3a567
commit
90c446e565
@ -140,24 +140,23 @@ Genode::Rpc_request Genode::ipc_reply_wait(Reply_capability const &,
|
||||
{
|
||||
Native_utcb &utcb = *Thread::myself()->utcb();
|
||||
|
||||
retry<Genode::Allocator::Out_of_memory>(
|
||||
[&] () {
|
||||
int ret = 0;
|
||||
if (exc.value != Rpc_exception_code::INVALID_OBJECT) {
|
||||
copy_msg_to_utcb(reply_msg, utcb);
|
||||
utcb.exception_code(exc.value);
|
||||
ret = Kernel::send_reply_msg(Msgbuf_base::MAX_CAPS_PER_MSG, true);
|
||||
} else {
|
||||
ret = Kernel::await_request_msg(Msgbuf_base::MAX_CAPS_PER_MSG);
|
||||
}
|
||||
for (bool done = false; !done; ) {
|
||||
|
||||
switch (ret) {
|
||||
case -1: throw Blocking_canceled();
|
||||
case -2: throw Allocator::Out_of_memory();
|
||||
default: break;
|
||||
}
|
||||
},
|
||||
[&] () { upgrade_capability_slab(); });
|
||||
int ret = 0;
|
||||
if (exc.value != Rpc_exception_code::INVALID_OBJECT) {
|
||||
copy_msg_to_utcb(reply_msg, utcb);
|
||||
utcb.exception_code(exc.value);
|
||||
ret = Kernel::send_reply_msg(Msgbuf_base::MAX_CAPS_PER_MSG, true);
|
||||
} else {
|
||||
ret = Kernel::await_request_msg(Msgbuf_base::MAX_CAPS_PER_MSG);
|
||||
}
|
||||
|
||||
switch (ret) {
|
||||
case -1: throw Blocking_canceled();
|
||||
case -2: upgrade_capability_slab(); break;
|
||||
default: done = true; break;
|
||||
}
|
||||
}
|
||||
|
||||
copy_utcb_to_msg(utcb, request_msg);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user