mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-30 00:08:03 +00:00
Fixed issue when sometimes initializing drivers can crash the system
This commit is contained in:
parent
9bd37041a6
commit
0b7bbd20d6
@ -12,6 +12,7 @@
|
|||||||
#include "../DAPI.hpp"
|
#include "../DAPI.hpp"
|
||||||
#include "../Fex.hpp"
|
#include "../Fex.hpp"
|
||||||
|
|
||||||
|
NewLock(DriverInitLock);
|
||||||
NewLock(DriverDisplayPrintLock);
|
NewLock(DriverDisplayPrintLock);
|
||||||
|
|
||||||
namespace Driver
|
namespace Driver
|
||||||
@ -318,6 +319,7 @@ namespace Driver
|
|||||||
|
|
||||||
Driver::Driver()
|
Driver::Driver()
|
||||||
{
|
{
|
||||||
|
SmartCriticalSection(DriverInitLock);
|
||||||
FileSystem::FILE *DriverDirectory = vfs->Open(Config.DriverDirectory);
|
FileSystem::FILE *DriverDirectory = vfs->Open(Config.DriverDirectory);
|
||||||
if (DriverDirectory->Status == FileSystem::FileStatus::OK)
|
if (DriverDirectory->Status == FileSystem::FileStatus::OK)
|
||||||
foreach (auto driver in DriverDirectory->Node->Children)
|
foreach (auto driver in DriverDirectory->Node->Children)
|
||||||
@ -352,6 +354,7 @@ namespace Driver
|
|||||||
void DriverInterruptHook::OnInterruptReceived(void *Frame)
|
void DriverInterruptHook::OnInterruptReceived(void *Frame)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
CriticalSection cs; // or SmartCriticalSection(DriverInitLock); ?
|
||||||
((int (*)(void *))(Handle))(Data);
|
((int (*)(void *))(Handle))(Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user