This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: {make,set,swap}context broken on powerpc32


Steven Munroe writes:

> >Note that sys_swapcontext can happily use, as its second argument, a
> >ucontext where the uc_mcontext.uc_regs field is not 16-byte aligned,
> >though, so glibc could work around the kernel bug by doing the memmove
> >in makecontext as you suggest.
> >
> >  
> I would like to avoid any memmove by aligning the regs buffer properly
> in the first place.

I don't understand why makecontext has to set the regs pointer at all,
given that the user has to call getcontext first.  Why can't
makecontext just use the pointer that getcontext has set?

If you do that then there is no problem using the sys_swapcontext
syscall even on kernels that have the alignment bug, as long as you
use sys_swapcontext for setcontext and swapcontext.  (And yes I will
fix the alignment bug in the kernel.)

Paul.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]