{make,set,swap}context broken on powerpc32

Paul Mackerras paulus@samba.org
Thu Dec 21 20:49:00 GMT 2006


Steven Munroe writes:

> >I don't understand the getcontext/swapcontext bits in the patch.
> >There is no need to touch oldctx->uc_mcontext.uc_regs when
> >oldctx is immediately passed as first argument to swapcontext(2),
> >that syscall overwrites it anyway:
> >  
> >
> If that is true for old versions of the kernels as well?

All kernels that have a swapcontext system call set
oldctx->uc_mcontext.uc_regs (assuming oldctx != NULL).

> If all versions of kernel where __ASSUME_SWAPCONTEXT_SYSCALL is defined, 
> sets the uc_regs pointer to at least double word then just the 
> makecontext change is required.

The alignment of uc_regs will be the same as that of old_ctx, which is
probably only 4 bytes.  However, that's good enough for loading and
storing GPRs and FPRs.

Paul.



More information about the Libc-alpha mailing list