mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 10:32:10 +00:00
- Add an address space region for the protected KVM firmware. - Query firmware size, mmap something that size and create a memslot. BUG=b:163789172 TEST=cargo test Change-Id: I054cf5d763c980d073c17bce70e85a781816b64d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2623942 Auto-Submit: Andrew Walbran <qwandor@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Andrew Walbran <qwandor@google.com> Tested-by: kokoro <noreply+kokoro@google.com>
20 lines
624 B
Rust
20 lines
624 B
Rust
// Copyright 2020 The Chromium OS Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
use std::io;
|
|
|
|
use crate::ProtectionType;
|
|
use base::{Event, RawDescriptor};
|
|
|
|
/// Abstraction over serial-like devices that can be created given an event and optional input and
|
|
/// output streams.
|
|
pub trait SerialDevice {
|
|
fn new(
|
|
protected_vm: ProtectionType,
|
|
interrupt_evt: Event,
|
|
input: Option<Box<dyn io::Read + Send>>,
|
|
output: Option<Box<dyn io::Write + Send>>,
|
|
keep_rds: Vec<RawDescriptor>,
|
|
) -> Self;
|
|
}
|