summaryrefslogtreecommitdiff
path: root/Kernel/Bus/VirtIO
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Bus/VirtIO')
-rw-r--r--Kernel/Bus/VirtIO/Queue.cpp6
-rw-r--r--Kernel/Bus/VirtIO/Queue.h12
2 files changed, 9 insertions, 9 deletions
diff --git a/Kernel/Bus/VirtIO/Queue.cpp b/Kernel/Bus/VirtIO/Queue.cpp
index d6be1bdf73..df2cc2fa94 100644
--- a/Kernel/Bus/VirtIO/Queue.cpp
+++ b/Kernel/Bus/VirtIO/Queue.cpp
@@ -25,9 +25,9 @@ Queue::Queue(u16 queue_size, u16 notify_offset)
// TODO: ensure alignment!!!
u8* ptr = m_queue_region->vaddr().as_ptr();
memset(ptr, 0, m_queue_region->size());
- m_descriptors = adopt_own_if_nonnull(reinterpret_cast<QueueDescriptor*>(ptr));
- m_driver = adopt_own_if_nonnull(reinterpret_cast<QueueDriver*>(ptr + size_of_descriptors));
- m_device = adopt_own_if_nonnull(reinterpret_cast<QueueDevice*>(ptr + size_of_descriptors + size_of_driver));
+ m_descriptors = reinterpret_cast<QueueDescriptor*>(ptr);
+ m_driver = reinterpret_cast<QueueDriver*>(ptr + size_of_descriptors);
+ m_device = reinterpret_cast<QueueDevice*>(ptr + size_of_descriptors + size_of_driver);
for (auto i = 0; i + 1 < queue_size; i++) {
m_descriptors[i].next = i + 1; // link all of the descriptors in a line
diff --git a/Kernel/Bus/VirtIO/Queue.h b/Kernel/Bus/VirtIO/Queue.h
index b2604e7468..2b8872fde7 100644
--- a/Kernel/Bus/VirtIO/Queue.h
+++ b/Kernel/Bus/VirtIO/Queue.h
@@ -37,9 +37,9 @@ public:
void enable_interrupts();
void disable_interrupts();
- PhysicalAddress descriptor_area() const { return to_physical(m_descriptors.ptr()); }
- PhysicalAddress driver_area() const { return to_physical(m_driver.ptr()); }
- PhysicalAddress device_area() const { return to_physical(m_device.ptr()); }
+ PhysicalAddress descriptor_area() const { return to_physical(m_descriptors); }
+ PhysicalAddress driver_area() const { return to_physical(m_driver); }
+ PhysicalAddress device_area() const { return to_physical(m_device); }
bool new_data_available() const;
bool has_free_slots() const;
@@ -90,9 +90,9 @@ private:
u16 m_used_tail { 0 };
u16 m_driver_index_shadow { 0 };
- OwnPtr<QueueDescriptor> m_descriptors { nullptr };
- OwnPtr<QueueDriver> m_driver { nullptr };
- OwnPtr<QueueDevice> m_device { nullptr };
+ QueueDescriptor* m_descriptors { nullptr };
+ QueueDriver* m_driver { nullptr };
+ QueueDevice* m_device { nullptr };
OwnPtr<Memory::Region> m_queue_region;
Spinlock m_lock;