1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-09 14:30:46 +00:00

Kernel: Replace VERIFY_NOT_REACHED with TODO_AARCH64

This makes it easier to differentiate between cases where certain
functionality is not implemented vs. cases where a code location
should really be unreachable.
This commit is contained in:
Gunnar Beutner 2022-10-16 16:23:44 +02:00 committed by Linus Groh
parent 9f3de0be6a
commit dfee6f73d2
10 changed files with 50 additions and 49 deletions

View File

@ -13,7 +13,7 @@ namespace Kernel {
void handle_crash(Kernel::RegisterState const&, char const*, int, bool)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
}

View File

@ -31,7 +31,7 @@ namespace Kernel {
void get_fast_random_bytes(Bytes)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
}
@ -41,12 +41,12 @@ namespace Kernel {
void Mutex::lock(Mode, [[maybe_unused]] LockLocation const& location)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
void Mutex::unlock()
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
}
@ -56,7 +56,7 @@ namespace Kernel {
SpinlockProtected<Process::List>& Process::all_instances()
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
}
@ -76,36 +76,36 @@ static Singleton<SpinlockProtected<Inode::AllInstancesList>> s_all_instances;
SpinlockProtected<Inode::AllInstancesList>& Inode::all_instances()
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return s_all_instances;
}
LockRefPtr<Memory::SharedInodeVMObject> Inode::shared_vmobject() const
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return LockRefPtr<Memory::SharedInodeVMObject>(nullptr);
}
void Inode::will_be_destroyed()
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
ErrorOr<void> Inode::set_shared_vmobject(Memory::SharedInodeVMObject&)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return {};
}
ErrorOr<size_t> Inode::read_bytes(off_t, size_t, UserOrKernelBuffer&, OpenFileDescription*) const
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return 0;
}
ErrorOr<size_t> Inode::write_bytes(off_t, size_t, UserOrKernelBuffer const&, OpenFileDescription*)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return 0;
}

View File

@ -83,7 +83,7 @@ void register_generic_interrupt_handler(u8 interrupt_number, GenericInterruptHan
if (!handler_slot->is_shared_handler()) {
if (handler_slot->type() == HandlerType::SpuriousInterruptHandler) {
// FIXME: Add support for spurious interrupts on aarch64
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
VERIFY(handler_slot->type() == HandlerType::IRQHandler);
auto& previous_handler = *handler_slot;

View File

@ -12,17 +12,17 @@ namespace Kernel::Memory {
void PageDirectory::register_page_directory(PageDirectory*)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
void PageDirectory::deregister_page_directory(PageDirectory*)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
LockRefPtr<PageDirectory> PageDirectory::find_current()
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return nullptr;
}
@ -33,7 +33,7 @@ void activate_kernel_page_directory(PageDirectory const&)
void activate_page_directory(PageDirectory const&, Thread*)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
}

View File

@ -60,25 +60,25 @@ public:
bool is_present() const { return (raw() & Present) == Present; }
void set_present(bool) { }
bool is_user_allowed() const { VERIFY_NOT_REACHED(); }
bool is_user_allowed() const { TODO_AARCH64(); }
void set_user_allowed(bool) { }
bool is_huge() const { VERIFY_NOT_REACHED(); }
bool is_huge() const { TODO_AARCH64(); }
void set_huge(bool) { }
bool is_writable() const { VERIFY_NOT_REACHED(); }
bool is_writable() const { TODO_AARCH64(); }
void set_writable(bool) { }
bool is_write_through() const { VERIFY_NOT_REACHED(); }
bool is_write_through() const { TODO_AARCH64(); }
void set_write_through(bool) { }
bool is_cache_disabled() const { VERIFY_NOT_REACHED(); }
bool is_cache_disabled() const { TODO_AARCH64(); }
void set_cache_disabled(bool) { }
bool is_global() const { VERIFY_NOT_REACHED(); }
bool is_global() const { TODO_AARCH64(); }
void set_global(bool) { }
bool is_execute_disabled() const { VERIFY_NOT_REACHED(); }
bool is_execute_disabled() const { TODO_AARCH64(); }
void set_execute_disabled(bool) { }
private:
@ -116,25 +116,25 @@ public:
bool is_present() const { return (raw() & Present) == Present; }
void set_present(bool) { }
bool is_user_allowed() const { VERIFY_NOT_REACHED(); }
bool is_user_allowed() const { TODO_AARCH64(); }
void set_user_allowed(bool) { }
bool is_writable() const { VERIFY_NOT_REACHED(); }
bool is_writable() const { TODO_AARCH64(); }
void set_writable(bool) { }
bool is_write_through() const { VERIFY_NOT_REACHED(); }
bool is_write_through() const { TODO_AARCH64(); }
void set_write_through(bool) { }
bool is_cache_disabled() const { VERIFY_NOT_REACHED(); }
bool is_cache_disabled() const { TODO_AARCH64(); }
void set_cache_disabled(bool) { }
bool is_global() const { VERIFY_NOT_REACHED(); }
bool is_global() const { TODO_AARCH64(); }
void set_global(bool) { }
bool is_execute_disabled() const { VERIFY_NOT_REACHED(); }
bool is_execute_disabled() const { TODO_AARCH64(); }
void set_execute_disabled(bool) { }
bool is_pat() const { VERIFY_NOT_REACHED(); }
bool is_pat() const { TODO_AARCH64(); }
void set_pat(bool) { }
bool is_null() const { return m_raw == 0; }

View File

@ -52,22 +52,22 @@ public:
ALWAYS_INLINE static void pause()
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
ALWAYS_INLINE static void wait_check()
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
ALWAYS_INLINE u8 physical_address_bit_width() const
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return 0;
}
ALWAYS_INLINE u8 virtual_address_bit_width() const
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return 0;
}
@ -103,13 +103,13 @@ public:
ALWAYS_INLINE static FlatPtr current_in_irq()
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return 0;
}
ALWAYS_INLINE static u64 read_cpu_counter()
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return 0;
}
@ -165,7 +165,7 @@ public:
static void deferred_call_queue(Function<void()> /* callback */)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
[[noreturn]] static void halt();

View File

@ -11,13 +11,13 @@ namespace Kernel {
bool safe_memset(void*, int, size_t, void*&)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return false;
}
ssize_t safe_strnlen(char const*, unsigned long, void*&)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return 0;
}
@ -30,31 +30,31 @@ bool safe_memcpy(void* dest_ptr, void const* src_ptr, unsigned long n, void*&)
Optional<bool> safe_atomic_compare_exchange_relaxed(u32 volatile*, u32&, u32)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return {};
}
Optional<u32> safe_atomic_load_relaxed(u32 volatile*)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return {};
}
Optional<u32> safe_atomic_fetch_add_relaxed(u32 volatile*, u32)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return {};
}
Optional<u32> safe_atomic_exchange_relaxed(u32 volatile*, u32)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return {};
}
bool safe_atomic_store_relaxed(u32 volatile*, u32)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return {};
}

View File

@ -15,23 +15,23 @@ ScopedCritical::~ScopedCritical() = default;
ScopedCritical::ScopedCritical(ScopedCritical&& /*from*/)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
ScopedCritical& ScopedCritical::operator=(ScopedCritical&& /*from*/)
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
return *this;
}
void ScopedCritical::leave()
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
void ScopedCritical::enter()
{
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
}

View File

@ -158,7 +158,7 @@ extern "C" [[noreturn]] void init()
for (;;)
asm volatile("wfi");
VERIFY_NOT_REACHED();
TODO_AARCH64();
}
class QueryFirmwareVersionMboxMessage : RPi::Mailbox::Message {

View File

@ -26,6 +26,7 @@ extern "C" {
}
#define TODO() __assertion_failed("TODO", __FILE__, __LINE__, __PRETTY_FUNCTION__)
#define TODO_AARCH64() __assertion_failed("TODO_AARCH64", __FILE__, __LINE__, __PRETTY_FUNCTION__)
#define VERIFY_INTERRUPTS_DISABLED() VERIFY(!(Processor::are_interrupts_enabled()))
#define VERIFY_INTERRUPTS_ENABLED() VERIFY(Processor::are_interrupts_enabled())