Skip to content

Commit

Permalink
nova: remove nova_die and throw from ipc layer
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ab committed Feb 5, 2025
1 parent 57dd2f7 commit d4e96d7
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions repos/base-nova/src/lib/base/ipc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

/*
* Copyright (C) 2009-2017 Genode Labs GmbH
* Copyright (C) 2009-2025 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
Expand All @@ -14,7 +14,6 @@
/* Genode includes */
#include <base/ipc.h>
#include <base/thread.h>
#include <base/log.h>

/* base-internal includes */
#include <base/internal/ipc.h>
Expand Down Expand Up @@ -46,7 +45,7 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,

/* if this happens, the call is bogus and invalid */
if ((log2_max >= sizeof(rcv_caps) * 8))
throw Ipc_error();
return Rpc_exception_code(Rpc_exception_code::INVALID_OBJECT);

if ((1UL << log2_max) < rcv_caps)
log2_max ++;
Expand All @@ -59,10 +58,8 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
Nova::Utcb &utcb = *(Nova::Utcb *)myself->utcb();

/* the protocol value is unused as the badge is delivered by the kernel */
if (!copy_msgbuf_to_utcb(utcb, snd_msg, 0)) {
error("could not setup IPC");
throw Ipc_error();
}
if (!copy_msgbuf_to_utcb(utcb, snd_msg, 0))
return Rpc_exception_code(Rpc_exception_code::INVALID_OBJECT);

/*
* Determine manually defined selector for receiving the call result.
Expand All @@ -74,7 +71,7 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
/* if we can't setup receive window, die in order to recognize the issue */
if (!rcv_window.prepare_rcv_window(utcb, manual_rcv_sel))
/* printf doesn't work here since for IPC also rcv_prepare* is used */
nova_die();
return Rpc_exception_code(Rpc_exception_code::INVALID_OBJECT);

/* establish the mapping via a portal traversal */
uint8_t res = Nova::call(dst.local_name());
Expand Down

0 comments on commit d4e96d7

Please sign in to comment.