summaryrefslogtreecommitdiff
path: root/Kernel/VirtIO
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/VirtIO')
-rw-r--r--Kernel/VirtIO/VirtIO.cpp2
-rw-r--r--Kernel/VirtIO/VirtIO.h2
-rw-r--r--Kernel/VirtIO/VirtIOConsole.cpp4
-rw-r--r--Kernel/VirtIO/VirtIOConsole.h4
-rw-r--r--Kernel/VirtIO/VirtIOConsolePort.cpp4
-rw-r--r--Kernel/VirtIO/VirtIOConsolePort.h4
-rw-r--r--Kernel/VirtIO/VirtIOQueue.cpp6
-rw-r--r--Kernel/VirtIO/VirtIOQueue.h2
-rw-r--r--Kernel/VirtIO/VirtIORNG.cpp2
-rw-r--r--Kernel/VirtIO/VirtIORNG.h2
10 files changed, 16 insertions, 16 deletions
diff --git a/Kernel/VirtIO/VirtIO.cpp b/Kernel/VirtIO/VirtIO.cpp
index d1a20a334a..58553faa3a 100644
--- a/Kernel/VirtIO/VirtIO.cpp
+++ b/Kernel/VirtIO/VirtIO.cpp
@@ -109,7 +109,7 @@ auto VirtIODevice::mapping_for_bar(u8 bar) -> MappedMMIO&
auto& mapping = m_mmio[bar];
if (!mapping.base) {
mapping.size = PCI::get_BAR_space_size(pci_address(), bar);
- mapping.base = MM.allocate_kernel_region(PhysicalAddress(page_base_of(PCI::get_BAR(pci_address(), bar))), page_round_up(mapping.size), "VirtIO MMIO", Region::Access::Read | Region::Access::Write, Region::Cacheable::No);
+ mapping.base = MM.allocate_kernel_region(PhysicalAddress(page_base_of(PCI::get_BAR(pci_address(), bar))), Memory::page_round_up(mapping.size), "VirtIO MMIO", Memory::Region::Access::Read | Memory::Region::Access::Write, Memory::Region::Cacheable::No);
if (!mapping.base)
dbgln("{}: Failed to map bar {}", m_class_name, bar);
}
diff --git a/Kernel/VirtIO/VirtIO.h b/Kernel/VirtIO/VirtIO.h
index c6d5faa320..8d15c6820c 100644
--- a/Kernel/VirtIO/VirtIO.h
+++ b/Kernel/VirtIO/VirtIO.h
@@ -93,7 +93,7 @@ protected:
const String m_class_name;
struct MappedMMIO {
- OwnPtr<Region> base;
+ OwnPtr<Memory::Region> base;
size_t size { 0 };
template<typename T>
diff --git a/Kernel/VirtIO/VirtIOConsole.cpp b/Kernel/VirtIO/VirtIOConsole.cpp
index b1df8def1b..2bf1eef65e 100644
--- a/Kernel/VirtIO/VirtIOConsole.cpp
+++ b/Kernel/VirtIO/VirtIOConsole.cpp
@@ -108,8 +108,8 @@ void VirtIOConsole::handle_queue_update(u16 queue_index)
void VirtIOConsole::setup_multiport()
{
- m_control_receive_buffer = make<RingBuffer>("VirtIOConsole control receive queue", CONTROL_BUFFER_SIZE);
- m_control_transmit_buffer = make<RingBuffer>("VirtIOConsole control transmit queue", CONTROL_BUFFER_SIZE);
+ m_control_receive_buffer = make<Memory::RingBuffer>("VirtIOConsole control receive queue", CONTROL_BUFFER_SIZE);
+ m_control_transmit_buffer = make<Memory::RingBuffer>("VirtIOConsole control transmit queue", CONTROL_BUFFER_SIZE);
auto& queue = get_queue(CONTROL_RECEIVEQ);
ScopedSpinLock queue_lock(queue.lock());
diff --git a/Kernel/VirtIO/VirtIOConsole.h b/Kernel/VirtIO/VirtIOConsole.h
index 3a056b39ad..e22c69372b 100644
--- a/Kernel/VirtIO/VirtIOConsole.h
+++ b/Kernel/VirtIO/VirtIOConsole.h
@@ -68,8 +68,8 @@ private:
unsigned m_device_id;
- OwnPtr<RingBuffer> m_control_transmit_buffer;
- OwnPtr<RingBuffer> m_control_receive_buffer;
+ OwnPtr<Memory::RingBuffer> m_control_transmit_buffer;
+ OwnPtr<Memory::RingBuffer> m_control_receive_buffer;
WaitQueue m_control_wait_queue;
diff --git a/Kernel/VirtIO/VirtIOConsolePort.cpp b/Kernel/VirtIO/VirtIOConsolePort.cpp
index 32c960c74a..791d3ae845 100644
--- a/Kernel/VirtIO/VirtIOConsolePort.cpp
+++ b/Kernel/VirtIO/VirtIOConsolePort.cpp
@@ -17,8 +17,8 @@ VirtIOConsolePort::VirtIOConsolePort(unsigned port, VirtIOConsole& console)
, m_console(console)
, m_port(port)
{
- m_receive_buffer = make<RingBuffer>("VirtIOConsolePort Receive", RINGBUFFER_SIZE);
- m_transmit_buffer = make<RingBuffer>("VirtIOConsolePort Transmit", RINGBUFFER_SIZE);
+ m_receive_buffer = make<Memory::RingBuffer>("VirtIOConsolePort Receive", RINGBUFFER_SIZE);
+ m_transmit_buffer = make<Memory::RingBuffer>("VirtIOConsolePort Transmit", RINGBUFFER_SIZE);
m_receive_queue = m_port == 0 ? 0 : m_port * 2 + 2;
m_transmit_queue = m_port == 0 ? 1 : m_port * 2 + 3;
init_receive_buffer();
diff --git a/Kernel/VirtIO/VirtIOConsolePort.h b/Kernel/VirtIO/VirtIOConsolePort.h
index 9fbfe661ed..c866d3eafd 100644
--- a/Kernel/VirtIO/VirtIOConsolePort.h
+++ b/Kernel/VirtIO/VirtIOConsolePort.h
@@ -50,8 +50,8 @@ private:
u16 m_receive_queue {};
u16 m_transmit_queue {};
- OwnPtr<RingBuffer> m_receive_buffer;
- OwnPtr<RingBuffer> m_transmit_buffer;
+ OwnPtr<Memory::RingBuffer> m_receive_buffer;
+ OwnPtr<Memory::RingBuffer> m_transmit_buffer;
VirtIOConsole& m_console;
unsigned m_port;
diff --git a/Kernel/VirtIO/VirtIOQueue.cpp b/Kernel/VirtIO/VirtIOQueue.cpp
index 4fa2085631..e142f9e85e 100644
--- a/Kernel/VirtIO/VirtIOQueue.cpp
+++ b/Kernel/VirtIO/VirtIOQueue.cpp
@@ -17,11 +17,11 @@ VirtIOQueue::VirtIOQueue(u16 queue_size, u16 notify_offset)
size_t size_of_descriptors = sizeof(VirtIOQueueDescriptor) * queue_size;
size_t size_of_driver = sizeof(VirtIOQueueDriver) + queue_size * sizeof(u16);
size_t size_of_device = sizeof(VirtIOQueueDevice) + queue_size * sizeof(VirtIOQueueDeviceItem);
- auto queue_region_size = page_round_up(size_of_descriptors + size_of_driver + size_of_device);
+ auto queue_region_size = Memory::page_round_up(size_of_descriptors + size_of_driver + size_of_device);
if (queue_region_size <= PAGE_SIZE)
- m_queue_region = MM.allocate_kernel_region(queue_region_size, "VirtIO Queue", Region::Access::Read | Region::Access::Write);
+ m_queue_region = MM.allocate_kernel_region(queue_region_size, "VirtIO Queue", Memory::Region::Access::Read | Memory::Region::Access::Write);
else
- m_queue_region = MM.allocate_contiguous_kernel_region(queue_region_size, "VirtIO Queue", Region::Access::Read | Region::Access::Write);
+ m_queue_region = MM.allocate_contiguous_kernel_region(queue_region_size, "VirtIO Queue", Memory::Region::Access::Read | Memory::Region::Access::Write);
VERIFY(m_queue_region);
// TODO: ensure alignment!!!
u8* ptr = m_queue_region->vaddr().as_ptr();
diff --git a/Kernel/VirtIO/VirtIOQueue.h b/Kernel/VirtIO/VirtIOQueue.h
index 41d742cbc9..b081c531bc 100644
--- a/Kernel/VirtIO/VirtIOQueue.h
+++ b/Kernel/VirtIO/VirtIOQueue.h
@@ -93,7 +93,7 @@ private:
OwnPtr<VirtIOQueueDescriptor> m_descriptors { nullptr };
OwnPtr<VirtIOQueueDriver> m_driver { nullptr };
OwnPtr<VirtIOQueueDevice> m_device { nullptr };
- OwnPtr<Region> m_queue_region;
+ OwnPtr<Memory::Region> m_queue_region;
SpinLock<u8> m_lock;
friend class VirtIOQueueChain;
diff --git a/Kernel/VirtIO/VirtIORNG.cpp b/Kernel/VirtIO/VirtIORNG.cpp
index 87e5df815f..85094745af 100644
--- a/Kernel/VirtIO/VirtIORNG.cpp
+++ b/Kernel/VirtIO/VirtIORNG.cpp
@@ -21,7 +21,7 @@ UNMAP_AFTER_INIT VirtIORNG::VirtIORNG(PCI::Address address)
}
if (success) {
finish_init();
- m_entropy_buffer = MM.allocate_contiguous_kernel_region(PAGE_SIZE, "VirtIORNG", Region::Access::Read | Region::Access::Write);
+ m_entropy_buffer = MM.allocate_contiguous_kernel_region(PAGE_SIZE, "VirtIORNG", Memory::Region::Access::Read | Memory::Region::Access::Write);
if (m_entropy_buffer) {
memset(m_entropy_buffer->vaddr().as_ptr(), 0, m_entropy_buffer->size());
request_entropy_from_host();
diff --git a/Kernel/VirtIO/VirtIORNG.h b/Kernel/VirtIO/VirtIORNG.h
index 74826606db..8a4cd93148 100644
--- a/Kernel/VirtIO/VirtIORNG.h
+++ b/Kernel/VirtIO/VirtIORNG.h
@@ -36,7 +36,7 @@ private:
virtual void handle_queue_update(u16 queue_index) override;
void request_entropy_from_host();
- OwnPtr<Region> m_entropy_buffer;
+ OwnPtr<Memory::Region> m_entropy_buffer;
EntropySource m_entropy_source;
};