mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-11 15:29:18 +00:00
Fix bug causing vector removal to skip elements
This commit is contained in:
@ -83,8 +83,8 @@ namespace Driver
|
||||
}
|
||||
if (drv.MemTrk)
|
||||
delete drv.MemTrk, drv.MemTrk = nullptr;
|
||||
Drivers.remove(drv);
|
||||
}
|
||||
Drivers.clear();
|
||||
}
|
||||
|
||||
bool Driver::UnloadDriver(unsigned long DUID)
|
||||
@ -268,7 +268,10 @@ namespace Driver
|
||||
{
|
||||
SmartLock(DriverInterruptLock); /* Lock in case of multiple interrupts firing at the same time */
|
||||
if (!this->Enabled)
|
||||
{
|
||||
debug("Interrupt hook is not enabled");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Handle.InterruptCallback)
|
||||
{
|
||||
|
@ -131,6 +131,7 @@ namespace Interrupts
|
||||
{
|
||||
#if defined(a64)
|
||||
CPU::x64::TrapFrame *Frame = (CPU::x64::TrapFrame *)Data;
|
||||
// debug("IRQ%ld", Frame->InterruptNumber - 32);
|
||||
|
||||
memmove(InterruptFrames + 1, InterruptFrames, sizeof(InterruptFrames) - sizeof(InterruptFrames[0]));
|
||||
InterruptFrames[0] = (void *)Frame->rip;
|
||||
|
@ -43,6 +43,8 @@ namespace Random
|
||||
RDRANDFlag = cpuid.ECX.RDRAND;
|
||||
}
|
||||
}
|
||||
else
|
||||
RDRANDFlag = 0;
|
||||
}
|
||||
|
||||
if (RDRANDFlag)
|
||||
@ -80,6 +82,8 @@ namespace Random
|
||||
RDRANDFlag = cpuid.ECX.RDRAND;
|
||||
}
|
||||
}
|
||||
else
|
||||
RDRANDFlag = 0;
|
||||
}
|
||||
|
||||
if (RDRANDFlag)
|
||||
@ -117,6 +121,8 @@ namespace Random
|
||||
RDRANDFlag = cpuid.ECX.RDRAND;
|
||||
}
|
||||
}
|
||||
else
|
||||
RDRANDFlag = 0;
|
||||
}
|
||||
|
||||
if (RDRANDFlag)
|
||||
|
@ -161,7 +161,7 @@ namespace UniversalAsynchronousReceiverTransmitter
|
||||
|
||||
SafeFunction NIF Events::~Events()
|
||||
{
|
||||
for (uintptr_t i = 0; i < RegisteredEvents.size(); i++)
|
||||
for (size_t i = 0; i < RegisteredEvents.size(); i++)
|
||||
if (RegisteredEvents[i] == this)
|
||||
{
|
||||
RegisteredEvents.remove(i);
|
||||
|
Reference in New Issue
Block a user