[Devel] Re: [PATCH 2/5] user-cr: align powerpc sp for eclone, clean up __eclone

Matt Helsley matthltc at us.ibm.com
Wed Dec 16 20:53:03 PST 2009


On Wed, Dec 16, 2009 at 08:29:25PM -0800, Matt Helsley wrote:
> On Fri, Dec 04, 2009 at 11:02:28PM -0600, Nathan Lynch wrote:

<snip>

> >  	/* Set up arguments for system call. */
> > -	mr	r3,r5	/* flags */
> > -	mr	r4,r7	/* clone_args */
> > -	mr	r5,r8	/* clone_args' size */
> > -	mr	r6,r9	/* pids */
> > +	mr	r3,r4	/* flags */
> > +	mr	r4,r6	/* clone_args */
> > +	mr	r5,r7	/* clone_args' size */
> > +	mr	r6,r8	/* pids */
> 
> Wouldn't it be possible to avoid some mr instructions above by re-arranging

(The 4 immediately above)

> the function arguments? Then you're just saving things in the two non-volatile
> gprs before making the eclone syscall. I think this amounts to making the
> prototype:
>
> int [r3] eclone(int flags [r3],
> 		struct clone_args *args [r4],
> 		size_t args_size [r6],
> 		pid_t *pids [r7],
> 		int (*fn)(void *arg) [r8],
> 		void *fn_arg [r9]);

Argh, should've been:

int [r3] __eclone(int flags [r3],
              struct clone_args *args [r4],
              size_t args_size [r5],
              pid_t *pids [r6],
              int (*fn)(void *arg) [r7],
              void *fn_arg [r8]);

Cheers,
	-Matt
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list