From: Marcus Shawcroft <marcus.shawcroft@linaro.org>
To: libc-ports@sourceware.org
Subject: [COMMITTED] AArch64 ensure getcontext initializes pstate.
Date: Tue, 04 Jun 2013 09:10:00 -0000 [thread overview]
Message-ID: <CABXK9nceYFp9nAGy+CDcRvwC7ejg7tuyZgriLu__Nd1-Y_68vQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 298 bytes --]
This patch ensures that getcontext() initializes pstate to a sane value.
/Marcus
2013-06-04 Marcus Shawcroft <marcus.shawcroft@linaro.org>
* sysdeps/unix/sysv/linux/aarch64/getcontext.S (__getcontext):
Initialize pstate.
* sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym (oPSTATE): Define.
[-- Attachment #2: glibc-getcontext-initialize-pstate.diff --]
[-- Type: application/octet-stream, Size: 1062 bytes --]
diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/getcontext.S b/ports/sysdeps/unix/sysv/linux/aarch64/getcontext.S
index eea6867..c370957 100644
--- a/ports/sysdeps/unix/sysv/linux/aarch64/getcontext.S
+++ b/ports/sysdeps/unix/sysv/linux/aarch64/getcontext.S
@@ -53,6 +53,10 @@ ENTRY(__getcontext)
mov x2, sp
str x2, [x0, oSP]
+ /* Initialize the pstate. */
+ mov x3, #0
+ str x3, [x0, oPSTATE]
+
/* Figure out where to place the first context extension
block. */
add x2, x0, #oEXTENSION
diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym b/ports/sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym
index 1afff78..ab3930c 100644
--- a/ports/sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym
+++ b/ports/sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym
@@ -37,6 +37,7 @@ STACK_FLAGS stack (ss_flags)
oX0 mcontext (regs)
oSP mcontext (sp)
oPC mcontext (pc)
+oPSTATE mcontext (pstate)
oEXTENSION mcontext (__reserved)
#define fpsimd_context(member) offsetof (struct fpsimd_context, member)
next reply other threads:[~2013-06-04 9:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-04 9:10 Marcus Shawcroft [this message]
2013-06-04 12:43 ` Richard Henderson
2013-06-05 15:03 ` Marcus Shawcroft
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=CABXK9nceYFp9nAGy+CDcRvwC7ejg7tuyZgriLu__Nd1-Y_68vQ@mail.gmail.com \
--to=marcus.shawcroft@linaro.org \
--cc=libc-ports@sourceware.org \
/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).