[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 04/13] target/ppc: prepare to split ppc_interrupt_pending
From: |
Fabiano Rosas |
Subject: |
Re: [RFC PATCH 04/13] target/ppc: prepare to split ppc_interrupt_pending by excp_model |
Date: |
Mon, 15 Aug 2022 17:25:36 -0300 |
Matheus Ferst <matheus.ferst@eldorado.org.br> writes:
> Rename the method to ppc_interrupt_pending_legacy and create a new
> ppc_interrupt_pending that will call the appropriate interrupt masking
> method based on env->excp_model.
>
> Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
> ---
> target/ppc/excp_helper.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
> index 8690017c70..59981efd16 100644
> --- a/target/ppc/excp_helper.c
> +++ b/target/ppc/excp_helper.c
> @@ -1678,7 +1678,7 @@ void ppc_cpu_do_interrupt(CPUState *cs)
> powerpc_excp(cpu, cs->exception_index);
> }
>
> -static int ppc_pending_interrupt(CPUPPCState *env)
> +static int ppc_pending_interrupt_legacy(CPUPPCState *env)
Won't this code continue to be used for the older CPUs? If so, I don't
think the term legacy is appropriate. It ends up being dependent on
context and what people's definitions of "legacy" are.
(if this function is removed in a later patch, then that's ok).
> {
> bool async_deliver;
>
> @@ -1790,6 +1790,14 @@ static int ppc_pending_interrupt(CPUPPCState *env)
> return 0;
> }
>
> +static int ppc_pending_interrupt(CPUPPCState *env)
> +{
> + switch (env->excp_model) {
> + default:
> + return ppc_pending_interrupt_legacy(env);
> + }
> +}
> +
> static void ppc_hw_interrupt(CPUPPCState *env, int pending_interrupt)
> {
> PowerPCCPU *cpu = env_archcpu(env);