This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] x86 interrupt attribute
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Yulia Koval <vaalfreja at gmail dot com>, Mike Stump <mikestump at comcast dot net>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 1 Oct 2015 17:59:04 +0200
- Subject: Re: [PATCH] x86 interrupt attribute
- Authentication-results: sourceware.org; auth=none
- References: <CAE0nxxi-T8da1=dXkHem2m6d_2RramotAU3HY=UqFkmT0kW=RQ at mail dot gmail dot com> <2AB9494F-91EC-4CF6-945B-0CB03A583513 at comcast dot net> <CAMe9rOpMB9fnj_ZS7h122BuODsf9TZNOUvWVzrYvLN8VxGiFkg at mail dot gmail dot com> <CAMe9rOoeorsg06XxtNr1-iNX_m-Fe8gtsW2uXs_M2+EOw+gLqg at mail dot gmail dot com> <F096FB33-4A00-4D7B-8C9B-3FE8ACE7FEF9 at comcast dot net> <CAMe9rOoDBMKGeUBJjCrGQQNnFE559gxZwhvWOXT8gn9Zo68nsQ at mail dot gmail dot com> <1D91C2C8-833D-4F6D-9C57-C22D61662A83 at comcast dot net> <CAMe9rOoig1gcjaQLqCAE4o3OehBBgkCwN2wHDatqB=QhykEp6A at mail dot gmail dot com> <CAMe9rOr3nVJnxi_ib=pZrDjuUNX6nzqQwRM7_WLBAYm-_63yhg at mail dot gmail dot com> <CAE0nxxg99PaOCbD2naRRgSMYs7Scc5KvQ2SFdQcLqB8yO+yh=A at mail dot gmail dot com> <CAMe9rOoMJ-RWPLn_GiqK0tTDb26QhKKM4n9c+=E8VRMkfJKX3Q at mail dot gmail dot com> <CAE0nxxhFg9EAxoee9gKxUQcDT=2mFb4=eCM4c4fgcZECCGwCeQ at mail dot gmail dot com> <CAMe9rOoD_P1+wq_Cwho+J_2iMTz+eAhAhJDHiDVQ4vgbKQ6-4g at mail dot gmail dot com>
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.