target/sparc: Fill in TCGCPUOps.pointer_wrap

Check address masking state for sparc64.

Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2025-05-04 11:14:01 -07:00
parent c2a0439f1e
commit 90f80e4b0f

View file

@ -1002,6 +1002,18 @@ static const struct SysemuCPUOps sparc_sysemu_ops = {
#ifdef CONFIG_TCG
#include "accel/tcg/cpu-ops.h"
#ifndef CONFIG_USER_ONLY
static vaddr sparc_pointer_wrap(CPUState *cs, int mmu_idx,
vaddr result, vaddr base)
{
#ifdef TARGET_SPARC64
return cpu_env(cs)->pstate & PS_AM ? (uint32_t)result : result;
#else
return (uint32_t)result;
#endif
}
#endif
static const TCGCPUOps sparc_tcg_ops = {
/*
* From Oracle SPARC Architecture 2015:
@ -1036,6 +1048,7 @@ static const TCGCPUOps sparc_tcg_ops = {
#ifndef CONFIG_USER_ONLY
.tlb_fill = sparc_cpu_tlb_fill,
.pointer_wrap = sparc_pointer_wrap,
.cpu_exec_interrupt = sparc_cpu_exec_interrupt,
.cpu_exec_halt = sparc_cpu_has_work,
.cpu_exec_reset = cpu_reset,