From: Chung-Lin Tang <cltang@codesourcery.com>
To: <gdb-patches@sourceware.org>
Cc: Sandra Loosemore <sandra@codesourcery.com>
Subject: [patch, nios2] Update Linux parts for new syscall ABI
Date: Sun, 01 Dec 2013 08:20:00 -0000 [thread overview]
Message-ID: <529AF143.9060704@codesourcery.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 695 bytes --]
This patch updates the nios2-linux code for the new Linux generic system
call interface. Mainly removing (non-rt) sigreturn related definitions,
and updating the rt_sigreturn syscall NR.
Will commit after Sandra's approval.
Thanks,
Chung-Lin
2013-12-01 Chung-Lin Tang <cltang@codesourcery.com>
gdb/
* nios2-linux-tdep.c (nios2_linux_sigreturn_init): Remove.
(nios2_linux_sigreturn_tramp_frame): Remove.
(nios2_linux_rt_sigreturn_tramp_frame): Update rt_sigreturn syscall
number.
(nios2_linux_syscall_next_pc): Likewise. Remove sigreturn case.
(nios2_linux_init_abi):
Remove registration of nios2_linux_sigreturn_tramp_frame.
[-- Attachment #2: x.diff --]
[-- Type: text/plain, Size: 3209 bytes --]
diff --git a/gdb/nios2-linux-tdep.c b/gdb/nios2-linux-tdep.c
index fe29e7a..2051d45 100644
--- a/gdb/nios2-linux-tdep.c
+++ b/gdb/nios2-linux-tdep.c
@@ -97,33 +97,6 @@ nios2_regset_from_core_section (struct gdbarch *gdbarch,
FUNC is the address of the instruction TRAMP[0] in memory. */
static void
-nios2_linux_sigreturn_init (const struct tramp_frame *self,
- struct frame_info *next_frame,
- struct trad_frame_cache *this_cache,
- CORE_ADDR func)
-{
- CORE_ADDR base = func + 16;
- int i;
-
- for (i = 0; i < 8; i++)
- trad_frame_set_reg_addr (this_cache, i + 8, base + i * 4);
- for (i = 0; i < 7; i++)
- trad_frame_set_reg_addr (this_cache, i + 1, base + (i + 8) * 4);
- trad_frame_set_reg_addr (this_cache, NIOS2_RA_REGNUM, base + 16 * 4);
- trad_frame_set_reg_addr (this_cache, NIOS2_FP_REGNUM, base + 17 * 4);
- trad_frame_set_reg_addr (this_cache, NIOS2_SP_REGNUM, base + 18 * 4);
- trad_frame_set_reg_addr (this_cache, NIOS2_GP_REGNUM, base + 19 * 4);
- trad_frame_set_reg_addr (this_cache, NIOS2_ESTATUS_REGNUM, base + 20 * 4);
- trad_frame_set_reg_addr (this_cache, NIOS2_PC_REGNUM, base + 21 * 4);
-
- /* Save a frame ID. */
- trad_frame_set_id (this_cache, frame_id_build (base, func));
-}
-
-/* Initialize a trad-frame cache corresponding to the tramp-frame.
- FUNC is the address of the instruction TRAMP[0] in memory. */
-
-static void
nios2_linux_rt_sigreturn_init (const struct tramp_frame *self,
struct frame_info *next_frame,
struct trad_frame_cache *this_cache,
@@ -144,24 +117,12 @@ nios2_linux_rt_sigreturn_init (const struct tramp_frame *self,
trad_frame_set_id (this_cache, frame_id_build (base, func));
}
-static struct tramp_frame nios2_linux_sigreturn_tramp_frame =
-{
- SIGTRAMP_FRAME,
- 4,
- {
- { 0x00800004 | (119 << 6), -1 }, /* movi r2,__NR_sigreturn */
- { 0x003b683a, -1 }, /* trap */
- { TRAMP_SENTINEL_INSN }
- },
- nios2_linux_sigreturn_init
-};
-
static struct tramp_frame nios2_linux_rt_sigreturn_tramp_frame =
{
SIGTRAMP_FRAME,
4,
{
- { 0x00800004 | (173 << 6), -1 }, /* movi r2,__NR_rt_sigreturn */
+ { 0x00800004 | (139 << 6), -1 }, /* movi r2,__NR_rt_sigreturn */
{ 0x003b683a, -1 }, /* trap */
{ TRAMP_SENTINEL_INSN }
},
@@ -179,8 +140,7 @@ nios2_linux_syscall_next_pc (struct frame_info *frame)
/* If we are about to make a sigreturn syscall, use the unwinder to
decode the signal frame. */
- if (syscall_nr == 119 /* sigreturn */
- || syscall_nr == 173 /* rt_sigreturn */)
+ if (syscall_nr == 139 /* rt_sigreturn */)
return frame_unwind_caller_pc (frame);
return pc + NIOS2_OPCODE_SIZE;
@@ -209,8 +169,6 @@ nios2_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
nios2_regset_from_core_section);
/* Linux signal frame unwinders. */
tramp_frame_prepend_unwinder (gdbarch,
- &nios2_linux_sigreturn_tramp_frame);
- tramp_frame_prepend_unwinder (gdbarch,
&nios2_linux_rt_sigreturn_tramp_frame);
tdep->syscall_next_pc = nios2_linux_syscall_next_pc;
next reply other threads:[~2013-12-01 8:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-01 8:20 Chung-Lin Tang [this message]
2013-12-02 3:23 ` Joel Brobecker
2013-12-02 4:46 ` Chung-Lin Tang
2013-12-02 7:44 ` Joel Brobecker
2013-12-02 8:38 ` Chung-Lin Tang
2013-12-02 16:20 ` Sandra Loosemore
2013-12-03 3:01 ` Joel Brobecker
2013-12-10 6:55 ` Yao Qi
2013-12-03 3:07 ` Joel Brobecker
2013-12-20 13:16 ` Chung-Lin Tang
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=529AF143.9060704@codesourcery.com \
--to=cltang@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=sandra@codesourcery.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.
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).