[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 2/2] target/riscv: Allow software access to MIP SEIP
From: |
Richard Henderson |
Subject: |
Re: [PATCH v2 2/2] target/riscv: Allow software access to MIP SEIP |
Date: |
Tue, 15 Mar 2022 23:13:45 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 |
On 3/15/22 18:59, Alistair Francis wrote:
+ if (mask & MIP_SEIP) {
+ env->software_seip = new_val & MIP_SEIP;
+ }
+ new_val |= env->external_seip << IRQ_S_EXT;
You can move the second statement inside the if as well, since you don't need bits in
new_val set that are not in mask.
Also might be clearer as
env->external_seip * MIP_SEIP
rather than the shift, to make it clear we're talking about the same bit. The compiler
will reduce the multiplication.
Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~