[Denali] Move signaling out of the command class.

This commit is contained in:
Drew Galbraith 2023-12-08 14:43:29 -08:00
parent d7c1022b7f
commit 28a0f02b05
6 changed files with 27 additions and 31 deletions

View file

@ -21,9 +21,8 @@ glcr::Status DenaliServer::HandleRead(const ReadRequest& req,
mmth::OwnedMemoryRegion::ContiguousPhysical(req.size() * 512, &paddr);
DmaReadCommand command(req.lba(), req.size(), paddr);
device->IssueCommand(&command);
command.WaitComplete();
ASSIGN_OR_RETURN(auto semaphore, device->IssueCommand(&command));
semaphore->Wait();
resp.set_device_id(req.device_id());
resp.set_size(req.size());
@ -51,8 +50,8 @@ glcr::Status DenaliServer::HandleReadMany(const ReadManyRequest& req,
uint64_t lba = req.lba().at(i);
uint64_t size = req.sector_cnt().at(i);
DmaReadCommand command(lba, size, region_paddr);
device->IssueCommand(&command);
command.WaitComplete();
ASSIGN_OR_RETURN(auto semaphore, device->IssueCommand(&command));
semaphore->Wait();
region_paddr += size * 512;
}