mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
Kernel: Support multiport for VirtIOConsole
This involves refactoring VirtIOConsole into VirtIOConsole and VirtIOConsolePort. VirtIOConsole is the VirtIODevice, it owns multiple VirtIOConsolePorts as well as two control queues. Each VirtIOConsolePort is a CharacterDevice.
This commit is contained in:
parent
1492bb2fd6
commit
1fe08759e3
6 changed files with 419 additions and 126 deletions
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <AK/String.h>
|
||||
#include <Kernel/PhysicalAddress.h>
|
||||
#include <Kernel/UserOrKernelBuffer.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -25,6 +26,8 @@ public:
|
|||
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(); }
|
||||
VirtualAddress vaddr() const { return m_region->vaddr(); }
|
||||
size_t bytes_till_end() const { return (m_capacity_in_bytes - ((m_start_of_used + m_num_used_bytes) % m_capacity_in_bytes)) % m_capacity_in_bytes; };
|
||||
|
||||
private:
|
||||
OwnPtr<Region> m_region;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue