hyperv_ic_protocol/
shutdown.rs1use crate::Version;
7use bitfield_struct::bitfield;
8use guid::Guid;
9use zerocopy::FromBytes;
10use zerocopy::Immutable;
11use zerocopy::IntoBytes;
12use zerocopy::KnownLayout;
13
14pub const INTERFACE_ID: Guid = guid::guid!("0e0b6031-5213-4934-818b-38d90ced39db");
16pub const INSTANCE_ID: Guid = guid::guid!("b6650ff7-33bc-4840-8048-e0676786f393");
18
19pub const SHUTDOWN_VERSION_1: Version = Version::new(1, 0);
21pub const SHUTDOWN_VERSION_3: Version = Version::new(3, 0);
23pub const SHUTDOWN_VERSION_3_1: Version = Version::new(3, 1);
25pub const SHUTDOWN_VERSION_3_2: Version = Version::new(3, 2);
27
28#[repr(C)]
30#[derive(IntoBytes, Immutable, KnownLayout, FromBytes)]
31pub struct ShutdownMessage {
32 pub reason_code: u32,
34 pub timeout_secs: u32,
37 pub flags: ShutdownFlags,
39 pub message: [u8; 2048],
41}
42
43#[bitfield(u32)]
45#[derive(IntoBytes, Immutable, KnownLayout, FromBytes)]
46pub struct ShutdownFlags {
47 pub force: bool,
49 pub restart: bool,
51 pub hibernate: bool,
53 #[bits(29)]
55 _reserved: u32,
56}
57
58pub const SHTDN_REASON_FLAG_PLANNED: u32 = 0x80000000;