On Tue, Mar 10, 2026 at 10:08 PM Brian Cain <[email protected]>
wrote:

> From: Brian Cain <[email protected]>
>
> Signed-off-by: Brian Cain <[email protected]>
> ---
>  target/hexagon/op_helper.c | 35 +++++++++++++++++++++++++++++++++--
>  1 file changed, 33 insertions(+), 2 deletions(-)
>
> diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c
> index 82605f1d4aa..161c7eaf31f 100644
> --- a/target/hexagon/op_helper.c
> +++ b/target/hexagon/op_helper.c
> @@ -1496,12 +1496,43 @@ void HELPER(resume)(CPUHexagonState *env, uint32_t
> mask)
>
>  uint32_t HELPER(getimask)(CPUHexagonState *env, uint32_t tid)
>  {
> -    g_assert_not_reached();
> +    CPUState *cs;
> +    BQL_LOCK_GUARD();
> +    CPU_FOREACH(cs) {
> +        HexagonCPU *found_cpu = HEXAGON_CPU(cs);
> +        CPUHexagonState *found_env = &found_cpu->env;
> +        if (found_env->threadId == tid) {
> +            uint32_t imask = found_env->t_sreg[HEX_SREG_IMASK];
> +            qemu_log_mask(CPU_LOG_INT, "%s: tid " TARGET_FMT_lx
> +                          " imask = 0x%x\n", __func__, env->threadId,
>

Don't use %x


> +                          (unsigned)GET_FIELD(IMASK_MASK, imask));
> +            return GET_FIELD(IMASK_MASK, imask);
> +        }
> +    }
> +    return 0;
>  }
>
>  void HELPER(setimask)(CPUHexagonState *env, uint32_t tid, uint32_t imask)
>  {
> -    g_assert_not_reached();
> +    CPUState *cs;
> +
> +    BQL_LOCK_GUARD();
> +    CPU_FOREACH(cs) {
> +        HexagonCPU *found_cpu = HEXAGON_CPU(cs);
> +        CPUHexagonState *found_env = &found_cpu->env;
> +
> +        if (tid == found_env->threadId) {
> +            SET_SYSTEM_FIELD(found_env, HEX_SREG_IMASK, IMASK_MASK,
> imask);
> +            qemu_log_mask(CPU_LOG_INT, "%s: tid " TARGET_FMT_lx
> +                          " imask 0x%x\n",
>

Ditto

Otherwise
Reviewed-by: Taylor Simpson <[email protected]>

Reply via email to