mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 08:25:38 +00:00
NOVA: warning fixes - check result of append_item
This commit is contained in:
parent
fc6bcd9f9f
commit
77729fab2a
@ -57,7 +57,7 @@ static void copy_utcb_to_msgbuf(Nova::Utcb *utcb, Msgbuf_base *rcv_msg)
|
||||
/**
|
||||
* Copy message payload to UTCB message registers
|
||||
*/
|
||||
static void copy_msgbuf_to_utcb(Nova::Utcb *utcb, Msgbuf_base *snd_msg,
|
||||
static bool copy_msgbuf_to_utcb(Nova::Utcb *utcb, Msgbuf_base *snd_msg,
|
||||
unsigned num_msg_words, mword_t local_name)
|
||||
{
|
||||
/* look up address and size of message payload */
|
||||
@ -87,11 +87,14 @@ static void copy_msgbuf_to_utcb(Nova::Utcb *utcb, Msgbuf_base *snd_msg,
|
||||
int pt_sel = snd_msg->snd_pt_sel(i);
|
||||
if (pt_sel < 0) continue;
|
||||
|
||||
utcb->append_item(Nova::Obj_crd(pt_sel, 0), i);
|
||||
if (!utcb->append_item(Nova::Obj_crd(pt_sel, 0), i))
|
||||
return false;
|
||||
}
|
||||
|
||||
/* we have consumed portal capability selectors, reset message buffer */
|
||||
snd_msg->snd_reset();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -133,8 +136,11 @@ void Ipc_client::_call()
|
||||
{
|
||||
Nova::Utcb *utcb = (Nova::Utcb *)Thread_base::myself()->utcb();
|
||||
|
||||
copy_msgbuf_to_utcb(utcb, _snd_msg, _write_offset/sizeof(mword_t),
|
||||
Ipc_ostream::_dst.local_name());
|
||||
if (!copy_msgbuf_to_utcb(utcb, _snd_msg, _write_offset/sizeof(mword_t),
|
||||
Ipc_ostream::_dst.local_name())) {
|
||||
PERR("could not setup IPC");
|
||||
return;
|
||||
}
|
||||
_rcv_msg->rcv_prepare_pt_sel_window(utcb);
|
||||
|
||||
/* establish the mapping via a portal traversal */
|
||||
|
@ -57,7 +57,9 @@ void Ipc_pager::set_reply_mapping(Mapping m)
|
||||
{
|
||||
Nova::Utcb *utcb = (Nova::Utcb *)Thread_base::myself()->utcb();
|
||||
utcb->set_msg_word(0);
|
||||
utcb->append_item(m.mem_crd(), m.dst_addr());
|
||||
bool res = utcb->append_item(m.mem_crd(), m.dst_addr());
|
||||
/* one item ever fits on the UTCB */
|
||||
(void)res;
|
||||
}
|
||||
|
||||
|
||||
|
@ -79,8 +79,11 @@ void Pager_object::_invoke_handler()
|
||||
utcb->mtd = 0;
|
||||
utcb->set_msg_word(0);
|
||||
|
||||
if (event == PT_SEL_STARTUP || event == PT_SEL_PAGE_FAULT)
|
||||
utcb->append_item(Obj_crd(obj->exc_pt_sel() + event, 0), 0);
|
||||
if (event == PT_SEL_STARTUP || event == PT_SEL_PAGE_FAULT) {
|
||||
bool res = utcb->append_item(Obj_crd(obj->exc_pt_sel() + event, 0), 0);
|
||||
/* one item ever fits on the UTCB */
|
||||
(void)res;
|
||||
}
|
||||
|
||||
reply(Thread_base::myself()->stack_top());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user