diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-01-27 21:38:15 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-01-27 21:38:15 -0700 |
commit | f7b7c04e2ebb24ccae89b77ce76f0b405eb213d1 (patch) | |
tree | 87f743d15943f47bb55f0a675877b9f7f42e4597 /lib9p/9p.generated.c | |
parent | fbc408b36495a60aaf87f5e368a11f57f246d023 (diff) | |
parent | 508730301701ece981149f18bc515797cf2b9990 (diff) |
Merge branch 'lukeshu/misc'
Diffstat (limited to 'lib9p/9p.generated.c')
-rw-r--r-- | lib9p/9p.generated.c | 359 |
1 files changed, 168 insertions, 191 deletions
diff --git a/lib9p/9p.generated.c b/lib9p/9p.generated.c index 353654c..ab39102 100644 --- a/lib9p/9p.generated.c +++ b/lib9p/9p.generated.c @@ -153,6 +153,7 @@ const char * _lib9p_table_msg_name[LIB9P_VER_NUM][0x100] = { _MSG_NAME(Twrite), _MSG_NAME(Rwrite), _MSG_NAME(Tclunk), + _MSG_NAME(Rclunk), _MSG_NAME(Tremove), _MSG_NAME(Rremove), }, @@ -374,6 +375,14 @@ LM_ALWAYS_INLINE static bool validate_d(struct _validate_ctx *ctx) { return _validate_size_net(ctx, len) || _validate_size_host(ctx, len); } +LM_ALWAYS_INLINE static bool validate_d_signed(struct _validate_ctx *ctx) { + uint32_t base_offset = ctx->net_offset; + if (validate_4(ctx)) + return true; + uint32_t len = uint32le_decode(&ctx->net_bytes[base_offset]); + return _validate_size_net(ctx, len) || _validate_size_host(ctx, len); +} + LM_ALWAYS_INLINE static bool validate_s(struct _validate_ctx *ctx) { uint32_t base_offset = ctx->net_offset; if (validate_2(ctx)) @@ -469,15 +478,6 @@ LM_ALWAYS_INLINE static bool validate_lock_status(struct _validate_ctx *ctx) { } #endif /* CONFIG_9P_ENABLE_9P2000_L */ -#if CONFIG_9P_ENABLE_9P2000_e -LM_ALWAYS_INLINE static bool validate_d_e(struct _validate_ctx *ctx) { - return false - || validate_4(ctx) - || _validate_list(ctx, uint32le_decode(&ctx->net_bytes[ctx->net_offset-4]), validate_1, sizeof(uint8_t)) - ; -} - -#endif /* CONFIG_9P_ENABLE_9P2000_e */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_FLATTEN static bool validate_Tflush(struct _validate_ctx *ctx) { uint32_t size; @@ -526,8 +526,6 @@ LM_FLATTEN static bool validate_Rwrite(struct _validate_ctx *ctx) { ; } -#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ -#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_FLATTEN static bool validate_Rclunk(struct _validate_ctx *ctx) { uint32_t size; uint8_t typ; @@ -543,8 +541,6 @@ LM_FLATTEN static bool validate_Rclunk(struct _validate_ctx *ctx) { ; } -#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ -#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_FLATTEN static bool validate_Rremove(struct _validate_ctx *ctx) { uint32_t size; uint8_t typ; @@ -680,23 +676,6 @@ LM_FLATTEN static bool validate_Rxattrcreate(struct _validate_ctx *ctx) { ; } -LM_FLATTEN static bool validate_Rreaddir(struct _validate_ctx *ctx) { - uint32_t size; - uint8_t typ; - uint32_t _size_offset; - return false - || (({ _size_offset = ctx->net_offset; validate_4(ctx); }) || ({ size = uint32le_decode(&ctx->net_bytes[ctx->net_offset-4]); false; })) - || (validate_1(ctx) || ({ typ = ctx->net_bytes[ctx->net_offset-1]; false; })) - || validate_tag(ctx) - || validate_4(ctx) - || _validate_list(ctx, uint32le_decode(&ctx->net_bytes[ctx->net_offset-4]), validate_1, sizeof(uint8_t)) - || ({ uint32_t exp = ctx->net_offset - _size_offset; (((uint32_t)size) != exp) && - lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "size value is wrong (actual:%"PRIu32" != correct:%"PRIu32")", (uint32_t)size, exp); }) - || ({ uint8_t exp = 41; (((uint8_t)typ) != exp) && - lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "typ value is wrong (actual:%"PRIu8" != correct:%"PRIu8")", (uint8_t)typ, exp); }) - ; -} - LM_FLATTEN static bool validate_Rfsync(struct _validate_ctx *ctx) { uint32_t size; uint8_t typ; @@ -968,7 +947,41 @@ LM_FLATTEN static bool validate_Tfsync(struct _validate_ctx *ctx) { ; } +LM_FLATTEN static bool validate_Rreaddir(struct _validate_ctx *ctx) { + uint32_t size; + uint8_t typ; + uint32_t _size_offset; + return false + || (({ _size_offset = ctx->net_offset; validate_4(ctx); }) || ({ size = uint32le_decode(&ctx->net_bytes[ctx->net_offset-4]); false; })) + || (validate_1(ctx) || ({ typ = ctx->net_bytes[ctx->net_offset-1]; false; })) + || validate_tag(ctx) + || validate_d(ctx) + || ({ uint32_t exp = ctx->net_offset - _size_offset; (((uint32_t)size) != exp) && + lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "size value is wrong (actual:%"PRIu32" != correct:%"PRIu32")", (uint32_t)size, exp); }) + || ({ uint8_t exp = 41; (((uint8_t)typ) != exp) && + lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "typ value is wrong (actual:%"PRIu8" != correct:%"PRIu8")", (uint8_t)typ, exp); }) + ; +} + #endif /* CONFIG_9P_ENABLE_9P2000_L */ +#if CONFIG_9P_ENABLE_9P2000_e +LM_FLATTEN static bool validate_Rsread(struct _validate_ctx *ctx) { + uint32_t size; + uint8_t typ; + uint32_t _size_offset; + return false + || (({ _size_offset = ctx->net_offset; validate_4(ctx); }) || ({ size = uint32le_decode(&ctx->net_bytes[ctx->net_offset-4]); false; })) + || (validate_1(ctx) || ({ typ = ctx->net_bytes[ctx->net_offset-1]; false; })) + || validate_tag(ctx) + || validate_d(ctx) + || ({ uint32_t exp = ctx->net_offset - _size_offset; (((uint32_t)size) != exp) && + lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "size value is wrong (actual:%"PRIu32" != correct:%"PRIu32")", (uint32_t)size, exp); }) + || ({ uint8_t exp = 153; (((uint8_t)typ) != exp) && + lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "typ value is wrong (actual:%"PRIu8" != correct:%"PRIu8")", (uint8_t)typ, exp); }) + ; +} + +#endif /* CONFIG_9P_ENABLE_9P2000_e */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_FLATTEN static bool validate_Rread(struct _validate_ctx *ctx) { uint32_t size; @@ -978,7 +991,7 @@ LM_FLATTEN static bool validate_Rread(struct _validate_ctx *ctx) { || (({ _size_offset = ctx->net_offset; validate_4(ctx); }) || ({ size = uint32le_decode(&ctx->net_bytes[ctx->net_offset-4]); false; })) || (validate_1(ctx) || ({ typ = ctx->net_bytes[ctx->net_offset-1]; false; })) || validate_tag(ctx) - || validate_d(ctx) + || validate_d_signed(ctx) || ({ uint32_t exp = ctx->net_offset - _size_offset; (((uint32_t)size) != exp) && lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "size value is wrong (actual:%"PRIu32" != correct:%"PRIu32")", (uint32_t)size, exp); }) || ({ uint8_t exp = 117; (((uint8_t)typ) != exp) && @@ -997,7 +1010,7 @@ LM_FLATTEN static bool validate_Twrite(struct _validate_ctx *ctx) { || validate_tag(ctx) || validate_fid(ctx) || (validate_8(ctx) || ({ offset = uint64le_decode(&ctx->net_bytes[ctx->net_offset-8]); false; })) - || validate_d(ctx) + || validate_d_signed(ctx) || ({ uint32_t exp = ctx->net_offset - _size_offset; (((uint32_t)size) != exp) && lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "size value is wrong (actual:%"PRIu32" != correct:%"PRIu32")", (uint32_t)size, exp); }) || ({ uint8_t exp = 118; (((uint8_t)typ) != exp) && @@ -1271,6 +1284,25 @@ LM_FLATTEN static bool validate_Tsread(struct _validate_ctx *ctx) { ; } +LM_FLATTEN static bool validate_Tswrite(struct _validate_ctx *ctx) { + uint32_t size; + uint8_t typ; + uint32_t _size_offset; + return false + || (({ _size_offset = ctx->net_offset; validate_4(ctx); }) || ({ size = uint32le_decode(&ctx->net_bytes[ctx->net_offset-4]); false; })) + || (validate_1(ctx) || ({ typ = ctx->net_bytes[ctx->net_offset-1]; false; })) + || validate_tag(ctx) + || validate_4(ctx) + || validate_2(ctx) + || _validate_list(ctx, uint16le_decode(&ctx->net_bytes[ctx->net_offset-2]), validate_s, sizeof(struct lib9p_s)) + || validate_d(ctx) + || ({ uint32_t exp = ctx->net_offset - _size_offset; (((uint32_t)size) != exp) && + lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "size value is wrong (actual:%"PRIu32" != correct:%"PRIu32")", (uint32_t)size, exp); }) + || ({ uint8_t exp = 154; (((uint8_t)typ) != exp) && + lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "typ value is wrong (actual:%"PRIu8" != correct:%"PRIu8")", (uint8_t)typ, exp); }) + ; +} + #endif /* CONFIG_9P_ENABLE_9P2000_e */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_ALWAYS_INLINE static bool validate_qid(struct _validate_ctx *ctx) { @@ -1507,43 +1539,6 @@ LM_FLATTEN static bool validate_Rlock(struct _validate_ctx *ctx) { } #endif /* CONFIG_9P_ENABLE_9P2000_L */ -#if CONFIG_9P_ENABLE_9P2000_e -LM_FLATTEN static bool validate_Rsread(struct _validate_ctx *ctx) { - uint32_t size; - uint8_t typ; - uint32_t _size_offset; - return false - || (({ _size_offset = ctx->net_offset; validate_4(ctx); }) || ({ size = uint32le_decode(&ctx->net_bytes[ctx->net_offset-4]); false; })) - || (validate_1(ctx) || ({ typ = ctx->net_bytes[ctx->net_offset-1]; false; })) - || validate_tag(ctx) - || validate_d_e(ctx) - || ({ uint32_t exp = ctx->net_offset - _size_offset; (((uint32_t)size) != exp) && - lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "size value is wrong (actual:%"PRIu32" != correct:%"PRIu32")", (uint32_t)size, exp); }) - || ({ uint8_t exp = 153; (((uint8_t)typ) != exp) && - lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "typ value is wrong (actual:%"PRIu8" != correct:%"PRIu8")", (uint8_t)typ, exp); }) - ; -} - -LM_FLATTEN static bool validate_Tswrite(struct _validate_ctx *ctx) { - uint32_t size; - uint8_t typ; - uint32_t _size_offset; - return false - || (({ _size_offset = ctx->net_offset; validate_4(ctx); }) || ({ size = uint32le_decode(&ctx->net_bytes[ctx->net_offset-4]); false; })) - || (validate_1(ctx) || ({ typ = ctx->net_bytes[ctx->net_offset-1]; false; })) - || validate_tag(ctx) - || validate_4(ctx) - || validate_2(ctx) - || _validate_list(ctx, uint16le_decode(&ctx->net_bytes[ctx->net_offset-2]), validate_s, sizeof(struct lib9p_s)) - || validate_d_e(ctx) - || ({ uint32_t exp = ctx->net_offset - _size_offset; (((uint32_t)size) != exp) && - lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "size value is wrong (actual:%"PRIu32" != correct:%"PRIu32")", (uint32_t)size, exp); }) - || ({ uint8_t exp = 154; (((uint8_t)typ) != exp) && - lib9p_errorf(ctx->ctx, LINUX_EBADMSG, "typ value is wrong (actual:%"PRIu8" != correct:%"PRIu8")", (uint8_t)typ, exp); }) - ; -} - -#endif /* CONFIG_9P_ENABLE_9P2000_e */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_ALWAYS_INLINE static bool validate_stat(struct _validate_ctx *ctx) { uint16_t stat_size; @@ -1867,6 +1862,15 @@ LM_ALWAYS_INLINE static void unmarshal_d(struct _unmarshal_ctx *ctx, struct lib9 unmarshal_1(ctx, (uint8_t *)&out->dat[i]); } +LM_ALWAYS_INLINE static void unmarshal_d_signed(struct _unmarshal_ctx *ctx, struct lib9p_d_signed *out) { + memset(out, 0, sizeof(*out)); + unmarshal_4(ctx, &out->len); + out->dat = ctx->extra; + ctx->extra += sizeof(out->dat[0]) * out->len; + for (typeof(out->len) i = 0; i < out->len; i++) + unmarshal_1(ctx, (uint8_t *)&out->dat[i]); +} + LM_ALWAYS_INLINE static void unmarshal_s(struct _unmarshal_ctx *ctx, struct lib9p_s *out) { memset(out, 0, sizeof(*out)); unmarshal_2(ctx, &out->len); @@ -1923,17 +1927,6 @@ LM_ALWAYS_INLINE static void unmarshal_lock_status(struct _unmarshal_ctx *ctx, l } #endif /* CONFIG_9P_ENABLE_9P2000_L */ -#if CONFIG_9P_ENABLE_9P2000_e -LM_ALWAYS_INLINE static void unmarshal_d_e(struct _unmarshal_ctx *ctx, struct lib9p_d_e *out) { - memset(out, 0, sizeof(*out)); - unmarshal_4(ctx, &out->len); - out->dat = ctx->extra; - ctx->extra += sizeof(out->dat[0]) * out->len; - for (typeof(out->len) i = 0; i < out->len; i++) - unmarshal_1(ctx, &out->dat[i]); -} - -#endif /* CONFIG_9P_ENABLE_9P2000_e */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_FLATTEN static void unmarshal_Tflush(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tflush *out) { memset(out, 0, sizeof(*out)); @@ -1958,8 +1951,6 @@ LM_FLATTEN static void unmarshal_Rwrite(struct _unmarshal_ctx *ctx, struct lib9p unmarshal_4(ctx, &out->count); } -#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ -#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_FLATTEN static void unmarshal_Rclunk(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rclunk *out) { memset(out, 0, sizeof(*out)); ctx->net_offset += 4; @@ -1967,8 +1958,6 @@ LM_FLATTEN static void unmarshal_Rclunk(struct _unmarshal_ctx *ctx, struct lib9p unmarshal_tag(ctx, &out->tag); } -#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ -#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_FLATTEN static void unmarshal_Rremove(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rremove *out) { memset(out, 0, sizeof(*out)); ctx->net_offset += 4; @@ -2040,18 +2029,6 @@ LM_FLATTEN static void unmarshal_Rxattrcreate(struct _unmarshal_ctx *ctx, struct unmarshal_tag(ctx, &out->tag); } -LM_FLATTEN static void unmarshal_Rreaddir(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rreaddir *out) { - memset(out, 0, sizeof(*out)); - ctx->net_offset += 4; - ctx->net_offset += 1; - unmarshal_tag(ctx, &out->tag); - unmarshal_4(ctx, &out->count); - out->data = ctx->extra; - ctx->extra += sizeof(out->data[0]) * out->count; - for (typeof(out->count) i = 0; i < out->count; i++) - unmarshal_1(ctx, &out->data[i]); -} - LM_FLATTEN static void unmarshal_Rfsync(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rfsync *out) { memset(out, 0, sizeof(*out)); ctx->net_offset += 4; @@ -2189,14 +2166,32 @@ LM_FLATTEN static void unmarshal_Tfsync(struct _unmarshal_ctx *ctx, struct lib9p unmarshal_4(ctx, &out->datasync); } +LM_FLATTEN static void unmarshal_Rreaddir(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rreaddir *out) { + memset(out, 0, sizeof(*out)); + ctx->net_offset += 4; + ctx->net_offset += 1; + unmarshal_tag(ctx, &out->tag); + unmarshal_d(ctx, &out->data); +} + #endif /* CONFIG_9P_ENABLE_9P2000_L */ +#if CONFIG_9P_ENABLE_9P2000_e +LM_FLATTEN static void unmarshal_Rsread(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rsread *out) { + memset(out, 0, sizeof(*out)); + ctx->net_offset += 4; + ctx->net_offset += 1; + unmarshal_tag(ctx, &out->tag); + unmarshal_d(ctx, &out->data); +} + +#endif /* CONFIG_9P_ENABLE_9P2000_e */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_FLATTEN static void unmarshal_Rread(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rread *out) { memset(out, 0, sizeof(*out)); ctx->net_offset += 4; ctx->net_offset += 1; unmarshal_tag(ctx, &out->tag); - unmarshal_d(ctx, &out->data); + unmarshal_d_signed(ctx, &out->data); } LM_FLATTEN static void unmarshal_Twrite(struct _unmarshal_ctx *ctx, struct lib9p_msg_Twrite *out) { @@ -2206,7 +2201,7 @@ LM_FLATTEN static void unmarshal_Twrite(struct _unmarshal_ctx *ctx, struct lib9p unmarshal_tag(ctx, &out->tag); unmarshal_fid(ctx, &out->fid); unmarshal_8(ctx, &out->offset); - unmarshal_d(ctx, &out->data); + unmarshal_d_signed(ctx, &out->data); } LM_FLATTEN static void unmarshal_Tversion(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tversion *out) { @@ -2364,6 +2359,20 @@ LM_FLATTEN static void unmarshal_Tsread(struct _unmarshal_ctx *ctx, struct lib9p unmarshal_s(ctx, &out->wname[i]); } +LM_FLATTEN static void unmarshal_Tswrite(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tswrite *out) { + memset(out, 0, sizeof(*out)); + ctx->net_offset += 4; + ctx->net_offset += 1; + unmarshal_tag(ctx, &out->tag); + unmarshal_4(ctx, &out->fid); + unmarshal_2(ctx, &out->nwname); + out->wname = ctx->extra; + ctx->extra += sizeof(out->wname[0]) * out->nwname; + for (typeof(out->nwname) i = 0; i < out->nwname; i++) + unmarshal_s(ctx, &out->wname[i]); + unmarshal_d(ctx, &out->data); +} + #endif /* CONFIG_9P_ENABLE_9P2000_e */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_ALWAYS_INLINE static void unmarshal_qid(struct _unmarshal_ctx *ctx, struct lib9p_qid *out) { @@ -2511,30 +2520,6 @@ LM_FLATTEN static void unmarshal_Rlock(struct _unmarshal_ctx *ctx, struct lib9p_ } #endif /* CONFIG_9P_ENABLE_9P2000_L */ -#if CONFIG_9P_ENABLE_9P2000_e -LM_FLATTEN static void unmarshal_Rsread(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rsread *out) { - memset(out, 0, sizeof(*out)); - ctx->net_offset += 4; - ctx->net_offset += 1; - unmarshal_tag(ctx, &out->tag); - unmarshal_d_e(ctx, &out->data); -} - -LM_FLATTEN static void unmarshal_Tswrite(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tswrite *out) { - memset(out, 0, sizeof(*out)); - ctx->net_offset += 4; - ctx->net_offset += 1; - unmarshal_tag(ctx, &out->tag); - unmarshal_4(ctx, &out->fid); - unmarshal_2(ctx, &out->nwname); - out->wname = ctx->extra; - ctx->extra += sizeof(out->wname[0]) * out->nwname; - for (typeof(out->nwname) i = 0; i < out->nwname; i++) - unmarshal_s(ctx, &out->wname[i]); - unmarshal_d_e(ctx, &out->data); -} - -#endif /* CONFIG_9P_ENABLE_9P2000_e */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_ALWAYS_INLINE static void unmarshal_stat(struct _unmarshal_ctx *ctx, struct lib9p_stat *out) { memset(out, 0, sizeof(*out)); @@ -2762,6 +2747,16 @@ LM_ALWAYS_INLINE static bool marshal_d(struct _marshal_ctx *ctx, struct lib9p_d ; } +LM_ALWAYS_INLINE static bool marshal_d_signed(struct _marshal_ctx *ctx, struct lib9p_d_signed *val) { + return false + || marshal_4(ctx, &val->len) + || ({ bool err = false; + for (typeof(val->len) i = 0; i < val->len && !err; i++) + err = marshal_1(ctx, (uint8_t *)&val->dat[i]); + err; }) + ; +} + LM_ALWAYS_INLINE static bool marshal_s(struct _marshal_ctx *ctx, struct lib9p_s *val) { return false || marshal_2(ctx, &val->len) @@ -2825,18 +2820,6 @@ LM_ALWAYS_INLINE static bool marshal_lock_status(struct _marshal_ctx *ctx, lib9p } #endif /* CONFIG_9P_ENABLE_9P2000_L */ -#if CONFIG_9P_ENABLE_9P2000_e -LM_ALWAYS_INLINE static bool marshal_d_e(struct _marshal_ctx *ctx, struct lib9p_d_e *val) { - return false - || marshal_4(ctx, &val->len) - || ({ bool err = false; - for (typeof(val->len) i = 0; i < val->len && !err; i++) - err = marshal_1(ctx, &val->dat[i]); - err; }) - ; -} - -#endif /* CONFIG_9P_ENABLE_9P2000_e */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_FLATTEN static bool marshal_Tflush(struct _marshal_ctx *ctx, struct lib9p_msg_Tflush *val) { uint32_t _size_offset; @@ -2876,8 +2859,6 @@ LM_FLATTEN static bool marshal_Rwrite(struct _marshal_ctx *ctx, struct lib9p_msg ; } -#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ -#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_FLATTEN static bool marshal_Rclunk(struct _marshal_ctx *ctx, struct lib9p_msg_Rclunk *val) { uint32_t _size_offset; uint32_t _typ_offset; @@ -2890,8 +2871,6 @@ LM_FLATTEN static bool marshal_Rclunk(struct _marshal_ctx *ctx, struct lib9p_msg ; } -#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ -#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_FLATTEN static bool marshal_Rremove(struct _marshal_ctx *ctx, struct lib9p_msg_Rremove *val) { uint32_t _size_offset; uint32_t _typ_offset; @@ -3003,23 +2982,6 @@ LM_FLATTEN static bool marshal_Rxattrcreate(struct _marshal_ctx *ctx, struct lib ; } -LM_FLATTEN static bool marshal_Rreaddir(struct _marshal_ctx *ctx, struct lib9p_msg_Rreaddir *val) { - uint32_t _size_offset; - uint32_t _typ_offset; - return false - || ({ _size_offset = ctx->net_offset; ({ ctx->net_offset += 4; false; }); }) - || ({ _typ_offset = ctx->net_offset; ({ ctx->net_offset += 1; false; }); }) - || marshal_tag(ctx, &val->tag) - || marshal_4(ctx, &val->count) - || ({ bool err = false; - for (typeof(val->count) i = 0; i < val->count && !err; i++) - err = marshal_1(ctx, &val->data[i]); - err; }) - || ({ uint32le_encode(&ctx->net_bytes[_size_offset], ctx->net_offset - _size_offset); false; }) - || ({ ctx->net_bytes[_typ_offset] = 41; false; }) - ; -} - LM_FLATTEN static bool marshal_Rfsync(struct _marshal_ctx *ctx, struct lib9p_msg_Rfsync *val) { uint32_t _size_offset; uint32_t _typ_offset; @@ -3237,7 +3199,35 @@ LM_FLATTEN static bool marshal_Tfsync(struct _marshal_ctx *ctx, struct lib9p_msg ; } +LM_FLATTEN static bool marshal_Rreaddir(struct _marshal_ctx *ctx, struct lib9p_msg_Rreaddir *val) { + uint32_t _size_offset; + uint32_t _typ_offset; + return false + || ({ _size_offset = ctx->net_offset; ({ ctx->net_offset += 4; false; }); }) + || ({ _typ_offset = ctx->net_offset; ({ ctx->net_offset += 1; false; }); }) + || marshal_tag(ctx, &val->tag) + || marshal_d(ctx, &val->data) + || ({ uint32le_encode(&ctx->net_bytes[_size_offset], ctx->net_offset - _size_offset); false; }) + || ({ ctx->net_bytes[_typ_offset] = 41; false; }) + ; +} + #endif /* CONFIG_9P_ENABLE_9P2000_L */ +#if CONFIG_9P_ENABLE_9P2000_e +LM_FLATTEN static bool marshal_Rsread(struct _marshal_ctx *ctx, struct lib9p_msg_Rsread *val) { + uint32_t _size_offset; + uint32_t _typ_offset; + return false + || ({ _size_offset = ctx->net_offset; ({ ctx->net_offset += 4; false; }); }) + || ({ _typ_offset = ctx->net_offset; ({ ctx->net_offset += 1; false; }); }) + || marshal_tag(ctx, &val->tag) + || marshal_d(ctx, &val->data) + || ({ uint32le_encode(&ctx->net_bytes[_size_offset], ctx->net_offset - _size_offset); false; }) + || ({ ctx->net_bytes[_typ_offset] = 153; false; }) + ; +} + +#endif /* CONFIG_9P_ENABLE_9P2000_e */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_FLATTEN static bool marshal_Rread(struct _marshal_ctx *ctx, struct lib9p_msg_Rread *val) { uint32_t _size_offset; @@ -3246,7 +3236,7 @@ LM_FLATTEN static bool marshal_Rread(struct _marshal_ctx *ctx, struct lib9p_msg_ || ({ _size_offset = ctx->net_offset; ({ ctx->net_offset += 4; false; }); }) || ({ _typ_offset = ctx->net_offset; ({ ctx->net_offset += 1; false; }); }) || marshal_tag(ctx, &val->tag) - || marshal_d(ctx, &val->data) + || marshal_d_signed(ctx, &val->data) || ({ uint32le_encode(&ctx->net_bytes[_size_offset], ctx->net_offset - _size_offset); false; }) || ({ ctx->net_bytes[_typ_offset] = 117; false; }) ; @@ -3261,7 +3251,7 @@ LM_FLATTEN static bool marshal_Twrite(struct _marshal_ctx *ctx, struct lib9p_msg || marshal_tag(ctx, &val->tag) || marshal_fid(ctx, &val->fid) || marshal_8(ctx, &val->offset) - || marshal_d(ctx, &val->data) + || marshal_d_signed(ctx, &val->data) || ({ uint32le_encode(&ctx->net_bytes[_size_offset], ctx->net_offset - _size_offset); false; }) || ({ ctx->net_bytes[_typ_offset] = 118; false; }) ; @@ -3492,6 +3482,25 @@ LM_FLATTEN static bool marshal_Tsread(struct _marshal_ctx *ctx, struct lib9p_msg ; } +LM_FLATTEN static bool marshal_Tswrite(struct _marshal_ctx *ctx, struct lib9p_msg_Tswrite *val) { + uint32_t _size_offset; + uint32_t _typ_offset; + return false + || ({ _size_offset = ctx->net_offset; ({ ctx->net_offset += 4; false; }); }) + || ({ _typ_offset = ctx->net_offset; ({ ctx->net_offset += 1; false; }); }) + || marshal_tag(ctx, &val->tag) + || marshal_4(ctx, &val->fid) + || marshal_2(ctx, &val->nwname) + || ({ bool err = false; + for (typeof(val->nwname) i = 0; i < val->nwname && !err; i++) + err = marshal_s(ctx, &val->wname[i]); + err; }) + || marshal_d(ctx, &val->data) + || ({ uint32le_encode(&ctx->net_bytes[_size_offset], ctx->net_offset - _size_offset); false; }) + || ({ ctx->net_bytes[_typ_offset] = 154; false; }) + ; +} + #endif /* CONFIG_9P_ENABLE_9P2000_e */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_ALWAYS_INLINE static bool marshal_qid(struct _marshal_ctx *ctx, struct lib9p_qid *val) { @@ -3695,40 +3704,6 @@ LM_FLATTEN static bool marshal_Rlock(struct _marshal_ctx *ctx, struct lib9p_msg_ } #endif /* CONFIG_9P_ENABLE_9P2000_L */ -#if CONFIG_9P_ENABLE_9P2000_e -LM_FLATTEN static bool marshal_Rsread(struct _marshal_ctx *ctx, struct lib9p_msg_Rsread *val) { - uint32_t _size_offset; - uint32_t _typ_offset; - return false - || ({ _size_offset = ctx->net_offset; ({ ctx->net_offset += 4; false; }); }) - || ({ _typ_offset = ctx->net_offset; ({ ctx->net_offset += 1; false; }); }) - || marshal_tag(ctx, &val->tag) - || marshal_d_e(ctx, &val->data) - || ({ uint32le_encode(&ctx->net_bytes[_size_offset], ctx->net_offset - _size_offset); false; }) - || ({ ctx->net_bytes[_typ_offset] = 153; false; }) - ; -} - -LM_FLATTEN static bool marshal_Tswrite(struct _marshal_ctx *ctx, struct lib9p_msg_Tswrite *val) { - uint32_t _size_offset; - uint32_t _typ_offset; - return false - || ({ _size_offset = ctx->net_offset; ({ ctx->net_offset += 4; false; }); }) - || ({ _typ_offset = ctx->net_offset; ({ ctx->net_offset += 1; false; }); }) - || marshal_tag(ctx, &val->tag) - || marshal_4(ctx, &val->fid) - || marshal_2(ctx, &val->nwname) - || ({ bool err = false; - for (typeof(val->nwname) i = 0; i < val->nwname && !err; i++) - err = marshal_s(ctx, &val->wname[i]); - err; }) - || marshal_d_e(ctx, &val->data) - || ({ uint32le_encode(&ctx->net_bytes[_size_offset], ctx->net_offset - _size_offset); false; }) - || ({ ctx->net_bytes[_typ_offset] = 154; false; }) - ; -} - -#endif /* CONFIG_9P_ENABLE_9P2000_e */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u LM_ALWAYS_INLINE static bool marshal_stat(struct _marshal_ctx *ctx, struct lib9p_stat *val) { uint32_t _stat_size_offset; @@ -4125,6 +4100,7 @@ const struct _lib9p_recv_tentry _lib9p_table_Rmsg_recv[LIB9P_VER_NUM][0x80] = { _MSG_RECV(Rwalk), _MSG_RECV(Rread), _MSG_RECV(Rwrite), + _MSG_RECV(Rclunk), _MSG_RECV(Rremove), }, #endif /* CONFIG_9P_ENABLE_9P2000_L */ @@ -4313,6 +4289,7 @@ const struct _lib9p_send_tentry _lib9p_table_Rmsg_send[LIB9P_VER_NUM][0x80] = { _MSG_SEND(Rwalk), _MSG_SEND(Rread), _MSG_SEND(Rwrite), + _MSG_SEND(Rclunk), _MSG_SEND(Rremove), }, #endif /* CONFIG_9P_ENABLE_9P2000_L */ |