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