From 5ff318cf3ac7d12470c357ba0bac8cd7ffa10e3e Mon Sep 17 00:00:00 2001 From: Liav A Date: Tue, 4 Oct 2022 03:05:54 +0300 Subject: Kernel: Remove i686 support --- Kernel/IOWindow.cpp | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'Kernel/IOWindow.cpp') 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> IOWindow::create_for_io_space(IOAddress address, u64 space_length) { VERIFY(!Checked::addition_would_overflow(address.get(), space_length)); @@ -27,7 +27,7 @@ IOWindow::IOWindow(NonnullOwnPtr io_range) ErrorOr> 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::addition_would_overflow(m_io_range->address(), space_length)) @@ -39,19 +39,10 @@ ErrorOr> 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::addition_would_overflow(m_memory_mapped_range->paddr.get(), offset)) - return Error::from_errno(EOVERFLOW); - if (Checked::addition_would_overflow(m_memory_mapped_range->paddr.get() + offset, space_length)) - return Error::from_errno(EOVERFLOW); -#else if (Checked::addition_would_overflow(m_memory_mapped_range->paddr.get(), offset)) return Error::from_errno(EOVERFLOW); if (Checked::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(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> IOWindow::create_from_io_window_with_offset(u64 ErrorOr> 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> 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::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::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::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); -- cgit v1.2.3