Skip to content

Commit

Permalink
target/riscv: access configuration through cfg_ptr in DisasContext
Browse files Browse the repository at this point in the history
The implementation in trans_{rvi,rvv,rvzfh}.c.inc accesses the shallow
copies (in DisasContext) of some of the elements available in the
RISCVCPUConfig structure.  This commit redirects accesses to use the
cfg_ptr copied into DisasContext and removes the shallow copies.

Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220202005249.3566542-4-philipp.tomsich@vrull.eu>
[ Changes by AF:
 - Fixup checkpatch failures
]
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
  • Loading branch information
ptomsich authored and alistair23 committed Feb 16, 2022
1 parent 3b91323 commit 79bf3b5
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 69 deletions.
2 changes: 1 addition & 1 deletion target/riscv/insn_trans/trans_rvi.c.inc
Expand Up @@ -806,7 +806,7 @@ static bool trans_fence(DisasContext *ctx, arg_fence *a)

static bool trans_fence_i(DisasContext *ctx, arg_fence_i *a)
{
if (!ctx->ext_ifencei) {
if (!ctx->cfg_ptr->ext_ifencei) {
return false;
}

Expand Down

0 comments on commit 79bf3b5

Please sign in to comment.