From 8fe0a7514fa82f04ea268cb214292cdf0ec234c2 Mon Sep 17 00:00:00 2001 From: Martijn Verschoor Date: Wed, 25 Oct 2017 10:44:22 +0200 Subject: [PATCH] Nic::Session_component: pass entrypoint in constructor Added a new constructor that takes the entrypoint as constructor argument. The original constructor retrieves the entrypoint from the Genode environment. This does not allow to use a different entrypoint. --- repos/os/include/nic/component.h | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/repos/os/include/nic/component.h b/repos/os/include/nic/component.h index f5c552daa3..8d8de5343e 100644 --- a/repos/os/include/nic/component.h +++ b/repos/os/include/nic/component.h @@ -108,6 +108,39 @@ class Nic::Session_component : Communication_buffers, public Session_rpc_object _rx.sigh_ack_avail(_packet_stream_dispatcher); } + /** + * Constructor + * + * \param tx_buf_size buffer size for tx channel + * \param rx_buf_size buffer size for rx channel + * \param rx_block_md_alloc backing store of the meta data of the + * rx block allocator + * \param env Genode environment needed to access + * resources and open connections from + * within the Session_component + * \param ep entrypoint for RPC + */ + Session_component(Genode::size_t const tx_buf_size, + Genode::size_t const rx_buf_size, + Genode::Allocator &rx_block_md_alloc, + Genode::Env &env, + Genode::Entrypoint &ep) + : + Communication_buffers(rx_block_md_alloc, env.ram(), env.rm(), + tx_buf_size, rx_buf_size), + Session_rpc_object(env.rm(), + _tx_ds.cap(), + _rx_ds.cap(), + &_rx_packet_alloc, ep.rpc_ep()), + _ep(ep) + { + /* install data-flow signal handlers for both packet streams */ + _tx.sigh_ready_to_ack(_packet_stream_dispatcher); + _tx.sigh_packet_avail(_packet_stream_dispatcher); + _rx.sigh_ready_to_submit(_packet_stream_dispatcher); + _rx.sigh_ack_avail(_packet_stream_dispatcher); + } + void link_state_sigh(Genode::Signal_context_capability sigh) { _link_state_sigh = sigh;