diff --git a/src/runtime_src/core/include/ert.h b/src/runtime_src/core/include/ert.h index 60e9de8e16b..3a7f544f5a0 100644 --- a/src/runtime_src/core/include/ert.h +++ b/src/runtime_src/core/include/ert.h @@ -934,6 +934,13 @@ ert_valid_opcode(struct ert_packet *pkt) return valid; } +static inline uint64_t +get_ert_packet_size_bytes(struct ert_packet *pkt) +{ + // header plus payload + return sizeof(pkt->header) + pkt->count * sizeof(uint32_t); +} + static inline struct ert_dpu_data* get_ert_dpu_data(struct ert_start_kernel_cmd* pkt) { @@ -962,6 +969,12 @@ get_ert_regmap_end(struct ert_start_kernel_cmd* pkt) return &pkt->cu_mask + pkt->count; } +static inline uint64_t +get_ert_regmap_size_bytes(struct ert_start_kernel_cmd* pkt) +{ + return (get_ert_regmap_end(pkt) - get_ert_regmap_begin(pkt)) * sizeof(uint32_t); +} + #ifdef __linux__ #define P2ROUNDUP(x, align) (-(-(x) & -(align))) static inline struct cu_cmd_state_timestamps *