tech-kern archive

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

Re: [PATCH] swapcontext vs libpthread



On Aug 25,  7:00am, manu%netbsd.org@localhost (Emmanuel Dreyfus) wrote:
-- Subject: Re: [PATCH] swapcontext vs libpthread

| > 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?

CALL() is good.

| 
| > 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
| #else 
|         ldil    L%_C_LABEL(setcontext), %r1
|         ldo     R%_C_LABEL(setcontext)(%r1), %r1
| #endif

Yes, that loads the address to %1, you'll need to call afterwards.

| > 
| > FIX: ./mips/gen/_resumecontext.S:    SYSTRAP(setcontext)                    
         #   yes, become it.
| > FIX: ./mips/gen/swapcontext.S:       SYSTRAP(setcontext)
| 
| I would do this:
|       PIC_TAILCALL(setcontext)

I guess.

| 
| > 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)

Ok.

| > 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)

Sure.

| 
| > FIX: ./powerpc64/gen/swapcontext.S:  bl      .setcontext                    
 # setcontext(ucp)
| 
| Here it seems to be:
|         bl      PIC_PLT(_C_LABEL(setcontest))
| 

Ok, sounds good. Portmasters, please chime in!

christos


Home | Main Index | Thread Index | Old Index