(&mut self, _base: u64, offset: u64, data: &mut [u8])
| 147 | |
| 148 | impl 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>() { |
nothing calls this directly
no test coverage detected