Message ID | 1502820555.3962.197.camel@cavium.com |
---|---|
State | New |
Headers | show |
On Aug 15 2017, Steve Ellcey <sellcey@cavium.com> wrote: > diff --git a/sysdeps/unix/sysv/linux/aarch64/makecontext.c b/sysdeps/unix/sysv/linux/aarch64/makecontext.c > index f510f48..8e52b5d 100644 > --- a/sysdeps/unix/sysv/linux/aarch64/makecontext.c > +++ b/sysdeps/unix/sysv/linux/aarch64/makecontext.c > @@ -42,18 +42,18 @@ void > __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...) > { > extern void __startcontext (void); > - unsigned long int *sp; > + uint64_t *sp; > va_list ap; > int i; > > - sp = (unsigned long int *) > + sp = (uint64_t *) > ((uintptr_t) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size); > > /* Allocate stack arguments. */ > sp -= argc < 8 ? 0 : argc - 8; > > /* Keep the stack aligned. */ > - sp = (unsigned long int *) (((uintptr_t) sp) & -16L); > + sp = (uint64_t *) (((uintptr_t) sp) & -16L); > > ucp->uc_mcontext.regs[19] = (uintptr_t) ucp->uc_link; > ucp->uc_mcontext.sp = (uintptr_t) sp; > @@ -66,7 +66,7 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...) > if (i < 8) > ucp->uc_mcontext.regs[i] = va_arg (ap, unsigned long int); I think you want to use uint64_t here as well. Andreas.
On Wed, 2017-08-16 at 10:01 +0200, Andreas Schwab wrote: > On Aug 15 2017, Steve Ellcey <sellcey@cavium.com> wrote: > > > @@ -66,7 +66,7 @@ __makecontext (ucontext_t *ucp, void (*func) > > (void), int argc, ...) > > if (i < 8) > > ucp->uc_mcontext.regs[i] = va_arg (ap, unsigned long int); > I think you want to use uint64_t here as well. > > Andreas. I agree, I will make that change. Steve Ellcey sellcey@cavium.com
On Thu, 2017-08-17 at 08:32 -0700, Steve Ellcey wrote: > On Wed, 2017-08-16 at 10:01 +0200, Andreas Schwab wrote: > > > > On Aug 15 2017, Steve Ellcey <sellcey@cavium.com> wrote: > > > > > > > > @@ -66,7 +66,7 @@ __makecontext (ucontext_t *ucp, void (*func) > > > (void), int argc, ...) > > > if (i < 8) > > > ucp->uc_mcontext.regs[i] = va_arg (ap, unsigned long int); > > I think you want to use uint64_t here as well. > > > > Andreas. > I agree, I will make that change. > > Steve Ellcey > sellcey@cavium.com Here is an updated patch. Is this OK to check in now? It is only needed for ILP32 aarch64 but it is a correct standalone change and it would be nice to have it in the mainline. Steve Ellcey sellcey@cavium.com 2017-08-30 Steve Ellcey <sellcey@cavium.com> * sysdeps/unix/sysv/linux/aarch64/makecontext.c (__makecontext): Use pointer to uint64_t instead of long int for sp. diff --git a/sysdeps/unix/sysv/linux/aarch64/makecontext.c b/sysdeps/unix/sysv/linux/aarch64/makecontext.c index f510f48..20057f8 100644 --- a/sysdeps/unix/sysv/linux/aarch64/makecontext.c +++ b/sysdeps/unix/sysv/linux/aarch64/makecontext.c @@ -42,18 +42,18 @@ void __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...) { extern void __startcontext (void); - unsigned long int *sp; + uint64_t *sp; va_list ap; int i; - sp = (unsigned long int *) + sp = (uint64_t *) ((uintptr_t) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size); /* Allocate stack arguments. */ sp -= argc < 8 ? 0 : argc - 8; /* Keep the stack aligned. */ - sp = (unsigned long int *) (((uintptr_t) sp) & -16L); + sp = (uint64_t *) (((uintptr_t) sp) & -16L); ucp->uc_mcontext.regs[19] = (uintptr_t) ucp->uc_link; ucp->uc_mcontext.sp = (uintptr_t) sp; @@ -64,9 +64,9 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...) va_start (ap, argc); for (i = 0; i < argc; ++i) if (i < 8) - ucp->uc_mcontext.regs[i] = va_arg (ap, unsigned long int); + ucp->uc_mcontext.regs[i] = va_arg (ap, uint64_t); else - sp[i - 8] = va_arg (ap, unsigned long int); + sp[i - 8] = va_arg (ap, uint64_t); va_end (ap); }
On 30/08/17 17:16, Steve Ellcey wrote: > Here is an updated patch. Is this OK to check in now? It is only > needed for ILP32 aarch64 but it is a correct standalone change and it > would be nice to have it in the mainline. > > Steve Ellcey > sellcey@cavium.com > > > 2017-08-30 Steve Ellcey <sellcey@cavium.com> > > * sysdeps/unix/sysv/linux/aarch64/makecontext.c (__makecontext): > Use pointer to uint64_t instead of long int for sp. > OK.
diff --git a/sysdeps/unix/sysv/linux/aarch64/makecontext.c b/sysdeps/unix/sysv/linux/aarch64/makecontext.c index f510f48..8e52b5d 100644 --- a/sysdeps/unix/sysv/linux/aarch64/makecontext.c +++ b/sysdeps/unix/sysv/linux/aarch64/makecontext.c @@ -42,18 +42,18 @@ void __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...) { extern void __startcontext (void); - unsigned long int *sp; + uint64_t *sp; va_list ap; int i; - sp = (unsigned long int *) + sp = (uint64_t *) ((uintptr_t) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size); /* Allocate stack arguments. */ sp -= argc < 8 ? 0 : argc - 8; /* Keep the stack aligned. */ - sp = (unsigned long int *) (((uintptr_t) sp) & -16L); + sp = (uint64_t *) (((uintptr_t) sp) & -16L); ucp->uc_mcontext.regs[19] = (uintptr_t) ucp->uc_link; ucp->uc_mcontext.sp = (uintptr_t) sp; @@ -66,7 +66,7 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...) if (i < 8) ucp->uc_mcontext.regs[i] = va_arg (ap, unsigned long int); else - sp[i - 8] = va_arg (ap, unsigned long int); + sp[i - 8] = va_arg (ap, uint64_t); va_end (ap); }