[parisc-linux] hppa glibc clone() patch proposal (3/3)
Grant Grundler
grundler at parisc-linux.org
Fri Mar 24 09:51:20 MST 2006
On Fri, Mar 24, 2006 at 11:18:25AM +0100, Joel Soete wrote:
> Hello Mike, pa*,
>
> And this last step is my actual fix proposal:
...
> ENTRY(__clone)
> + /* Sanity check arguments. */
> + comib,= 0, %arg0, .Larg_error /* no NULL function pointers */
> + ldi -EINVAL, %ret0
> + comib,= 0, %arg1, .Larg_error /* no NULL stack pointers */
> + nop
If this is correct, then I would prefer:
/* catch NULL stack or function ptrs */
xor %arg1, %arg0, %ret0
comib,=,n 0, %ret0, .Larg_error
ldi -EINVAL, %ret0
>
> /* Save the fn ptr and arg on the new stack. */
> stwm %arg0, 64(%arg1)
> @@ -60,8 +67,8 @@
>
> /* Create frame for function */
> copy %sp, %r21
> + stw %r21, 60(%sp)
Is %r21 used later again?
If not, then these two ops can become:
stw %sp, 60(%sp)
If yes, then add the copy() *after* the stw.
PA-RISC can only do one store at a time.
PA20 can do the copy in parallel with the store.
hth,
grant
More information about the parisc-linux
mailing list