From: Khem Raj <raj.khem@gmail.com>
To: musl@lists.openwall.com
Cc: Khem Raj <raj.khem@gmail.com>
Subject: [PATCH V2] riscv64: Change container for riscv floating-point state to __riscv_mc_fp_state
Date: Sat, 28 Sep 2019 16:45:42 -0700 [thread overview]
Message-ID: <20190928234542.1426990-1-raj.khem@gmail.com> (raw)
Match the struct elements with glibc
glibc also uses __riscv_mc prefix, some packages like gdb uses that
include bits/signal.h in sys/user.h for __riscv_mc_fp_state type definition
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Include bits/signal.h in sys/user.h
arch/riscv64/bits/signal.h | 18 +++++++++---------
arch/riscv64/bits/user.h | 4 +++-
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/arch/riscv64/bits/signal.h b/arch/riscv64/bits/signal.h
index 76d7ad80..aba7ab00 100644
--- a/arch/riscv64/bits/signal.h
+++ b/arch/riscv64/bits/signal.h
@@ -13,25 +13,25 @@ typedef unsigned long greg_t;
typedef unsigned long gregset_t[32];
struct __riscv_mc_f_ext_state {
- unsigned int f[32];
- unsigned int fcsr;
+ unsigned int __f[32];
+ unsigned int __fcsr;
};
struct __riscv_mc_d_ext_state {
- unsigned long long f[32];
- unsigned int fcsr;
+ unsigned long long __f[32];
+ unsigned int __fcsr;
};
struct __riscv_mc_q_ext_state {
- unsigned long long f[64] __attribute__((aligned(16)));
- unsigned int fcsr;
+ unsigned long long __f[64] __attribute__((aligned(16)));
+ unsigned int __fcsr;
unsigned int reserved[3];
};
union __riscv_mc_fp_state {
- struct __riscv_mc_f_ext_state f;
- struct __riscv_mc_d_ext_state d;
- struct __riscv_mc_q_ext_state q;
+ struct __riscv_mc_f_ext_state __f;
+ struct __riscv_mc_d_ext_state __d;
+ struct __riscv_mc_q_ext_state __q;
};
typedef union __riscv_mc_fp_state fpregset_t;
diff --git a/arch/riscv64/bits/user.h b/arch/riscv64/bits/user.h
index d2e383b2..c0a46ada 100644
--- a/arch/riscv64/bits/user.h
+++ b/arch/riscv64/bits/user.h
@@ -1,3 +1,5 @@
+#include <bits/signal.h>
+
struct user_fpregs_struct {
double f[32];
unsigned int fcsr;
@@ -5,4 +7,4 @@ struct user_fpregs_struct {
#define ELF_NGREG 32
typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
-typedef struct user_fpregs_struct elf_fpregset_t;
+typedef union __riscv_mc_fp_state elf_fpregset_t;
--
2.23.0
reply other threads:[~2019-09-28 23:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20190928234542.1426990-1-raj.khem@gmail.com \
--to=raj.khem@gmail.com \
--cc=musl@lists.openwall.com \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).