From: Steve Ellcey <sellcey@cavium.com>
To: Andreas Schwab <schwab@suse.de>
Cc: libc-alpha <libc-alpha@sourceware.org>
Subject: Re: [Patch] aarch64: Fix tst-makecontext3 in ILP32 mode.
Date: Wed, 30 Aug 2017 16:17:00 -0000 [thread overview]
Message-ID: <1504109817.5204.47.camel@cavium.com> (raw)
In-Reply-To: <1502983951.16131.3.camel@cavium.com>
[-- Attachment #1: Type: text/plain, Size: 970 bytes --]
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.
[-- Attachment #2: aarch64-ilp32-makecontext.patch --]
[-- Type: text/x-patch, Size: 1277 bytes --]
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);
}
next prev parent reply other threads:[~2017-08-30 16:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-15 18:09 Steve Ellcey
2017-08-16 8:03 ` Andreas Schwab
2017-08-17 15:32 ` Steve Ellcey
2017-08-30 16:17 ` Steve Ellcey [this message]
2017-08-30 16:18 ` Szabolcs Nagy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1504109817.5204.47.camel@cavium.com \
--to=sellcey@cavium.com \
--cc=libc-alpha@sourceware.org \
--cc=schwab@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).