mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
parent
f58cc1e83c
commit
6a186f6ed0
@ -212,6 +212,14 @@ class Genode::Packet_descriptor_queue
|
||||
return packet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current packet descriptor
|
||||
*/
|
||||
PACKET_DESCRIPTOR peek()
|
||||
{
|
||||
return _queue[_tail%QUEUE_SIZE];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if packet-descriptor queue is empty
|
||||
*/
|
||||
@ -404,6 +412,12 @@ class Genode::Packet_descriptor_receiver
|
||||
if (_rx_queue->single_slot_free())
|
||||
_tx_ready.submit();
|
||||
}
|
||||
|
||||
typename RX_QUEUE::Packet_descriptor_queue rx_peek()
|
||||
{
|
||||
Genode::Lock::Guard lock_guard(_rx_queue_lock);
|
||||
return _rx_queue->peek();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -798,6 +812,16 @@ class Genode::Packet_stream_sink : private Packet_stream_base
|
||||
return packet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return but do not dequeue next packet
|
||||
*
|
||||
* If there is no packet, an invalid packet descriptor is returned.
|
||||
*/
|
||||
Packet_descriptor peek_packet()
|
||||
{
|
||||
return _submit_receiver.rx_peek();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get pointer to the content of the specified packet
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user