refactor(userspace): split syscall/fat16/ext4 by concern; trim comments

This commit is contained in:
2026-10-27 13:21:53 +01:00
parent 99273db6d3
commit b4390b7b6d
25 changed files with 1283 additions and 1229 deletions

View File

@@ -29,9 +29,8 @@ pub struct VirtioBlockDevice {
}
impl VirtioBlockDevice {
/// Takes over the block device whose MMIO region `mmio` names: maps
/// it, allocates the queue and request buffers, and resets the device
/// onto them. `None` if any step fails or it is not a block device.
/// Takes over the virtio block device behind `mmio`. `None` if it is
/// not one or any step fails.
pub fn new(mmio: types::bounded::CapSlot) -> Option<Self> {
libkos::device::map_mmio(mmio, MMIO_BASE).ok()?;
let regs = UserMmio;

View File

@@ -37,10 +37,8 @@ pub struct VirtioFramebuffer {
}
impl VirtioFramebuffer {
/// Takes over the GPU whose MMIO region `mmio` names: maps it, sets up
/// the control queue and command buffer, asks for the display size,
/// allocates a framebuffer and makes it the scanout. `None` if it is
/// not a virtio GPU or any step fails.
/// Takes over the virtio GPU behind `mmio` and makes a framebuffer its
/// scanout. `None` if it is not a GPU or any step fails.
pub fn try_new(mmio: types::bounded::CapSlot) -> Option<Self> {
libkos::device::map_mmio(mmio, GPU_MMIO_VA).ok()?;
let regs = GpuMmio;

View File

@@ -31,10 +31,8 @@ pub struct VirtioInputDevice {
}
impl VirtioInputDevice {
/// Takes over the input device whose MMIO region `mmio` names: maps it,
/// allocates the queue and event buffers, resets the device onto them
/// and hands it every buffer. `None` if it is not a virtio input
/// device or a step fails.
/// Takes over the virtio input device behind `mmio`. `None` if it is
/// not one or any step fails.
pub fn try_new(mmio: types::bounded::CapSlot) -> Option<Self> {
libkos::device::map_mmio(mmio, INPUT_MMIO_VA).ok()?;
let regs = MmioInput;