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:
Norman Feske 2022-01-24 11:11:24 +01:00
parent 3e4af3a567
commit 90c446e565

View File

@ -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);