qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH qom-cpu v2 25/29] cpu: Move CPU_INTERRUPT_* to q


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH qom-cpu v2 25/29] cpu: Move CPU_INTERRUPT_* to qom/cpu.h
Date: Mon, 17 Jun 2013 13:59:45 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6

On 06/16/2013 08:57 AM, Andreas Färber wrote:
> +enum CPUInterruptFlags {
> +    CPU_INTERRUPT_HARD      = 0x0002,
> +    CPU_INTERRUPT_EXITTB    = 0x0004,
> +    CPU_INTERRUPT_HALT      = 0x0020,
> +    CPU_INTERRUPT_DEBUG     = 0x0080,
> +
> +#if defined(CONFIG_SOFTMMU) || defined(CONFIG_USER_ONLY)
> +    /* Several target-specific external hardware interrupts.
> +     * Each target/cpu.h should define proper names based on them.
> +     */
> +    CPU_INTERRUPT_TGT_EXT_0 = 0x0008,
> +    CPU_INTERRUPT_TGT_EXT_1 = 0x0010,
> +    CPU_INTERRUPT_TGT_EXT_2 = 0x0040,
> +    CPU_INTERRUPT_TGT_EXT_3 = 0x0200,
> +    CPU_INTERRUPT_TGT_EXT_4 = 0x1000,

I don't like this.  It's a subtle point between C and C++ that the later can
change the implementation type of the enum based on the contents of the enum.
While we don't currently ever build with C++, I'd rather not have something
like this hiding.

Is the ifdef really better than the poison?


r~



reply via email to

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