[Yunq] Read capabilities using the parsing library.
This commit is contained in:
parent
0e6aa532a1
commit
75d84a0fa5
7 changed files with 41 additions and 40 deletions
|
|
@ -177,8 +177,7 @@ glcr::Status ReadResponse::ParseFromBytes(const glcr::ByteBuffer& bytes, uint64_
|
|||
yunq::MessageView message(bytes, offset);
|
||||
RETURN_ERROR(ParseFromBytesInternal(message));
|
||||
// Parse memory.
|
||||
// FIXME: Implement in-buffer capabilities for inprocess serialization.
|
||||
set_memory(0);
|
||||
ASSIGN_OR_RETURN(memory_, message.ReadCapability(2));
|
||||
return glcr::Status::Ok();
|
||||
}
|
||||
|
||||
|
|
@ -186,9 +185,7 @@ glcr::Status ReadResponse::ParseFromBytes(const glcr::ByteBuffer& bytes, uint64_
|
|||
yunq::MessageView message(bytes, offset);
|
||||
RETURN_ERROR(ParseFromBytesInternal(message));
|
||||
// Parse memory.
|
||||
uint64_t memory_ptr = bytes.At<uint64_t>(offset + header_size + (8 * 2));
|
||||
|
||||
set_memory(caps.At(memory_ptr));
|
||||
ASSIGN_OR_RETURN(memory_, message.ReadCapability(2, caps));
|
||||
return glcr::Status::Ok();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -81,8 +81,7 @@ glcr::Status OpenFileResponse::ParseFromBytes(const glcr::ByteBuffer& bytes, uin
|
|||
yunq::MessageView message(bytes, offset);
|
||||
RETURN_ERROR(ParseFromBytesInternal(message));
|
||||
// Parse memory.
|
||||
// FIXME: Implement in-buffer capabilities for inprocess serialization.
|
||||
set_memory(0);
|
||||
ASSIGN_OR_RETURN(memory_, message.ReadCapability(2));
|
||||
return glcr::Status::Ok();
|
||||
}
|
||||
|
||||
|
|
@ -90,9 +89,7 @@ glcr::Status OpenFileResponse::ParseFromBytes(const glcr::ByteBuffer& bytes, uin
|
|||
yunq::MessageView message(bytes, offset);
|
||||
RETURN_ERROR(ParseFromBytesInternal(message));
|
||||
// Parse memory.
|
||||
uint64_t memory_ptr = bytes.At<uint64_t>(offset + header_size + (8 * 2));
|
||||
|
||||
set_memory(caps.At(memory_ptr));
|
||||
ASSIGN_OR_RETURN(memory_, message.ReadCapability(2, caps));
|
||||
return glcr::Status::Ok();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@ glcr::Status KeyboardListener::ParseFromBytes(const glcr::ByteBuffer& bytes, uin
|
|||
yunq::MessageView message(bytes, offset);
|
||||
RETURN_ERROR(ParseFromBytesInternal(message));
|
||||
// Parse port_capability.
|
||||
// FIXME: Implement in-buffer capabilities for inprocess serialization.
|
||||
set_port_capability(0);
|
||||
ASSIGN_OR_RETURN(port_capability_, message.ReadCapability(0));
|
||||
return glcr::Status::Ok();
|
||||
}
|
||||
|
||||
|
|
@ -28,9 +27,7 @@ glcr::Status KeyboardListener::ParseFromBytes(const glcr::ByteBuffer& bytes, uin
|
|||
yunq::MessageView message(bytes, offset);
|
||||
RETURN_ERROR(ParseFromBytesInternal(message));
|
||||
// Parse port_capability.
|
||||
uint64_t port_capability_ptr = bytes.At<uint64_t>(offset + header_size + (8 * 0));
|
||||
|
||||
set_port_capability(caps.At(port_capability_ptr));
|
||||
ASSIGN_OR_RETURN(port_capability_, message.ReadCapability(0, caps));
|
||||
return glcr::Status::Ok();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,8 +21,7 @@ glcr::Status RegisterEndpointRequest::ParseFromBytes(const glcr::ByteBuffer& byt
|
|||
yunq::MessageView message(bytes, offset);
|
||||
RETURN_ERROR(ParseFromBytesInternal(message));
|
||||
// Parse endpoint_capability.
|
||||
// FIXME: Implement in-buffer capabilities for inprocess serialization.
|
||||
set_endpoint_capability(0);
|
||||
ASSIGN_OR_RETURN(endpoint_capability_, message.ReadCapability(1));
|
||||
return glcr::Status::Ok();
|
||||
}
|
||||
|
||||
|
|
@ -30,9 +29,7 @@ glcr::Status RegisterEndpointRequest::ParseFromBytes(const glcr::ByteBuffer& byt
|
|||
yunq::MessageView message(bytes, offset);
|
||||
RETURN_ERROR(ParseFromBytesInternal(message));
|
||||
// Parse endpoint_capability.
|
||||
uint64_t endpoint_capability_ptr = bytes.At<uint64_t>(offset + header_size + (8 * 1));
|
||||
|
||||
set_endpoint_capability(caps.At(endpoint_capability_ptr));
|
||||
ASSIGN_OR_RETURN(endpoint_capability_, message.ReadCapability(1, caps));
|
||||
return glcr::Status::Ok();
|
||||
}
|
||||
|
||||
|
|
@ -159,8 +156,7 @@ glcr::Status Endpoint::ParseFromBytes(const glcr::ByteBuffer& bytes, uint64_t of
|
|||
yunq::MessageView message(bytes, offset);
|
||||
RETURN_ERROR(ParseFromBytesInternal(message));
|
||||
// Parse endpoint.
|
||||
// FIXME: Implement in-buffer capabilities for inprocess serialization.
|
||||
set_endpoint(0);
|
||||
ASSIGN_OR_RETURN(endpoint_, message.ReadCapability(0));
|
||||
return glcr::Status::Ok();
|
||||
}
|
||||
|
||||
|
|
@ -168,9 +164,7 @@ glcr::Status Endpoint::ParseFromBytes(const glcr::ByteBuffer& bytes, uint64_t of
|
|||
yunq::MessageView message(bytes, offset);
|
||||
RETURN_ERROR(ParseFromBytesInternal(message));
|
||||
// Parse endpoint.
|
||||
uint64_t endpoint_ptr = bytes.At<uint64_t>(offset + header_size + (8 * 0));
|
||||
|
||||
set_endpoint(caps.At(endpoint_ptr));
|
||||
ASSIGN_OR_RETURN(endpoint_, message.ReadCapability(0, caps));
|
||||
return glcr::Status::Ok();
|
||||
}
|
||||
|
||||
|
|
@ -211,8 +205,7 @@ glcr::Status AhciInfo::ParseFromBytes(const glcr::ByteBuffer& bytes, uint64_t of
|
|||
yunq::MessageView message(bytes, offset);
|
||||
RETURN_ERROR(ParseFromBytesInternal(message));
|
||||
// Parse ahci_region.
|
||||
// FIXME: Implement in-buffer capabilities for inprocess serialization.
|
||||
set_ahci_region(0);
|
||||
ASSIGN_OR_RETURN(ahci_region_, message.ReadCapability(0));
|
||||
return glcr::Status::Ok();
|
||||
}
|
||||
|
||||
|
|
@ -220,9 +213,7 @@ glcr::Status AhciInfo::ParseFromBytes(const glcr::ByteBuffer& bytes, uint64_t of
|
|||
yunq::MessageView message(bytes, offset);
|
||||
RETURN_ERROR(ParseFromBytesInternal(message));
|
||||
// Parse ahci_region.
|
||||
uint64_t ahci_region_ptr = bytes.At<uint64_t>(offset + header_size + (8 * 0));
|
||||
|
||||
set_ahci_region(caps.At(ahci_region_ptr));
|
||||
ASSIGN_OR_RETURN(ahci_region_, message.ReadCapability(0, caps));
|
||||
return glcr::Status::Ok();
|
||||
}
|
||||
|
||||
|
|
@ -379,8 +370,7 @@ glcr::Status DenaliInfo::ParseFromBytes(const glcr::ByteBuffer& bytes, uint64_t
|
|||
yunq::MessageView message(bytes, offset);
|
||||
RETURN_ERROR(ParseFromBytesInternal(message));
|
||||
// Parse denali_endpoint.
|
||||
// FIXME: Implement in-buffer capabilities for inprocess serialization.
|
||||
set_denali_endpoint(0);
|
||||
ASSIGN_OR_RETURN(denali_endpoint_, message.ReadCapability(0));
|
||||
return glcr::Status::Ok();
|
||||
}
|
||||
|
||||
|
|
@ -388,9 +378,7 @@ glcr::Status DenaliInfo::ParseFromBytes(const glcr::ByteBuffer& bytes, uint64_t
|
|||
yunq::MessageView message(bytes, offset);
|
||||
RETURN_ERROR(ParseFromBytesInternal(message));
|
||||
// Parse denali_endpoint.
|
||||
uint64_t denali_endpoint_ptr = bytes.At<uint64_t>(offset + header_size + (8 * 0));
|
||||
|
||||
set_denali_endpoint(caps.At(denali_endpoint_ptr));
|
||||
ASSIGN_OR_RETURN(denali_endpoint_, message.ReadCapability(0, caps));
|
||||
return glcr::Status::Ok();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue