1#![forbid(unsafe_code)]
7
8pub mod command_match;
9mod error;
10mod namespace;
11mod pci;
12mod prp;
13mod queue;
14pub mod resolver;
15mod tdisp;
16mod workers;
17
18#[cfg(test)]
19mod tests;
20
21pub use pci::NvmeFaultController;
22pub use pci::NvmeFaultControllerCaps;
23pub use workers::NvmeFaultControllerClient;
24
25use guestmem::ranges::PagedRange;
26use nvme_spec as spec;
27use workers::AddNamespaceError;
28
29const DOORBELL_STRIDE_BITS: u8 = 2;
31const VENDOR_ID: u16 = pci_core::microsoft::VENDOR_ID;
32const DEVICE_ID: u16 = pci_core::microsoft::DeviceId::NVME.0;
33const NVME_VERSION: u32 = 0x00020000;
34const MAX_QES: u16 = 256;
35const MAX_NSID: u32 = 1024;
40const BAR0_LEN: u64 = 0x10000;
41const IOSQES: u8 = 6;
42const IOCQES: u8 = 4;
43
44const PAGE_SIZE: usize = 4096;
46const PAGE_SIZE64: u64 = 4096;
47const PAGE_MASK: u64 = !(PAGE_SIZE64 - 1);
48const PAGE_SHIFT: u32 = PAGE_SIZE.trailing_zeros();
49const _: () = assert!(PAGE_SIZE == PagedRange::PAGE_SIZE);