Kernel: Implement an asynchronous device request stack

This allows issuing asynchronous requests for devices and waiting
on the completion of the request. The requests can cascade into
multiple sub-requests.

Since IRQs may complete at any time, if the current process is no
longer the same that started the process, we need to swich the
paging context before accessing user buffers.

Change the PATA driver to use this model.
This commit is contained in:
Tom 2020-11-02 11:16:01 -07:00 committed by Andreas Kling
parent 96081010dc
commit 2fd5ce1eb0
Notes: sideshowbarker 2024-07-19 01:33:21 +09:00
17 changed files with 804 additions and 246 deletions

View file

@ -84,7 +84,7 @@ RefPtr<DiskPartition> GPTPartitionTable::partition(unsigned index)
GPTPartitionEntry entries[entries_per_sector];
auto entries_buffer = UserOrKernelBuffer::for_kernel_buffer((u8*)&entries);
this->m_device->read_blocks(lba, 1, entries_buffer);
this->m_device->read_block(lba, entries_buffer);
GPTPartitionEntry& entry = entries[((index - 1) % entries_per_sector)];
#ifdef GPT_DEBUG