mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-21 16:39:39 +00:00
base-hw: remove throw from ipc_call code path
This eliminates the dependency of the IPC-call operation from the cxx heap. Fixes #3612
This commit is contained in:
@ -96,8 +96,10 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
|
||||
{
|
||||
Native_utcb &utcb = *Thread::myself()->utcb();
|
||||
|
||||
retry<Genode::Allocator::Out_of_memory>(
|
||||
[&] () {
|
||||
/*
|
||||
* 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());
|
||||
|
||||
@ -105,13 +107,12 @@ Rpc_exception_code Genode::ipc_call(Native_capability 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 -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());
|
||||
}
|
||||
|
Reference in New Issue
Block a user