Files
serenity/Kernel/Interrupts/UnhandledInterruptHandler.cpp
Sönke Holz f8f25770d1 Kernel+lsirq: Stop using u8s for interrupt numbers
Architectures other than x86 support more than 256 interrupt sources,
so using `u8`s for interrupt numbers is not appropriate.

Instead, introduce a new `DistinctNumeric` "InterruptNumber" with an
underlying type of `size_t`.
Using a DistinctNumeric ensures that we don't accidentally convert
interrupt numbers to `u8`s (again).

Some places previously used `size_t`s for interrupts numbers, convert
them to `InteruptNumber`s as well.

Additionally, change the iteration variable of two for loops to avoid
'-Werror=sign-compare' errors.
2026-05-04 11:46:20 +02:00

28 lines
728 B
C++

/*
* Copyright (c) 2020, Liav A. <[email protected]>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/Interrupts/UnhandledInterruptHandler.h>
#include <Kernel/Library/Panic.h>
namespace Kernel {
UnhandledInterruptHandler::UnhandledInterruptHandler(InterruptNumber interrupt_vector)
: GenericInterruptHandler(interrupt_vector)
{
}
bool UnhandledInterruptHandler::handle_interrupt()
{
PANIC("Interrupt: Unhandled vector {} was invoked for handle_interrupt().", interrupt_number());
}
[[noreturn]] bool UnhandledInterruptHandler::eoi()
{
PANIC("Interrupt: Unhandled vector {} was invoked for eoi().", interrupt_number());
}
UnhandledInterruptHandler::~UnhandledInterruptHandler() = default;
}