Re: [PATCH v2 13/15] cpus: Add const-qualified CPU environment accessors

Richard Henderson <[email protected]>
Newsgroups org.nongnu.qemu-riscv,org.nongnu.qemu-arm,org.nongnu.qemu-devel
Message-ID <[email protected]>
On 8/20/26 13:13, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé<[email protected]>
> 
> Use _Generic() controlling-expression to add the const-qualified
> variants of cpu_env(), env_cpu() and env_archcpu(). This allows to
> safely access CPU architecture state when it should not be modified.
> 
> Alias env_cpu_const() which is still used.
> 
> Suggested-by: Richard Henderson<[email protected]>
> Signed-off-by: Philippe Mathieu-Daudé<[email protected]>
> Signed-off-by: Philippe Mathieu-Daudé<[email protected]>
> Reviewed-by: Marc-André Lureau<[email protected]>
> ---
>   include/exec/cpu-common.h | 30 +++++++++++-------------------
>   include/hw/core/cpu.h     | 17 ++++++++++++-----
>   2 files changed, 23 insertions(+), 24 deletions(-)

Reviewed-by: Richard Henderson <[email protected]>

r~
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.