mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +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
|
@ -30,46 +30,6 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
class BlockDevice;
|
||||
|
||||
class AsyncBlockDeviceRequest : public AsyncDeviceRequest {
|
||||
public:
|
||||
enum RequestType {
|
||||
Read,
|
||||
Write
|
||||
};
|
||||
AsyncBlockDeviceRequest(Device& block_device, RequestType request_type,
|
||||
u32 block_index, u32 block_count, const UserOrKernelBuffer& buffer, size_t buffer_size);
|
||||
|
||||
RequestType request_type() const { return m_request_type; }
|
||||
u32 block_index() const { return m_block_index; }
|
||||
u32 block_count() const { return m_block_count; }
|
||||
UserOrKernelBuffer& buffer() { return m_buffer; }
|
||||
const UserOrKernelBuffer& buffer() const { return m_buffer; }
|
||||
size_t buffer_size() const { return m_buffer_size; }
|
||||
|
||||
virtual void start() override;
|
||||
virtual const char* name() const override
|
||||
{
|
||||
switch (m_request_type) {
|
||||
case Read:
|
||||
return "BlockDeviceRequest (read)";
|
||||
case Write:
|
||||
return "BlockDeviceRequest (read)";
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
BlockDevice& m_block_device;
|
||||
const RequestType m_request_type;
|
||||
const u32 m_block_index;
|
||||
const u32 m_block_count;
|
||||
UserOrKernelBuffer m_buffer;
|
||||
const size_t m_buffer_size;
|
||||
};
|
||||
|
||||
class BlockDevice : public Device {
|
||||
public:
|
||||
virtual ~BlockDevice() override;
|
||||
|
@ -77,10 +37,11 @@ public:
|
|||
size_t block_size() const { return m_block_size; }
|
||||
virtual bool is_seekable() const override { return true; }
|
||||
|
||||
bool read_block(unsigned index, UserOrKernelBuffer&);
|
||||
bool read_block(unsigned index, UserOrKernelBuffer&) const;
|
||||
bool write_block(unsigned index, const UserOrKernelBuffer&);
|
||||
|
||||
virtual void start_request(AsyncBlockDeviceRequest&) = 0;
|
||||
virtual bool read_blocks(unsigned index, u16 count, UserOrKernelBuffer&) = 0;
|
||||
virtual bool write_blocks(unsigned index, u16 count, const UserOrKernelBuffer&) = 0;
|
||||
|
||||
protected:
|
||||
BlockDevice(unsigned major, unsigned minor, size_t block_size = PAGE_SIZE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue