qemu/target/mips/tcg/system/lcsr_helper.c
Philippe Mathieu-Daudé 32cad1ffb8 include: Rename sysemu/ -> system/
Headers in include/sysemu/ are not only related to system
*emulation*, they are also used by virtualization. Rename
as system/ which is clearer.

Files renamed manually then mechanical change using sed tool.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Lei Yang <leiyang@redhat.com>
Message-Id: <20241203172445.28576-1-philmd@linaro.org>
2024-12-20 17:44:56 +01:00

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);
}