mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +00:00
Revert "Kernel: Implement an asynchronous device request stack"
This reverts commit 2fd5ce1eb0
.
This broke booting without SMP. (PR was #3921)
This commit is contained in:
parent
70eaadc1cd
commit
501cef2bd7
17 changed files with 245 additions and 803 deletions
|
@ -34,12 +34,10 @@
|
|||
// There are two main subclasses:
|
||||
// - BlockDevice (random access)
|
||||
// - CharacterDevice (sequential)
|
||||
#include <AK/DoublyLinkedList.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <Kernel/Devices/AsyncDeviceRequest.h>
|
||||
#include <Kernel/Arch/i386/CPU.h>
|
||||
#include <Kernel/FileSystem/File.h>
|
||||
#include <Kernel/Lock.h>
|
||||
#include <Kernel/UnixTypes.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
@ -63,23 +61,6 @@ public:
|
|||
static void for_each(Function<void(Device&)>);
|
||||
static Device* get_device(unsigned major, unsigned minor);
|
||||
|
||||
void process_next_queued_request(Badge<AsyncDeviceRequest>, const AsyncDeviceRequest&);
|
||||
|
||||
template<typename AsyncRequestType, typename... Args>
|
||||
NonnullRefPtr<AsyncRequestType> make_request(Args&&... args)
|
||||
{
|
||||
auto request = adopt(*new AsyncRequestType(*this, forward<Args>(args)...));
|
||||
bool was_empty;
|
||||
{
|
||||
ScopedSpinLock lock(m_requests_lock);
|
||||
was_empty = m_requests.is_empty();
|
||||
m_requests.append(request);
|
||||
}
|
||||
if (was_empty)
|
||||
request->do_start({});
|
||||
return request;
|
||||
}
|
||||
|
||||
protected:
|
||||
Device(unsigned major, unsigned minor);
|
||||
void set_uid(uid_t uid) { m_uid = uid; }
|
||||
|
@ -92,9 +73,6 @@ private:
|
|||
unsigned m_minor { 0 };
|
||||
uid_t m_uid { 0 };
|
||||
gid_t m_gid { 0 };
|
||||
|
||||
SpinLock<u8> m_requests_lock;
|
||||
DoublyLinkedList<RefPtr<AsyncDeviceRequest>> m_requests;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue