2011-12-22 15:19:25 +00:00
|
|
|
/*
|
|
|
|
* \brief Server-side block session interface
|
|
|
|
* \author Stefan Kalkowski
|
|
|
|
* \date 2010-07-06
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2013-01-10 20:44:47 +00:00
|
|
|
* Copyright (C) 2010-2013 Genode Labs GmbH
|
2011-12-22 15:19:25 +00:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU General Public License version 2.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE__BLOCK_SESSION__SERVER_H_
|
|
|
|
#define _INCLUDE__BLOCK_SESSION__SERVER_H_
|
|
|
|
|
|
|
|
#include <block_session/block_session.h>
|
|
|
|
#include <packet_stream_tx/rpc_object.h>
|
|
|
|
#include <base/rpc_server.h>
|
|
|
|
|
2015-03-04 20:12:14 +00:00
|
|
|
namespace Block { class Session_rpc_object; }
|
|
|
|
|
|
|
|
|
|
|
|
class Block::Session_rpc_object : public Genode::Rpc_object<Session, Session_rpc_object>
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
|
|
|
|
Packet_stream_tx::Rpc_object<Tx> _tx;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
|
|
|
* \param tx_ds dataspace used as communication buffer
|
|
|
|
* for the tx packet stream
|
|
|
|
* \param ep entry point used for packet-stream channel
|
|
|
|
*/
|
|
|
|
Session_rpc_object(Genode::Dataspace_capability tx_ds,
|
|
|
|
Genode::Rpc_entrypoint &ep)
|
2016-07-22 08:05:52 +00:00
|
|
|
: _tx(tx_ds, *Genode::env()->rm_session(), ep) { }
|
2015-03-04 20:12:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return capability to packet-stream channel
|
|
|
|
*
|
2015-03-20 16:50:41 +00:00
|
|
|
* This method is called by the client via an RPC call at session
|
2015-03-04 20:12:14 +00:00
|
|
|
* construction time.
|
|
|
|
*/
|
|
|
|
Genode::Capability<Tx> _tx_cap() { return _tx.cap(); }
|
|
|
|
|
|
|
|
Tx::Sink *tx_sink() { return _tx.sink(); }
|
|
|
|
};
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
#endif /* _INCLUDE__BLOCK_SESSION__SERVER_H_ */
|