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

Kernel: Add support for reading from VirtIOConsole

This allows two-way communication with the host through a VirtIOConsole.
This is necessary for features like clipboard sharing.
This commit is contained in:
x-yl 2021-06-20 17:46:04 +04:00 committed by Ali Mohammad Pur
parent 1c06d77262
commit 1492bb2fd6
5 changed files with 74 additions and 8 deletions

View file

@ -17,10 +17,14 @@ public:
bool has_space() const { return m_num_used_bytes < m_capacity_in_bytes; }
bool copy_data_in(const UserOrKernelBuffer& buffer, size_t offset, size_t length, PhysicalAddress& start_of_copied_data, size_t& bytes_copied);
KResultOr<size_t> copy_data_out(size_t size, UserOrKernelBuffer& buffer) const;
KResultOr<PhysicalAddress> reserve_space(size_t size);
void reclaim_space(PhysicalAddress chunk_start, size_t chunk_size);
PhysicalAddress start_of_used() const;
SpinLock<u8>& lock() { return m_lock; }
size_t used_bytes() const { return m_num_used_bytes; }
PhysicalAddress start_of_region() const { return m_region->physical_page(0)->paddr(); }
private:
OwnPtr<Region> m_region;