Kernel: Add API for implementing mmappable devices

This commit is contained in:
2023-11-28 23:50:49 +02:00
parent d86ecf4f61
commit 4a87d6052b
2 changed files with 33 additions and 17 deletions

View File

@@ -1,6 +1,7 @@
#pragma once
#include <kernel/FS/TmpFS/Inode.h>
#include <kernel/Memory/MemoryRegion.h>
namespace Kernel
{
@@ -15,6 +16,8 @@ namespace Kernel
virtual bool is_partition() const { return false; }
virtual bool is_storage_device() const { return false; }
virtual BAN::ErrorOr<BAN::UniqPtr<MemoryRegion>> mmap_region(PageTable&, off_t offset, size_t len, AddressRange, MemoryRegion::Type, PageTable::flags_t) { return BAN::Error::from_errno(EINVAL); }
virtual dev_t rdev() const override = 0;
virtual BAN::StringView name() const = 0;