L4Re Operating System Framework
Interface and Usage Documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
L4virtio::Svr::Virtio_rng< Rnd_state, Epiface > Class Template Reference

A server implementation of the virtio-rng protocol. More...

#include <virtio-rng-device>

+ Inheritance diagram for L4virtio::Svr::Virtio_rng< Rnd_state, Epiface >:
+ Collaboration diagram for L4virtio::Svr::Virtio_rng< Rnd_state, Epiface >:

Data Structures

class  Host_irq
 Handler for the host irq. More...
 
class  Request_processor
 Handler for the Virtio requests. More...
 

Public Member Functions

void reset () override
 reset callback, called for doing a device reset
 
bool check_queues () override
 callback for checking if the queues at DRIVER_OK transition
 
int reconfig_queue (unsigned idx) override
 callback for client queue-config request
 
void trigger_driver_config_irq () override
 callback for triggering configuration change notification IRQ
 
L4::Cap< L4::Irqdevice_notify_irq () const override
 callback to gather the device notification IRQ (old-style)
 
void register_single_driver_irq () override
 callback for registering a single guest IRQ for all queues (old-style)
 
- Public Member Functions inherited from L4virtio::Svr::Device_t< DATA >
virtual bool check_features ()
 callback for checking the subset of accepted features
 
virtual void cfg_changed (unsigned)
 callback for client device configuration changes
 
virtual void register_driver_irq (unsigned idx)
 Callback for registering an notification IRQ (multi IRQ).
 
virtual L4::Cap< L4::Irqdevice_notify_irq (unsigned idx)
 Callback to gather the device notification IRQ (multi IRQ).
 
virtual unsigned num_events_supported () const
 Return the highest notification index supported.
 
 Device_t (Dev_config *dev_config)
 Make a device for the given config.
 
Mem_list const * mem_info () const
 Get the memory region list used for this device.
 
void reset_queue_config (unsigned idx, unsigned num_max, bool inc_generation=false)
 Trigger reset for the configuration space for queue idx.
 
void init_mem_info (unsigned num)
 Initialize the memory region list to the given maximum.
 
void device_error ()
 Transition device into DEVICE_NEEDS_RESET state.
 
bool setup_queue (Virtqueue *q, unsigned qn, unsigned num_max)
 Enable/disable the specified queue.
 
bool handle_mem_cmd_write ()
 Check for a value in the cmd register and handle a write.
 
void enable_trusted_ds_validation ()
 Enable trusted dataspace validation.
 
void add_trusted_dataspaces (std::shared_ptr< Ds_vector const > ds)
 Provide a list of trusted dataspaces that can be used for validation.
 
- Public Member Functions inherited from L4::Epiface_t< Derived, IFACE, BASE, bool >
l4_msgtag_t dispatch (l4_msgtag_t tag, unsigned rights, l4_utcb_t *utcb) final
 The abstract handler for client requests to the object.
 
- Public Member Functions inherited from L4::Epiface_t0< RPC_IFACE, BASE >
Type_info::Demand get_buffer_demand () const
 Get the server-side buffer demand based in IFACE.
 
Cap< RPC_IFACE > obj_cap () const
 Get the (typed) capability to this object.
 
- Public Member Functions inherited from L4::Epiface
 Epiface ()
 Make a server object.
 
virtual ~Epiface ()=0
 Destroy the object.
 
Stored_cap obj_cap () const
 Get the capability to the kernel object belonging to this object.
 
Server_ifaceserver_iface () const
 Get pointer to server interface at which the object is currently registered.
 
int set_server (Server_iface *srv, Cap< void > cap, bool managed=false)
 Set server registration info for the object.
 
void set_obj_cap (Cap< void > const &cap)
 Deprecated server registration function.
 

Additional Inherited Members

- Public Types inherited from L4::Epiface_t0< RPC_IFACE, BASE >
typedef RPC_IFACE Interface
 Data type of the IPC interface definition.
 
- Public Types inherited from L4::Epiface
typedef Ipc_svr::Server_iface Server_iface
 Type for abstract server interface.
 
typedef Ipc_svr::Server_iface::Demand Demand
 Type for server-side receive buffer demand.
 
- Protected Attributes inherited from L4virtio::Svr::Device_t< DATA >
Mem_list _mem_info
 Memory region list.
 

Detailed Description

template<typename Rnd_state, typename Epiface = L4virtio::Device>
class L4virtio::Svr::Virtio_rng< Rnd_state, Epiface >

A server implementation of the virtio-rng protocol.

Template Parameters
Rnd_stateThe type that implements the random data generation. Rnd_state::get_random(int len, unsigned char *buf) is called to get len random bytes written into buf TODO: virtio-rng supports providing less random bytes then requested. This API currently does not support that, as I do not have a test case.
EpifaceThe Epiface to derive from. Defaults to L4virtio::Device.

Definition at line 33 of file virtio-rng-device.


The documentation for this class was generated from the following file: