lkml.org 
[lkml]   [2018]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v9 02/10] Makefile: Prepare for using macros for inline asm
Date
From: Logan Gunthorpe
Sent: November 7, 2018 at 6:53:02 PM GMT
> Subject: Re: [PATCH v9 02/10] Makefile: Prepare for using macros for inline asm
>
>
>
>
> On 2018-11-07 11:01 a.m., Nadav Amit wrote:
>> Ideas? Do people care about it?
>
> Just spit balling, but is there a reason we didn't just put the macros
> for inline assembly directly in the header? Something like this:
>
> asm(".macro ANNOTATE_UNREACHABLE counter:req\n\t"
> "\\counter:\n\t"
> ".pushsection .discard.unreachable\n\t"
> ".long \\counter\\()b -.\n\t"
> ".popsection\n\t"
> ".endm\n");
>
> #define annotate_unreachable() ({ \
> asm volatile("ANNOTATE_UNREACHABLE counter=%c0" \
> : : "i" (__COUNTER__)); \
> })
>
> It does mean the macros won't be usable in non-inline assembly, without
> duplicating them, but do we care about that?

HPA indicated more than once that this is wrong (and that was indeed my
initial solution), since it is not guaranteed that the compiler would put
the macro assembly before its use.

\
 
 \ /
  Last update: 2018-11-07 19:57    [W:4.257 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site