mirror of
https://github.com/qemu/qemu.git
synced 2026-02-04 05:35:39 +00:00
We transform target/{arm,riscv}/common-semi-target.h headers to proper
compilation units, and use them in arm-compat-semi.c.
This way, we can include only the declaration header (which is target
agnostic), and selectively link the appropriate implementation based on
current target.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20250822150058.18692-8-pierrick.bouvier@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-ID: <20250922093711.2768983-11-alex.bennee@linaro.org>
50 lines
1.0 KiB
C
50 lines
1.0 KiB
C
/*
|
|
* Target-specific parts of semihosting/arm-compat-semi.c.
|
|
*
|
|
* Copyright (c) 2005, 2007 CodeSourcery.
|
|
* Copyright (c) 2019, 2022 Linaro
|
|
* Copyright © 2020 by Keith Packard <keithp@keithp.com>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#include "qemu/osdep.h"
|
|
#include "cpu.h"
|
|
#include "semihosting/common-semi.h"
|
|
|
|
uint64_t common_semi_arg(CPUState *cs, int argno)
|
|
{
|
|
RISCVCPU *cpu = RISCV_CPU(cs);
|
|
CPURISCVState *env = &cpu->env;
|
|
return env->gpr[xA0 + argno];
|
|
}
|
|
|
|
void common_semi_set_ret(CPUState *cs, uint64_t ret)
|
|
{
|
|
RISCVCPU *cpu = RISCV_CPU(cs);
|
|
CPURISCVState *env = &cpu->env;
|
|
env->gpr[xA0] = ret;
|
|
}
|
|
|
|
bool is_64bit_semihosting(CPUArchState *env)
|
|
{
|
|
return riscv_cpu_mxl(env) != MXL_RV32;
|
|
}
|
|
|
|
bool common_semi_sys_exit_is_extended(CPUState *cs)
|
|
{
|
|
return is_64bit_semihosting(cpu_env(cs));
|
|
}
|
|
|
|
uint64_t common_semi_stack_bottom(CPUState *cs)
|
|
{
|
|
RISCVCPU *cpu = RISCV_CPU(cs);
|
|
CPURISCVState *env = &cpu->env;
|
|
return env->gpr[xSP];
|
|
}
|
|
|
|
bool common_semi_has_synccache(CPUArchState *env)
|
|
{
|
|
return true;
|
|
}
|