(
&mut self,
tpm_path: &Path,
)
| 2567 | |
| 2568 | #[cfg(not(target_arch = "riscv64"))] |
| 2569 | fn add_tpm_device( |
| 2570 | &mut self, |
| 2571 | tpm_path: &Path, |
| 2572 | ) -> DeviceManagerResult<Arc<Mutex<devices::tpm::Tpm>>> { |
| 2573 | // Create TPM Device |
| 2574 | let tpm = devices::tpm::Tpm::new(tpm_path).map_err(|e| { |
| 2575 | DeviceManagerError::CreateTpmDevice(anyhow!("Failed to create TPM Device : {e:?}")) |
| 2576 | })?; |
| 2577 | let tpm = Arc::new(Mutex::new(tpm)); |
| 2578 | |
| 2579 | // Add TPM Device to mmio |
| 2580 | self.address_manager |
| 2581 | .mmio_bus |
| 2582 | .insert( |
| 2583 | tpm.clone(), |
| 2584 | arch::layout::TPM_START.0, |
| 2585 | arch::layout::TPM_SIZE, |
| 2586 | ) |
| 2587 | .map_err(DeviceManagerError::BusError)?; |
| 2588 | |
| 2589 | Ok(tpm) |
| 2590 | } |
| 2591 | |
| 2592 | /// Tries to acquire advisory locks for all disk images. |
| 2593 | /// |
no test coverage detected