sysdeps/managarm: convert EVIOSCLOCKID to helix_ng
@@ -561,40 +561,27 @@ int sys_ioctl(int fd, unsigned long request, void *arg, int *result) {
}else if(_IOC_TYPE(request) == 'E'
&& _IOC_NR(request) == _IOC_NR(EVIOSCLOCKID)) {
auto param = reinterpret_cast<int *>(arg);
- HelAction actions[3];
- globalQueue.trim();
managarm::fs::CntRequest<MemoryAllocator> req(getSysdepsAllocator());
req.set_req_type(managarm::fs::CntReqType::PT_IOCTL);
req.set_command(request);
req.set_input_clock(*param);
- frg::string<MemoryAllocator> ser(getSysdepsAllocator());
- req.SerializeToString(&ser);
- actions[0].type = kHelActionOffer;
- actions[0].flags = kHelItemAncillary;
- actions[1].type = kHelActionSendFromBuffer;
- actions[1].flags = kHelItemChain;
- actions[1].buffer = ser.data();
- actions[1].length = ser.size();
- actions[2].type = kHelActionRecvInline;
- actions[2].flags = 0;
- HEL_CHECK(helSubmitAsync(handle, actions, 3,
- globalQueue.getQueue(), 0, 0));
-
- auto element = globalQueue.dequeueSingle();
- auto offer = parseHandle(element);
- auto send_req = parseSimple(element);
- auto recv_resp = parseInline(element);
+ auto [offer, send_req, recv_resp] = exchangeMsgsSync(handle,
+ helix_ng::offer(
+ helix_ng::sendBragiHeadOnly(req, getSysdepsAllocator()),
+ helix_ng::recvInline()
+ )
+ );
- HEL_CHECK(offer->error);
- HEL_CHECK(send_req->error);
- if(recv_resp->error == kHelErrDismissed)
+ HEL_CHECK(offer.error());
+ HEL_CHECK(send_req.error());
+ if(recv_resp.error() == kHelErrDismissed)
return EINVAL;
- HEL_CHECK(recv_resp->error);
+ HEL_CHECK(recv_resp.error());
managarm::fs::SvrResponse<MemoryAllocator> resp(getSysdepsAllocator());
- resp.ParseFromArray(recv_resp->data, recv_resp->length);
+ resp.ParseFromArray(recv_resp.data(), recv_resp.length());
__ensure(resp.error() == managarm::fs::Errors::SUCCESS);
*result = resp.result();
return 0;
