From 3e4af3a567f9f5160c400bbf538017f99c0ede1c Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Mon, 24 Jan 2022 10:34:22 +0100 Subject: [PATCH] base-hw: remove throw from ipc_call code path This eliminates the dependency of the IPC-call operation from the cxx heap. Fixes #3612 --- repos/base-hw/src/lib/base/ipc.cc | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/repos/base-hw/src/lib/base/ipc.cc b/repos/base-hw/src/lib/base/ipc.cc index 6ca6c09054..8346e8e604 100644 --- a/repos/base-hw/src/lib/base/ipc.cc +++ b/repos/base-hw/src/lib/base/ipc.cc @@ -96,22 +96,23 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst, { Native_utcb &utcb = *Thread::myself()->utcb(); - retry( - [&] () { + /* + * Issue IPC call, upgrade the PD's capability slab on demand. + */ + for (bool done = false; !done; ) { - copy_msg_to_utcb(snd_msg, *Thread::myself()->utcb()); + copy_msg_to_utcb(snd_msg, *Thread::myself()->utcb()); - switch (Kernel::send_request_msg(Capability_space::capid(dst), - (unsigned)rcv_caps)) { + switch (Kernel::send_request_msg(Capability_space::capid(dst), + (unsigned)rcv_caps)) { - case -1: throw Blocking_canceled(); - case -2: throw Allocator::Out_of_memory(); - default: - copy_utcb_to_msg(utcb, rcv_msg); - } + case -1: throw Blocking_canceled(); + case -2: upgrade_capability_slab(); break; + default: done = true; break; + } + } - }, - [&] () { upgrade_capability_slab(); }); + copy_utcb_to_msg(utcb, rcv_msg); return Rpc_exception_code((int)utcb.exception_code()); }