From e7f3db0679e5d37970a06f428208c3f5b51db5d2 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Tue, 18 Mar 2025 10:53:12 -0600 Subject: wip --- lib9p/9p.generated.c | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) (limited to 'lib9p/9p.generated.c') diff --git a/lib9p/9p.generated.c b/lib9p/9p.generated.c index 6726084..868d936 100644 --- a/lib9p/9p.generated.c +++ b/lib9p/9p.generated.c @@ -2259,7 +2259,11 @@ static void unmarshal_Rread([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_ net_offset += 1; UNMARSHAL_U16LE(ctx, out->tag); UNMARSHAL_U32LE(ctx, out->count); - UNMARSHAL_BYTES(ctx, out->data, out->count); + out->data.iov = ctx->extra; + ctx->extra += sizeof(out->data.iov[0]); + out->data.iov->iov_base = &ctx->net_bytes[ctx->net_offset]; + out->data.iov->iov_len = out->count; + out->data.iovcnt = 1; } static void unmarshal_Twrite([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { @@ -2272,7 +2276,11 @@ static void unmarshal_Twrite([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net UNMARSHAL_U32LE(ctx, out->fid); UNMARSHAL_U64LE(ctx, out->offset); UNMARSHAL_U32LE(ctx, out->count); - UNMARSHAL_BYTES(ctx, out->data, out->count); + out->data.iov = ctx->extra; + ctx->extra += sizeof(out->data.iov[0]); + out->data.iov->iov_base = &ctx->net_bytes[ctx->net_offset]; + out->data.iov->iov_len = out->count; + out->data.iovcnt = 1; } static void unmarshal_Rwrite([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { @@ -2772,7 +2780,11 @@ static void unmarshal_Rreaddir([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *n net_offset += 1; UNMARSHAL_U16LE(ctx, out->tag); UNMARSHAL_U32LE(ctx, out->count); - UNMARSHAL_BYTES(ctx, out->data, out->count); + out->data.iov = ctx->extra; + ctx->extra += sizeof(out->data.iov[0]); + out->data.iov->iov_base = &ctx->net_bytes[ctx->net_offset]; + out->data.iov->iov_len = out->count; + out->data.iovcnt = 1; } static void unmarshal_Tfsync([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { @@ -2993,7 +3005,11 @@ static void unmarshal_Rsread([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net net_offset += 1; UNMARSHAL_U16LE(ctx, out->tag); UNMARSHAL_U32LE(ctx, out->count); - UNMARSHAL_BYTES(ctx, out->data, out->count); + out->data.iov = ctx->extra; + ctx->extra += sizeof(out->data.iov[0]); + out->data.iov->iov_base = &ctx->net_bytes[ctx->net_offset]; + out->data.iov->iov_len = out->count; + out->data.iovcnt = 1; } static void unmarshal_Tswrite([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { @@ -3012,7 +3028,11 @@ static void unmarshal_Tswrite([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *ne UNMARSHAL_BYTES(ctx, out->wname[i].utf8, out->wname[i].len); } UNMARSHAL_U32LE(ctx, out->count); - UNMARSHAL_BYTES(ctx, out->data, out->count); + out->data.iov = ctx->extra; + ctx->extra += sizeof(out->data.iov[0]); + out->data.iov->iov_base = &ctx->net_bytes[ctx->net_offset]; + out->data.iov->iov_len = out->count; + out->data.iovcnt = 1; } static void unmarshal_Rswrite([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) { @@ -3491,7 +3511,8 @@ static bool marshal_Rread(struct lib9p_ctx *ctx, struct lib9p_msg_Rread *val, st MARSHAL_U8LE(ctx, 117); MARSHAL_U16LE(ctx, val->tag); MARSHAL_U32LE(ctx, val->count); - MARSHAL_BYTES_ZEROCOPY(ctx, val->data, val->count); + for (int iov_i = 0; iov_i < val->data->iovcnt; iov_i++) + MARSHAL_BYTES_ZEROCOPY(ctx, val->data->iov[iov_i].iov_base, val->data->iov[iov_i].iov_len); return false; } @@ -3512,7 +3533,8 @@ static bool marshal_Twrite(struct lib9p_ctx *ctx, struct lib9p_msg_Twrite *val, MARSHAL_U32LE(ctx, val->fid); MARSHAL_U64LE(ctx, val->offset); MARSHAL_U32LE(ctx, val->count); - MARSHAL_BYTES_ZEROCOPY(ctx, val->data, val->count); + for (int iov_i = 0; iov_i < val->data->iovcnt; iov_i++) + MARSHAL_BYTES_ZEROCOPY(ctx, val->data->iov[iov_i].iov_base, val->data->iov[iov_i].iov_len); return false; } @@ -4326,7 +4348,8 @@ static bool marshal_Rreaddir(struct lib9p_ctx *ctx, struct lib9p_msg_Rreaddir *v MARSHAL_U8LE(ctx, 41); MARSHAL_U16LE(ctx, val->tag); MARSHAL_U32LE(ctx, val->count); - MARSHAL_BYTES_ZEROCOPY(ctx, val->data, val->count); + for (int iov_i = 0; iov_i < val->data->iovcnt; iov_i++) + MARSHAL_BYTES_ZEROCOPY(ctx, val->data->iov[iov_i].iov_base, val->data->iov[iov_i].iov_len); return false; } @@ -4692,7 +4715,8 @@ static bool marshal_Rsread(struct lib9p_ctx *ctx, struct lib9p_msg_Rsread *val, MARSHAL_U8LE(ctx, 153); MARSHAL_U16LE(ctx, val->tag); MARSHAL_U32LE(ctx, val->count); - MARSHAL_BYTES_ZEROCOPY(ctx, val->data, val->count); + for (int iov_i = 0; iov_i < val->data->iovcnt; iov_i++) + MARSHAL_BYTES_ZEROCOPY(ctx, val->data->iov[iov_i].iov_base, val->data->iov[iov_i].iov_len); return false; } @@ -4720,7 +4744,8 @@ static bool marshal_Tswrite(struct lib9p_ctx *ctx, struct lib9p_msg_Tswrite *val MARSHAL_BYTES_ZEROCOPY(ctx, val->wname[i].utf8, val->wname[i].len); } MARSHAL_U32LE(ctx, val->count); - MARSHAL_BYTES_ZEROCOPY(ctx, val->data, val->count); + for (int iov_i = 0; iov_i < val->data->iovcnt; iov_i++) + MARSHAL_BYTES_ZEROCOPY(ctx, val->data->iov[iov_i].iov_base, val->data->iov[iov_i].iov_len); return false; } -- cgit v1.2.3-2-g168b