mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-12 20:28:20 +00:00
committed by
Christian Helmuth
parent
5e862b2cd3
commit
cfd013a01a
@ -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