From a0c1af4327617eea3c9fe213ba2483bdfe119da3 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sun, 27 Jun 2021 21:59:48 +0200 Subject: [PATCH] Kernel: Specify I/O size for BMIDEChannel --- Kernel/IO.h | 2 ++ Kernel/Storage/BMIDEChannel.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Kernel/IO.h b/Kernel/IO.h index 76adbd07497..ca9955e9fbd 100644 --- a/Kernel/IO.h +++ b/Kernel/IO.h @@ -82,6 +82,7 @@ public: template ALWAYS_INLINE T in() { + static_assert(sizeof(T) <= 4); if constexpr (sizeof(T) == 4) return IO::in32(get()); if constexpr (sizeof(T) == 2) @@ -94,6 +95,7 @@ public: template ALWAYS_INLINE void out(T value) { + static_assert(sizeof(T) <= 4); if constexpr (sizeof(T) == 4) { IO::out32(get(), value); return; diff --git a/Kernel/Storage/BMIDEChannel.cpp b/Kernel/Storage/BMIDEChannel.cpp index 46363006993..cbbb6eccedc 100644 --- a/Kernel/Storage/BMIDEChannel.cpp +++ b/Kernel/Storage/BMIDEChannel.cpp @@ -212,7 +212,7 @@ void BMIDEChannel::ata_read_sectors(bool slave_request, u16 capabilities) m_io_group.bus_master_base().value().out(0); // Write the PRDT location - m_io_group.bus_master_base().value().offset(4).out(m_prdt_page->paddr().get()); + m_io_group.bus_master_base().value().offset(4).out(m_prdt_page->paddr().get()); // Set transfer direction m_io_group.bus_master_base().value().out(0x8);