diff options
| author | Richard Henderson <richard.henderson@linaro.org> | 2025-09-16 07:22:14 -0700 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2025-09-25 15:42:34 +0100 |
| commit | f570b394d2cc4d1c8128dd6c2b0493b9d58bc296 (patch) | |
| tree | 4675fd07ee2f92afd47b42de9d2148c7d9edb8fc | |
| parent | 166e7990566bcfe49e2a68443ea314a1ef7066a9 (diff) | |
| download | focaccia-qemu-f570b394d2cc4d1c8128dd6c2b0493b9d58bc296.tar.gz focaccia-qemu-f570b394d2cc4d1c8128dd6c2b0493b9d58bc296.zip | |
target/arm: Restrict the scope of CPREG_FIELD32, CPREG_FIELD64
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to '')
| -rw-r--r-- | target/arm/cpregs.h | 9 | ||||
| -rw-r--r-- | target/arm/helper.c | 12 |
2 files changed, 12 insertions, 9 deletions
diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h index d02d74f1f5..6fb1994afa 100644 --- a/target/arm/cpregs.h +++ b/target/arm/cpregs.h @@ -1016,15 +1016,6 @@ struct ARMCPRegInfo { CPAccessFn *orig_accessfn; }; -/* - * Macros which are lvalues for the field in CPUARMState for the - * ARMCPRegInfo *ri. - */ -#define CPREG_FIELD32(env, ri) \ - (*(uint32_t *)((char *)(env) + (ri)->fieldoffset)) -#define CPREG_FIELD64(env, ri) \ - (*(uint64_t *)((char *)(env) + (ri)->fieldoffset)) - void define_one_arm_cp_reg(ARMCPU *cpu, const ARMCPRegInfo *regs); void define_arm_cp_regs_len(ARMCPU *cpu, const ARMCPRegInfo *regs, size_t len); diff --git a/target/arm/helper.c b/target/arm/helper.c index b76a0edb0f..fe298670f1 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -51,6 +51,15 @@ int compare_u64(const void *a, const void *b) return 0; } +/* + * Macros which are lvalues for the field in CPUARMState for the + * ARMCPRegInfo *ri. + */ +#define CPREG_FIELD32(env, ri) \ + (*(uint32_t *)((char *)(env) + (ri)->fieldoffset)) +#define CPREG_FIELD64(env, ri) \ + (*(uint64_t *)((char *)(env) + (ri)->fieldoffset)) + uint64_t raw_read(CPUARMState *env, const ARMCPRegInfo *ri) { assert(ri->fieldoffset); @@ -71,6 +80,9 @@ void raw_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) } } +#undef CPREG_FIELD32 +#undef CPREG_FIELD64 + static void *raw_ptr(CPUARMState *env, const ARMCPRegInfo *ri) { return (char *)env + ri->fieldoffset; |