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

Method read

devices/src/ioapic.rs:149–167  ·  view source on GitHub ↗
(&mut self, _base: u64, offset: u64, data: &mut [u8])

Source from the content-addressed store, hash-verified

147
148impl BusDevice for Ioapic {
149 fn read(&mut self, _base: u64, offset: u64, data: &mut [u8]) {
150 if data.len() != std::mem::size_of::<u32>() {
151 warn!("Invalid read size on IOAPIC: {}", data.len());
152 return;
153 }
154
155 debug!("IOAPIC_R @ offset 0x{offset:x}");
156
157 let value: u32 = match offset as u8 {
158 IOREGSEL_OFF => self.reg_sel,
159 IOWIN_OFF => self.ioapic_read(),
160 _ => {
161 error!("IOAPIC: failed reading at offset {offset}");
162 return;
163 }
164 };
165
166 LittleEndian::write_u32(data, value);
167 }
168
169 fn write(&mut self, _base: u64, offset: u64, data: &[u8]) -> Option<Arc<Barrier>> {
170 if data.len() != std::mem::size_of::<u32>() {

Callers

nothing calls this directly

Calls 2

ioapic_readMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected