Kernel: Add GenericInterruptHandler.cpp to aarch64 build

This requires us to add an Interrupts.h file in the Kernel/Arch
directory, which includes the architecture specific files.

The commit also stubs out the functions to be able to compile the
aarch64 Kernel.
This commit is contained in:
Timon Kruiper 2022-05-11 16:54:03 +02:00 committed by Linus Groh
parent f1baa56cc8
commit 2fd5e9f729
Notes: sideshowbarker 2024-07-17 22:41:14 +09:00
9 changed files with 68 additions and 6 deletions

24
Kernel/Arch/Interrupts.h Normal file
View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2022, Timon Kruiper <timonkruiper@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Platform.h>
#include <AK/Types.h>
#if ARCH(X86_64) || ARCH(I386)
# include <Kernel/Arch/x86/Interrupts.h>
#endif
namespace Kernel {
class GenericInterruptHandler;
GenericInterruptHandler& get_interrupt_handler(u8 interrupt_number);
void register_generic_interrupt_handler(u8 number, GenericInterruptHandler&);
void unregister_generic_interrupt_handler(u8 number, GenericInterruptHandler&);
}

View file

@ -8,6 +8,7 @@
#include <AK/Types.h>
#include <Kernel/FileSystem/Inode.h>
#include <Kernel/Interrupts/InterruptManagement.h>
#include <Kernel/KString.h>
#include <Kernel/Locking/SpinlockProtected.h>
#include <Kernel/Memory/SharedInodeVMObject.h>
@ -136,3 +137,13 @@ void KString::operator delete(void*)
extern "C" {
FlatPtr kernel_mapping_base;
}
// InterruptManagement.cpp
namespace Kernel {
u8 InterruptManagement::acquire_mapped_interrupt_number(u8)
{
VERIFY_NOT_REACHED();
}
}

View file

@ -0,0 +1,26 @@
/*
* Copyright (c) 2022, Timon Kruiper <timonkruiper@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/Arch/Interrupts.h>
namespace Kernel {
GenericInterruptHandler& get_interrupt_handler(u8)
{
VERIFY_NOT_REACHED();
}
void register_generic_interrupt_handler(u8, GenericInterruptHandler&)
{
VERIFY_NOT_REACHED();
}
void unregister_generic_interrupt_handler(u8, GenericInterruptHandler&)
{
VERIFY_NOT_REACHED();
}
}

View file

@ -42,10 +42,7 @@ extern "C" void interrupt_common_asm_entry();
void register_interrupt_handler(u8 number, void (*handler)());
void register_user_callable_interrupt_handler(u8 number, void (*handler)());
GenericInterruptHandler& get_interrupt_handler(u8 interrupt_number);
void register_generic_interrupt_handler(u8 number, GenericInterruptHandler&);
void register_disabled_interrupt_handler(u8 number, GenericInterruptHandler& handler);
void unregister_generic_interrupt_handler(u8 number, GenericInterruptHandler&);
void idt_init();

View file

@ -7,6 +7,7 @@
#include <AK/Format.h>
#include <AK/Types.h>
#include <Kernel/Arch/Interrupts.h>
#include <Kernel/Interrupts/GenericInterruptHandler.h>
#include <Kernel/Interrupts/PIC.h>
#include <Kernel/Interrupts/SharedIRQHandler.h>

View file

@ -19,12 +19,12 @@
#include <Kernel/StdLib.h>
#include <Kernel/Thread.h>
#include <Kernel/Arch/Interrupts.h>
#include <Kernel/Arch/Processor.h>
#include <Kernel/Arch/SafeMem.h>
#include <Kernel/Arch/ScopedCritical.h>
#include <Kernel/Arch/x86/CPUID.h>
#include <Kernel/Arch/x86/InterruptDisabler.h>
#include <Kernel/Arch/x86/Interrupts.h>
#include <Kernel/Arch/x86/MSR.h>
#include <Kernel/Arch/x86/ProcessorInfo.h>
#include <Kernel/Arch/x86/TrapFrame.h>

View file

@ -416,6 +416,7 @@ else()
Arch/aarch64/Dummy.cpp
Arch/aarch64/Exceptions.cpp
Arch/aarch64/init.cpp
Arch/aarch64/Interrupts.cpp
Arch/aarch64/kprintf.cpp
Arch/aarch64/MainIdRegister.cpp
Arch/aarch64/MMU.cpp
@ -449,6 +450,8 @@ else()
Memory/SharedInodeVMObject.cpp
Memory/VirtualRange.cpp
Memory/VMObject.cpp
Interrupts/GenericInterruptHandler.cpp
)
# Otherwise linker errors e.g undefined reference to `__aarch64_cas8_acq_rel'

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/Arch/x86/Interrupts.h>
#include <Kernel/Arch/Interrupts.h>
#include <Kernel/Assertions.h>
#include <Kernel/Interrupts/GenericInterruptHandler.h>
#include <Kernel/Interrupts/InterruptManagement.h>

View file

@ -6,8 +6,8 @@
#include <AK/ByteReader.h>
#include <Kernel/API/Syscall.h>
#include <Kernel/Arch/Interrupts.h>
#include <Kernel/Arch/x86/InterruptDisabler.h>
#include <Kernel/Arch/x86/Interrupts.h>
#include <Kernel/CommandLine.h>
#include <Kernel/Firmware/MultiProcessor/Parser.h>
#include <Kernel/Interrupts/APIC.h>