Kernel: Ensure that we don't use a hard-disabled IRQController
This commit is contained in:
parent
893d4a41c2
commit
c2c0e9fb04
Notes:
sideshowbarker
2024-07-19 08:09:32 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/c2c0e9fb041 Pull-request: https://github.com/SerenityOS/serenity/pull/1361 Reviewed-by: https://github.com/awesomekling
2 changed files with 6 additions and 6 deletions
|
@ -245,6 +245,7 @@ int IOAPIC::find_redirection_entry_by_vector(u8 vector) const
|
|||
void IOAPIC::disable(u8 interrupt_vector)
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
ASSERT(!is_hard_disabled());
|
||||
int index = find_redirection_entry_by_vector(interrupt_vector);
|
||||
if (index == (-1)) {
|
||||
map_interrupt_redirection(interrupt_vector);
|
||||
|
@ -257,6 +258,7 @@ void IOAPIC::disable(u8 interrupt_vector)
|
|||
void IOAPIC::enable(u8 interrupt_vector)
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
ASSERT(!is_hard_disabled());
|
||||
int index = find_redirection_entry_by_vector(interrupt_vector);
|
||||
if (index == (-1)) {
|
||||
map_interrupt_redirection(interrupt_vector);
|
||||
|
@ -269,6 +271,7 @@ void IOAPIC::enable(u8 interrupt_vector)
|
|||
void IOAPIC::eoi(u8) const
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
ASSERT(!is_hard_disabled());
|
||||
APIC::eoi();
|
||||
}
|
||||
|
||||
|
|
|
@ -61,8 +61,7 @@ bool inline static is_all_masked(u8 reg)
|
|||
void PIC::disable(u8 irq)
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
if (is_hard_disabled())
|
||||
return;
|
||||
ASSERT(!is_hard_disabled());
|
||||
u8 imr;
|
||||
if (irq >= 8) {
|
||||
imr = IO::in8(PIC1_CMD);
|
||||
|
@ -99,8 +98,7 @@ bool PIC::is_vector_enabled(u8 irq) const
|
|||
void PIC::enable(u8 irq)
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
if (is_hard_disabled())
|
||||
return;
|
||||
ASSERT(!is_hard_disabled());
|
||||
u8 imr;
|
||||
if (irq >= 8) {
|
||||
imr = IO::in8(PIC1_CMD);
|
||||
|
@ -117,8 +115,7 @@ void PIC::enable(u8 irq)
|
|||
void PIC::eoi(u8 irq) const
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
if (is_hard_disabled())
|
||||
return;
|
||||
ASSERT(!is_hard_disabled());
|
||||
if (irq >= 8)
|
||||
IO::out8(PIC1_CTL, 0x20);
|
||||
IO::out8(PIC0_CTL, 0x20);
|
||||
|
|
Loading…
Add table
Reference in a new issue