(
&mut self,
command: &[String],
irq_num: usize,
mmio_ranges: Vec<u64>,
)
| 233 | } |
| 234 | |
| 235 | pub fn load_binary( |
| 236 | &mut self, |
| 237 | command: &[String], |
| 238 | irq_num: usize, |
| 239 | mmio_ranges: Vec<u64>, |
| 240 | ) -> Result<(VirtMem, DeviceStatus, DriverStatus)> { |
| 241 | let binary = try_core_res!(ElfBinary::new(self.binary), "cannot parse elf binary"); |
| 242 | |
| 243 | self.string_arg_size = page_align(command.iter().map(|c| c.len() + 1).sum()); |
| 244 | try_core_res!(binary.load(self), "cannot load elf binary"); |
| 245 | |
| 246 | let (device_status, driver_status) = try_with!( |
| 247 | self.write_stage1_args(command, irq_num, mmio_ranges), |
| 248 | "failed to write stage1 arguments" |
| 249 | ); |
| 250 | |
| 251 | try_with!(self.upload_binary(), "failed to upload binary to vm"); |
| 252 | let mem = require_with!(self.virt_mem.take(), "BUG, no virtual memory assigned"); |
| 253 | Ok((mem, device_status, driver_status)) |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | type ElfResult = std::result::Result<(), ElfLoaderErr>; |
nothing calls this directly
no test coverage detected