mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
c6f2890d8e
FileHandle gets a hasDataAvailableForRead() getter. If this returns true in sys$read(), the task will block(BlockedRead) + yield. The fd blocked on is stored in Task::m_fdBlockedOnRead. The scheduler then looks at the state of that fd during the unblock phase. This makes "sh" restful. :^) There's still some problem with the kernel not surviving the colonel task getting scheduled. I need to figure that out and fix it.
27 lines
639 B
C++
27 lines
639 B
C++
#pragma once
|
|
|
|
#include <AK/Types.h>
|
|
#include <AK/DoublyLinkedList.h>
|
|
#include <AK/CircularQueue.h>
|
|
#include <VirtualFileSystem/CharacterDevice.h>
|
|
#include "IRQHandler.h"
|
|
|
|
class Keyboard final : public IRQHandler, public CharacterDevice {
|
|
public:
|
|
virtual ~Keyboard() override;
|
|
Keyboard();
|
|
|
|
private:
|
|
// ^IRQHandler
|
|
virtual void handleIRQ() override;
|
|
|
|
// ^CharacterDevice
|
|
virtual ssize_t read(byte* buffer, size_t) override;
|
|
virtual ssize_t write(const byte* buffer, size_t) override;
|
|
virtual bool hasDataAvailableForRead() const override;
|
|
|
|
CircularQueue<byte, 16> m_queue;
|
|
byte m_modifiers { 0 };
|
|
};
|
|
|