1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:07:35 +00:00

Kernel: Implement read functionality for MemoryDevice

So far we only had mmap(2) functionality on the /dev/mem device, but now
we can also do read(2) on it.

The test unit was updated to check we are doing it safely.
This commit is contained in:
Liav A 2021-12-23 21:49:31 +02:00 committed by Idan Horowitz
parent 6feb07fe43
commit ca254699ec
4 changed files with 81 additions and 18 deletions

View file

@ -230,7 +230,7 @@ public:
PageDirectory& kernel_page_directory() { return *m_kernel_page_directory; }
Vector<UsedMemoryRange> const& used_memory_ranges() { return m_used_memory_ranges; }
bool is_allowed_to_mmap_physical_memory_to_userspace(PhysicalAddress, VirtualRange const&) const;
bool is_allowed_to_read_physical_memory_for_userspace(PhysicalAddress, size_t read_length) const;
PhysicalPageEntry& get_physical_page_entry(PhysicalAddress);
PhysicalAddress get_physical_address(PhysicalPage const&);