mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-23 01:08:55 +00:00
committed by
Christian Helmuth
parent
5e862b2cd3
commit
cfd013a01a
@ -104,8 +104,7 @@ class Virtio::Device
|
||||
Device_mmio _isr { _bar_range("irq_status") };
|
||||
size_t _notify_offset_multiplier { 0 };
|
||||
|
||||
template <typename FN>
|
||||
void with_virtio_range(String<16> type, FN const & fn)
|
||||
void with_virtio_range(String<16> type, auto const &fn)
|
||||
{
|
||||
_plat.update();
|
||||
_plat.with_xml([&] (Xml_node xml) {
|
||||
|
@ -429,8 +429,7 @@ class Virtio::Queue
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename FN>
|
||||
void read_data(FN const &fn)
|
||||
void read_data(auto const &fn)
|
||||
{
|
||||
if (!has_used_buffers())
|
||||
return;
|
||||
@ -470,12 +469,12 @@ class Virtio::Queue
|
||||
return *((Header_type *)(desc_data));
|
||||
}
|
||||
|
||||
template <typename REPLY_TYPE, typename WAIT_REPLY_FN, typename REPLY_FN>
|
||||
bool write_data_read_reply(Header_type const &header,
|
||||
char const *data,
|
||||
size_t data_size,
|
||||
WAIT_REPLY_FN const &wait_for_reply,
|
||||
REPLY_FN const &read_reply)
|
||||
template <typename REPLY_TYPE>
|
||||
bool write_data_read_reply(Header_type const &header,
|
||||
char const *data,
|
||||
size_t data_size,
|
||||
auto const &wait_for_reply_fn,
|
||||
auto const &read_reply_fn)
|
||||
{
|
||||
static_assert(!TRAITS::device_write_only);
|
||||
static_assert(TRAITS::has_data_payload);
|
||||
@ -521,7 +520,7 @@ class Virtio::Queue
|
||||
_avail->idx = _avail->idx + 1;
|
||||
_avail->flags = Avail::Flags::NO_INTERRUPT;
|
||||
|
||||
wait_for_reply();
|
||||
wait_for_reply_fn();
|
||||
|
||||
/*
|
||||
* Make sure wait call did what it was supposed to do.
|
||||
@ -536,16 +535,16 @@ class Virtio::Queue
|
||||
*/
|
||||
ack_all_transfers();
|
||||
|
||||
return read_reply(*reinterpret_cast<REPLY_TYPE const *>(reply_buffer.local_addr));
|
||||
return read_reply_fn(*reinterpret_cast<REPLY_TYPE const *>(reply_buffer.local_addr));
|
||||
}
|
||||
|
||||
template <typename REPLY_TYPE, typename WAIT_REPLY_FN, typename REPLY_FN>
|
||||
bool write_data_read_reply(Header_type const &header,
|
||||
WAIT_REPLY_FN const &wait_for_reply,
|
||||
REPLY_FN const &read_reply)
|
||||
template <typename REPLY_TYPE>
|
||||
bool write_data_read_reply(Header_type const &header,
|
||||
auto const &wait_for_reply_fn,
|
||||
auto const &read_reply_fn)
|
||||
{
|
||||
return write_data_read_reply<REPLY_TYPE>(
|
||||
header, nullptr, 0, wait_for_reply, read_reply);
|
||||
header, nullptr, 0, wait_for_reply_fn, read_reply_fn);
|
||||
}
|
||||
|
||||
void print(Output& output) const
|
||||
|
Reference in New Issue
Block a user