Kernel: Lock process functions instead of the ata controller
Process has to use locks at least on some functions so multithreaded disk io is safe. This seemed to fix corrupted reads from disk
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <BAN/StringView.h>
|
||||
#include <BAN/Vector.h>
|
||||
#include <kernel/FS/Inode.h>
|
||||
#include <kernel/SpinLock.h>
|
||||
#include <kernel/Thread.h>
|
||||
|
||||
namespace Kernel
|
||||
@@ -60,6 +61,8 @@ namespace Kernel
|
||||
|
||||
BAN::Vector<OpenFileDescription> m_open_files;
|
||||
|
||||
mutable SpinLock m_lock;
|
||||
|
||||
pid_t m_pid = 0;
|
||||
BAN::String m_working_directory;
|
||||
BAN::Vector<BAN::RefPtr<Thread>> m_threads;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <BAN/Errors.h>
|
||||
#include <kernel/SpinLock.h>
|
||||
#include <kernel/Storage/StorageController.h>
|
||||
|
||||
namespace Kernel
|
||||
@@ -68,7 +67,6 @@ namespace Kernel
|
||||
BAN::ErrorOr<void> write(ATADevice*, uint64_t, uint8_t, const uint8_t*);
|
||||
|
||||
private:
|
||||
SpinLock m_lock;
|
||||
ATABus m_buses[2];
|
||||
const PCIDevice& m_pci_device;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user