This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] x86 interrupt attribute


On Thu, Oct 1, 2015 at 2:24 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Wed, Sep 30, 2015 at 12:53 PM, Yulia Koval <vaalfreja@gmail.com> wrote:
>> Done.
>>
>
> +  /* If true, the current function is an interrupt service
> +     routine as specified by the "interrupt" attribute.  */
> +  BOOL_BITFIELD is_interrupt : 1;
> +
> +  /* If true, the current function is an exception service
> +     routine as specified by the "interrupt" attribute.  */
> +  BOOL_BITFIELD is_exception : 1;
>
>
> It is not very clear what is the difference between is_interrupt
> and is_exception.  How about
>
>   /* If true, the current function is an interrupt service routine with
>      a pointer argument and an optional integer argument as specified by
>      the "interrupt" attribute.  */
>   BOOL_BITFIELD is_interrupt : 1;
>
>   /* If true, the current function is an interrupt service routine with
>      a pointer argument and an integer argument as specified by the
>      "interrupt" attribute.  */
>   BOOL_BITFIELD is_exception : 1;

Actually, both BOOL_BITFIELD flags should be rewritten as 2-bit
ENUM_BITFIELD using descriptive enum, e.g.

  ENUM_BITFIELD(function_type) func_type : 2;

with

TYPE_NORMAL = 0,
TYPE_INTERRUPT,
TYPE_EXCEPTION

This will simplify checking of function types, and make everything
more readable and maintainable.

Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]