MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / queue_input_bytes

Method queue_input_bytes

devices/src/legacy/uart_pl011.rs:220–235  ·  view source on GitHub ↗

Queues raw bytes for the guest to read and signals the interrupt

(&mut self, c: &[u8])

Source from the content-addressed store, hash-verified

218
219 /// Queues raw bytes for the guest to read and signals the interrupt
220 pub fn queue_input_bytes(&mut self, c: &[u8]) -> vmm_sys_util::errno::Result<()> {
221 self.read_fifo.extend(c);
222 self.read_count += c.len() as u32;
223 self.flags &= !PL011_FLAG_RXFE;
224
225 if ((self.lcr & 0x10) == 0) || (self.read_count == 16) {
226 self.flags |= PL011_FLAG_RXFF;
227 }
228
229 if self.read_count >= self.read_trigger {
230 self.int_level |= PL011_INT_RX;
231 self.trigger_interrupt()?;
232 }
233
234 Ok(())
235 }
236
237 pub fn flush_output(&mut self) -> result::Result<(), io::Error> {
238 if let Some(out) = self.out.as_mut() {

Callers 1

pl011_inputFunction · 0.45

Calls 3

extendMethod · 0.45
lenMethod · 0.45
trigger_interruptMethod · 0.45

Tested by 1

pl011_inputFunction · 0.36