mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-08 17:49:04 -10:00
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.
28 lines
728 B
C++
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;
|
|
}
|