Generalize the EndpointServer to require less boilerplate.

Classes can now inherit from the EndpointServer and just implement the
HandleRequest function.
This commit is contained in:
Drew Galbraith 2023-08-01 15:52:08 -07:00
parent 847d37addc
commit caccb08e16
14 changed files with 215 additions and 147 deletions

View file

@ -6,13 +6,14 @@
glcr::ErrorOr<MappedMemoryRegion> DenaliClient::ReadSectors(
uint64_t device_id, uint64_t lba, uint64_t num_sectors) {
DenaliRead read{
DenaliReadRequest read{
.device_id = device_id,
.lba = lba,
.size = num_sectors,
};
auto pair_or =
endpoint_->CallEndpointGetCap<DenaliRead, DenaliReadResponse>(read);
endpoint_->CallEndpointGetCap<DenaliReadRequest, DenaliReadResponse>(
read);
if (!pair_or) {
return pair_or.error();
}