qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH v1 2/7] qom/cpu.c: Encapsulate cpu halting


From: Edgar E. Iglesias
Subject: Re: [Qemu-devel] [RFC PATCH v1 2/7] qom/cpu.c: Encapsulate cpu halting
Date: Sat, 30 Mar 2013 09:04:52 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Mar 04, 2013 at 07:01:34PM +1000, Peter Crosthwaite wrote:
> Set up the Device level halting API to halt cpus. This allows holders of a
> pointer to the CPU to halt it from the TYPE_DEVICE abstraction. (i.e. they
> can halt it even if they dont know its a CPU).
> 
> Signed-off-by: Peter Crosthwaite <address@hidden>
> ---
> 
>  qom/cpu.c |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
> 
> diff --git a/qom/cpu.c b/qom/cpu.c
> index e242dcb..00a07d9 100644
> --- a/qom/cpu.c
> +++ b/qom/cpu.c
> @@ -43,6 +43,20 @@ static void cpu_common_reset(CPUState *cpu)
>      cpu->halted = 0;
>  }
>  
> +static void cpu_common_halt(DeviceState *dev)
> +{
> +    CPUState *s = CPU(dev);
> +
> +    s->halted = 1;
> +}
> +
> +static void cpu_common_unhalt(DeviceState *dev)
> +{
> +    CPUState *s = CPU(dev);
> +
> +    s->halted = 0;
> +}


Hi,

I might be wrong, but doesn't this also need to raise/lower CPU_INTERRUPT_HALT?
(e.g if the CPU is i a tight tcg loop with interrupts disabled)

Cheers,
Edgar



reply via email to

[Prev in Thread] Current Thread [Next in Thread]