summaryrefslogtreecommitdiff
path: root/Kernel/IOWindow.cpp
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2022-10-04 03:05:54 +0300
committerAndreas Kling <kling@serenityos.org>2022-12-28 11:53:41 +0100
commit5ff318cf3ac7d12470c357ba0bac8cd7ffa10e3e (patch)
tree36b3982d64e9602e80f990ed86790d8868827998 /Kernel/IOWindow.cpp
parent32270dcd20344ae2cd753232634cdcd4f0a4300e (diff)
downloadserenity-5ff318cf3ac7d12470c357ba0bac8cd7ffa10e3e.zip
Kernel: Remove i686 support
Diffstat (limited to 'Kernel/IOWindow.cpp')
-rw-r--r--Kernel/IOWindow.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/Kernel/IOWindow.cpp b/Kernel/IOWindow.cpp
index 69e3a015ea..ef755220db 100644
--- a/Kernel/IOWindow.cpp
+++ b/Kernel/IOWindow.cpp
@@ -10,7 +10,7 @@
namespace Kernel {
-#if ARCH(I386) || ARCH(X86_64)
+#if ARCH(X86_64)
ErrorOr<NonnullOwnPtr<IOWindow>> IOWindow::create_for_io_space(IOAddress address, u64 space_length)
{
VERIFY(!Checked<u64>::addition_would_overflow(address.get(), space_length));
@@ -27,7 +27,7 @@ IOWindow::IOWindow(NonnullOwnPtr<IOAddressData> io_range)
ErrorOr<NonnullOwnPtr<IOWindow>> IOWindow::create_from_io_window_with_offset(u64 offset, u64 space_length)
{
-#if ARCH(I386) || ARCH(X86_64)
+#if ARCH(X86_64)
if (m_space_type == SpaceType::IO) {
VERIFY(m_io_range);
if (Checked<u64>::addition_would_overflow(m_io_range->address(), space_length))
@@ -39,19 +39,10 @@ ErrorOr<NonnullOwnPtr<IOWindow>> IOWindow::create_from_io_window_with_offset(u64
VERIFY(space_type() == SpaceType::Memory);
VERIFY(m_memory_mapped_range);
-// Note: x86-IA32 is the only 32 bit CPU architecture currently being supported and
-// probably will be the only such in the foreseeable future.
-#if ARCH(I386)
- if (Checked<u32>::addition_would_overflow(m_memory_mapped_range->paddr.get(), offset))
- return Error::from_errno(EOVERFLOW);
- if (Checked<u32>::addition_would_overflow(m_memory_mapped_range->paddr.get() + offset, space_length))
- return Error::from_errno(EOVERFLOW);
-#else
if (Checked<u64>::addition_would_overflow(m_memory_mapped_range->paddr.get(), offset))
return Error::from_errno(EOVERFLOW);
if (Checked<u64>::addition_would_overflow(m_memory_mapped_range->paddr.get() + offset, space_length))
return Error::from_errno(EOVERFLOW);
-#endif
auto memory_mapped_range = TRY(Memory::adopt_new_nonnull_own_typed_mapping<u8 volatile>(m_memory_mapped_range->paddr.offset(offset), space_length, Memory::Region::Access::ReadWrite));
return TRY(adopt_nonnull_own_or_enomem(new (nothrow) IOWindow(move(memory_mapped_range))));
@@ -60,7 +51,7 @@ ErrorOr<NonnullOwnPtr<IOWindow>> IOWindow::create_from_io_window_with_offset(u64
ErrorOr<NonnullOwnPtr<IOWindow>> IOWindow::create_from_io_window_with_offset(u64 offset)
{
-#if ARCH(I386) || ARCH(X86_64)
+#if ARCH(X86_64)
if (m_space_type == SpaceType::IO) {
VERIFY(m_io_range);
VERIFY(m_io_range->space_length() >= offset);
@@ -93,7 +84,7 @@ ErrorOr<NonnullOwnPtr<IOWindow>> IOWindow::create_for_pci_device_bar(PCI::Addres
return Error::from_errno(EIO);
if (pci_bar_space_type == PCI::BARSpaceType::IOSpace) {
-#if ARCH(I386) || ARCH(X86_64)
+#if ARCH(X86_64)
if (Checked<u64>::addition_would_overflow(pci_bar_value, space_length))
return Error::from_errno(EOVERFLOW);
auto io_address_range = TRY(adopt_nonnull_own_or_enomem(new (nothrow) IOAddressData((pci_bar_value & 0xfffffffc), space_length)));
@@ -148,7 +139,7 @@ bool IOWindow::is_access_in_range(u64 offset, size_t byte_size_access) const
{
if (Checked<u64>::addition_would_overflow(offset, byte_size_access))
return false;
-#if ARCH(I386) || ARCH(X86_64)
+#if ARCH(X86_64)
if (m_space_type == SpaceType::IO) {
VERIFY(m_io_range);
VERIFY(!Checked<u64>::addition_would_overflow(m_io_range->address(), m_io_range->space_length()));
@@ -273,7 +264,7 @@ u8 volatile* IOWindow::as_memory_address_pointer()
return m_memory_mapped_range->ptr();
}
-#if ARCH(I386) || ARCH(X86_64)
+#if ARCH(X86_64)
IOAddress IOWindow::as_io_address() const
{
VERIFY(space_type() == SpaceType::IO);