mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 04:43:54 -06:00

This files only access the address_space_ld/st API, declared in "exec/cpu-all.h", already included by "cpu.h". Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230828221314.18435-9-philmd@linaro.org>
40 lines
1.1 KiB
C
40 lines
1.1 KiB
C
/*
|
|
* Loongson CSR instructions translation routines
|
|
*
|
|
* Copyright (c) 2023 Jiaxun Yang <jiaxun.yang@flygoat.com>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#include "qemu/osdep.h"
|
|
#include "cpu.h"
|
|
#include "exec/helper-proto.h"
|
|
|
|
#define GET_MEMTXATTRS(cas) \
|
|
((MemTxAttrs){.requester_id = env_cpu(cas)->cpu_index})
|
|
|
|
uint64_t helper_lcsr_rdcsr(CPUMIPSState *env, target_ulong r_addr)
|
|
{
|
|
return address_space_ldl(&env->iocsr.as, r_addr,
|
|
GET_MEMTXATTRS(env), NULL);
|
|
}
|
|
|
|
uint64_t helper_lcsr_drdcsr(CPUMIPSState *env, target_ulong r_addr)
|
|
{
|
|
return address_space_ldq(&env->iocsr.as, r_addr,
|
|
GET_MEMTXATTRS(env), NULL);
|
|
}
|
|
|
|
void helper_lcsr_wrcsr(CPUMIPSState *env, target_ulong w_addr,
|
|
target_ulong val)
|
|
{
|
|
address_space_stl(&env->iocsr.as, w_addr,
|
|
val, GET_MEMTXATTRS(env), NULL);
|
|
}
|
|
|
|
void helper_lcsr_dwrcsr(CPUMIPSState *env, target_ulong w_addr,
|
|
target_ulong val)
|
|
{
|
|
address_space_stq(&env->iocsr.as, w_addr,
|
|
val, GET_MEMTXATTRS(env), NULL);
|
|
}
|