This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [Patch] aarch64: Fix tst-makecontext3 in ILP32 mode.
- From: Andreas Schwab <schwab at suse dot de>
- To: Steve Ellcey <sellcey at cavium dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Wed, 16 Aug 2017 10:01:54 +0200
- Subject: Re: [Patch] aarch64: Fix tst-makecontext3 in ILP32 mode.
- Authentication-results: sourceware.org; auth=none
- References: <1502820555.3962.197.camel@cavium.com>
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.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."