Re: [PATCH 03/10] MIPS: End asm function prologue macros with .insn

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

 



Hi Paul,

> And thanks for your review :)

 You're welcome!

> For the record, the reason I went with placing the EXPORT_SYMBOL invocations 
> at the start of the functions rather than the end is that the end isn't always 
> the end of the code in question. For example (until another patch of mine) 
> memcpy ends part way through user_copy, with code continuing afterwards. We 
> would then need to place a .insn after the use of EXPORT_SYMBOL if any code 
> may branch there. Containing the need for .insn to the start of the function 
> seems neater since a function should always begin with an instruction, which 
> after this patch will be marked as such, and users of the macros will just get 
> behaviour that seems natural & expected.

 Well, the real end is where END (`.end') is, and I think placing `.end' 
midway-through a code block is really bad style, partly because it affects 
frame annotation (all the stuff from `.frame', `.mask', etc.) recorded 
in the object assembled.  A LEAF/NESTED (`.ent') and END (`.end') pair 
should really only mark the physical beginning and ending of a whole 
single function.

 If a function has alternative entry points, then FEXPORT should be used 
for those, which on the MIPS target should include a `.aent' pseudo-op as 
a part of the symbol definition and I can't really tell why why we don't 
(trivial patch now in the works).

 NB in the MIPS assembly dialect `.type symbol, @function' is redundant in 
the presence of either `.ent symbol' or `.aent symbol', as is `.size 
symbol, . - symbol' where `.end symbol' is also present.  There's no harm 
either though.

> Of course another alternative would be to place EXPORT_SYMBOL before LEAF/
> NESTED/FEXPORT, but I don't think that would really make any difference  
> presuming people agree that this patch is a good idea regardless.

 TBH I do maintain keeping all the EXPORT_SYMBOL stuff outside function 
bodies would be the cleanest approach, grouping the handling for all given 
function's intended entry points after its final END, arranged as I 
described above.  Do you find this proposal problematic for some reason?

  Maciej




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux