#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![deny(unsafe_code)] #![warn(missing_docs)]
#![warn(clippy::all)]
#![warn(clippy::pedantic)]
#![allow(clippy::module_name_repetitions)]
pub mod blk_mq;
pub mod error;
pub mod io_uring;
pub mod memory;
pub mod ublk;
#[cfg(feature = "std")]
pub mod executor;
#[cfg(feature = "std")]
pub mod fault;
#[cfg(feature = "std")]
pub mod pool;
#[cfg(feature = "std")]
pub mod scheduler;
#[cfg(feature = "std")]
pub mod task;
#[cfg(feature = "std")]
pub mod transport;
#[cfg(feature = "std")]
pub mod gpu;
#[cfg(feature = "std")]
pub mod simd;
#[cfg(feature = "std")]
pub mod virtio;
#[cfg(feature = "std")]
pub mod vmm;
#[cfg(feature = "std")]
pub mod zram;
pub use blk_mq::{BlockOps, Request, RequestOp, TagSetConfig};
pub use error::{KernelError, Result};
pub use io_uring::{IoUringCqe, IoUringSqe, IORING_OP_URING_CMD};
pub use memory::{DmaBuffer, DmaDirection, PageAllocator, Pfn, PhysAddr, VirtAddr};
pub use ublk::{
UblkCtrlCmd, UblkIoCmd, UblkIoDesc, UBLK_F_CMD_IOCTL_ENCODE, UBLK_F_SUPPORT_ZERO_COPY,
UBLK_F_USER_COPY, UBLK_U_CMD_ADD_DEV, UBLK_U_CMD_DEL_DEV, UBLK_U_CMD_GET_PARAMS,
UBLK_U_CMD_SET_PARAMS, UBLK_U_CMD_START_DEV, UBLK_U_CMD_STOP_DEV,
UBLK_U_IO_COMMIT_AND_FETCH_REQ, UBLK_U_IO_FETCH_REQ,
};
pub mod constants {
pub const SECTOR_SIZE: u32 = 512;
pub const PAGE_SIZE: usize = 4096;
pub const MAX_QUEUE_DEPTH: u16 = 32768;
pub const MAX_HW_QUEUES: u16 = 128;
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_public_api_accessible() {
let _ = core::mem::size_of::<UblkCtrlCmd>();
let _ = core::mem::size_of::<UblkIoDesc>();
let _ = core::mem::size_of::<UblkIoCmd>();
let _ = core::mem::size_of::<IoUringSqe>();
let _ = core::mem::size_of::<IoUringCqe>();
let _ = core::mem::size_of::<Pfn>();
let _ = core::mem::size_of::<PhysAddr>();
let _ = core::mem::size_of::<VirtAddr>();
let _ = core::mem::size_of::<Request>();
let _ = core::mem::size_of::<RequestOp>();
}
#[test]
fn test_constants() {
assert_eq!(constants::SECTOR_SIZE, 512);
assert_eq!(constants::PAGE_SIZE, 4096);
assert_eq!(constants::MAX_QUEUE_DEPTH, 32768);
}
}