serial_debugcon_resources/lib.rs
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4//! Resource definitions for the debugcon serial device.
5
6#![forbid(unsafe_code)]
7
8use mesh::MeshPayload;
9use vm_resource::Resource;
10use vm_resource::ResourceId;
11use vm_resource::kind::ChipsetDeviceHandleKind;
12use vm_resource::kind::SerialBackendHandle;
13
14/// A handle to a 16550A serial device.
15#[derive(MeshPayload)]
16pub struct SerialDebugconDeviceHandle {
17 /// Which IO port to put the single-byte debugcon register.
18 pub port: u16,
19 /// The IO backend.
20 pub io: Resource<SerialBackendHandle>,
21}
22
23impl ResourceId<ChipsetDeviceHandleKind> for SerialDebugconDeviceHandle {
24 const ID: &'static str = "debugcon";
25}