toolchain: ifc: update mpc api usage
This commit is contained in:
@@ -86,8 +86,7 @@ static int emit_header_lib_impl(struct emit_ctx *ctx)
|
||||
/* clang-format off */
|
||||
emit(ctx,
|
||||
"struct iovec iov = IOVEC(out_hdr, sizeof *out_hdr);\n"
|
||||
"struct msg kmsg = MSG(&iov, 1, NULL, 0);\n"
|
||||
"kern_status_t status = msg_recv(channel, 0, out_id, &kmsg);\n"
|
||||
"kern_status_t status = msg_recv(channel, out_id, &iov, 1);\n"
|
||||
"if (status != KERN_OK) return status;\n"
|
||||
"if (out_hdr->hdr_magic != MSG_MAGIC) return KERN_INVALID_ARGUMENT;\n"
|
||||
"return KERN_OK;\n");
|
||||
@@ -146,8 +145,7 @@ static int emit_header_lib_impl(struct emit_ctx *ctx)
|
||||
|
||||
emit(ctx,
|
||||
"struct iovec iov = IOVEC(&resp_data, sizeof resp_data);\n"
|
||||
"struct msg resp = MSG(&iov, 1, NULL, 0);\n"
|
||||
"return msg_reply(channel, 0, id, &resp);\n");
|
||||
"return msg_reply(channel, id, &iov, 1);\n");
|
||||
/* clang-format on */
|
||||
|
||||
emit_unindent(ctx);
|
||||
@@ -524,12 +522,7 @@ static int emit_interface_msg_function_send_impl(
|
||||
emit_unindent(ctx);
|
||||
emit(ctx, "};\n\n");
|
||||
|
||||
emit(ctx, "struct msg req = MSG(req_iov, %zu, NULL, 0);\n", nr_req_iov);
|
||||
emit(ctx,
|
||||
"struct msg resp = MSG(resp_iov, %zu, NULL, 0);\n",
|
||||
nr_resp_iov);
|
||||
|
||||
emit(ctx, "kern_status_t status = msg_send(port, 0, &req, &resp);\n");
|
||||
emit(ctx, "kern_status_t status = msg_send(port, req_iov, %zu, resp_iov, %zu);\n", nr_req_iov, nr_resp_iov);
|
||||
emit(ctx, "if (status != KERN_OK) return status;\n\n");
|
||||
|
||||
entry = b_queue_first(&msg->msg_results);
|
||||
@@ -735,8 +728,7 @@ static int emit_interface_msg_function_reply_impl(
|
||||
emit_unindent(ctx);
|
||||
emit(ctx, "};\n\n");
|
||||
|
||||
emit(ctx, "struct msg reply = MSG(iov, %zu, NULL, 0);\n", nr_iov);
|
||||
emit(ctx, "return msg_reply(channel, 0, id, &reply);\n");
|
||||
emit(ctx, "return msg_reply(channel, id, iov, %zu);\n", nr_iov);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user