Interrupts: Assert if trying to install an handler on syscall vector
Installing an interrupt handler on the syscall IDT vector can lead to fatal results, so we must assert if that happens.
This commit is contained in:
parent
f86be46c98
commit
dbc536e917
Notes:
sideshowbarker
2024-07-19 08:09:17 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/dbc536e9177 Pull-request: https://github.com/SerenityOS/serenity/pull/1361 Reviewed-by: https://github.com/awesomekling
3 changed files with 6 additions and 1 deletions
|
@ -34,6 +34,7 @@
|
|||
#include <Kernel/Interrupts/PIC.h>
|
||||
#include <Kernel/Interrupts/SpuriousInterruptHandler.h>
|
||||
#include <Kernel/Interrupts/UnhandledInterruptHandler.h>
|
||||
#include <Kernel/Syscall.h>
|
||||
#include <Kernel/VM/MemoryManager.h>
|
||||
#include <LibBareMetal/IO.h>
|
||||
|
||||
|
@ -99,6 +100,8 @@ u8 InterruptManagement::acquire_irq_number(u8 mapped_interrupt_vector)
|
|||
u8 InterruptManagement::get_mapped_interrupt_vector(u8 original_irq)
|
||||
{
|
||||
// FIXME: For SMP configuration (with IOAPICs) use a better routing scheme to make redirections more efficient.
|
||||
// FIXME: Find a better way to handle conflict with Syscall interrupt gate.
|
||||
ASSERT((original_irq + IRQ_VECTOR_BASE) != syscall_vector);
|
||||
return original_irq;
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ static int handle(RegisterState&, u32 function, u32 arg1, u32 arg2, u32 arg3);
|
|||
|
||||
void initialize()
|
||||
{
|
||||
register_user_callable_interrupt_handler(0x82, syscall_asm_entry);
|
||||
register_user_callable_interrupt_handler(syscall_vector, syscall_asm_entry);
|
||||
klog() << "Syscall: int 0x82 handler installed";
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
# include <LibC/fd_set.h>
|
||||
#endif
|
||||
|
||||
constexpr int syscall_vector = 0x82;
|
||||
|
||||
extern "C" {
|
||||
struct timeval;
|
||||
struct timespec;
|
||||
|
|
Loading…
Add table
Reference in a new issue