Re: [Qemu-devel] [PATCH 1/5] target-tricore: Add trap handling

2016-02-12 Thread Bastian Koppelmann
On 02/12/2016 07:55 PM, Richard Henderson wrote: > On 02/12/2016 10:12 PM, Bastian Koppelmann wrote: >> On 02/12/2016 03:39 AM, Richard Henderson wrote: >> >> What do you mean by "pre-interrupt state"? The register context is saved >> by generate_trap() calls. > > Because do_interrupt is normally

Re: [Qemu-devel] [PATCH 1/5] target-tricore: Add trap handling

2016-02-12 Thread Richard Henderson
On 02/12/2016 10:12 PM, Bastian Koppelmann wrote: On 02/12/2016 03:39 AM, Richard Henderson wrote: On 02/12/2016 03:01 AM, Bastian Koppelmann wrote: +void tricore_cpu_do_interrupt(CPUState *cs) +{ +TriCoreCPU *cpu = TRICORE_CPU(cs); +CPUTriCoreState *env = &cpu->env; + +/* The stack

Re: [Qemu-devel] [PATCH 1/5] target-tricore: Add trap handling

2016-02-12 Thread Bastian Koppelmann
On 02/12/2016 03:39 AM, Richard Henderson wrote: > On 02/12/2016 03:01 AM, Bastian Koppelmann wrote: >> +void tricore_cpu_do_interrupt(CPUState *cs) >> +{ >> +TriCoreCPU *cpu = TRICORE_CPU(cs); >> +CPUTriCoreState *env = &cpu->env; >> + >> +/* The stack pointer in A[10] is set to the In

Re: [Qemu-devel] [PATCH 1/5] target-tricore: Add trap handling

2016-02-11 Thread Richard Henderson
On 02/12/2016 03:01 AM, Bastian Koppelmann wrote: +static inline void +generate_trap(DisasContext *ctx, int class, int tin) +{ +TCGv_i32 classtemp = tcg_const_i32(class); +gen_save_pc(ctx->pc); +/* upper context cannot be saved, if the context list is empty */ +if (class != TRAPC_

Re: [Qemu-devel] [PATCH 1/5] target-tricore: Add trap handling

2016-02-11 Thread Richard Henderson
On 02/12/2016 03:01 AM, Bastian Koppelmann wrote: Add the infrastructure needed to generate and handle traps. Signed-off-by: Bastian Koppelmann --- target-tricore/cpu-qom.h | 2 +- target-tricore/cpu.c | 2 +- target-tricore/cpu.h | 1 + target-tricore/helper.c| 52 +++

[Qemu-devel] [PATCH 1/5] target-tricore: Add trap handling

2016-02-11 Thread Bastian Koppelmann
Add the infrastructure needed to generate and handle traps. Signed-off-by: Bastian Koppelmann --- target-tricore/cpu-qom.h | 2 +- target-tricore/cpu.c | 2 +- target-tricore/cpu.h | 1 + target-tricore/helper.c| 52 +++ target-tricore/helper.h