[CRIU] [PATCH 11/22] restorer: wrapped the assembly calling sys_rt_sigreturn into the macro ARCH_RT_SIGRETURN

Cyrill Gorcunov gorcunov at openvz.org
Fri Dec 28 04:47:34 EST 2012


On Fri, Dec 28, 2012 at 01:30:05PM +0400, Pavel Emelyanov wrote:
> On 12/28/2012 01:23 PM, Cyrill Gorcunov wrote:
> > On Fri, Dec 28, 2012 at 01:06:57PM +0400, Pavel Emelyanov wrote:
> >> On 12/28/2012 01:00 PM, Alexander Kartashov wrote:
> >>> On 12/28/2012 12:54 PM, Pavel Emelyanov wrote:
> >>>> I'd prefer seeing this in some .S file, rather than in a header. How complex
> >>>> would it be to do so?
> >>>
> >>> We will have to implement C calling convention by hand
> >>> for every supported architecture if it goes there.
> >>
> >> I see.
> >>
> >>> Is it OK to do this?
> >>
> >> Let's do the following -- for now keep this as macro, but some time
> >> later, in the background, move it into a .S file.
> > 
> > I think moving a couple of instruction into .S file actually doesn't worth much.
> 
> It's just about code readability. Reading .S file is more comfortable that
> doing the same with preprocessor stuff in .h

This particular function should be in .c file rather than in header as a macro.
The patch I posted did exactly this.

> > When being working on restorer redesign I've implemented the following
> > patch (just for info).
> 
> I mean "move it to some .c file with asm() code inside"? Why do we have the
> parasite-head.S then, not parasite-head.c?

parasite-head.S is special, it's bootstrap code where we need to setup own
stack and etc, and bootstrap code must have very precise instructions (without
function prologue) which is impossible to reach with asm() statements (well,
actually I could make it in .c with asm() but it would require more tricks
to use, that's why I used .S in first place).

	Cyrill


More information about the CRIU mailing list