tech-kern archive

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

Re: [PATCH] swapcontext vs libpthread

On Sat, Aug 25, 2012 at 12:37:27AM -0400, Christos Zoulas wrote:
> FIX: ./alpha/gen/swapcontext.S:      CALL(setcontext)                /* 
> setcontext(ucp) */

That one seems already fine to me. The CALL macro is here to invoke a function
Am I wrong?

> FIX: ./hppa/gen/swapcontext.S:       SYSCALL(setcontext)

If I try to steal from resumecontext, I would do this. Does it make sense?

#ifdef PIC 
        ldw     HPPA_FRAME_EDP(%sp), %r19 
        addil   LT%_C_LABEL(setcontext), %r19
        ldw     RT%_C_LABEL(setcontext)(%r1), %r1
        ldil    L%_C_LABEL(setcontext), %r1
        ldo     R%_C_LABEL(setcontext)(%r1), %r1

> FIX: ./mips/gen/_resumecontext.S:    SYSTRAP(setcontext)                      
>        #   yes, become it.
> FIX: ./mips/gen/swapcontext.S:       SYSTRAP(setcontext)

I would do this:

> FIX?: ./sh3/gen/swapcontext.S:        mov.l   .L_setcontext, r2
> FIX?: ./sh3/gen/swapcontext.S:2:      CALL    r2                      /* 
> setcontext(ucp) */

There is this later in the file, therefore I would say it is okay.
.L_setcontext:          CALL_DATUM(_C_LABEL(setcontext), 2b)

> FIX: ./sparc/gen/swapcontext.S:      mov     SYS_setcontext|SYSCALL_G2RFLAG, 
> %g1
> FIX: ./sparc64/gen/swapcontext.S:      mov     
> SYS_setcontext|SYSCALL_G2RFLAG, %g1

I would do this:
        call    _C_LABEL(setcontext)

> FIX: ./powerpc64/gen/swapcontext.S:  bl      .setcontext                     
> # setcontext(ucp)

Here it seems to be:
        bl      PIC_PLT(_C_LABEL(setcontest))

Emmanuel Dreyfus

Home | Main Index | Thread Index | Old Index