From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31877 invoked by alias); 1 Dec 2013 08:20:41 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 31854 invoked by uid 89); 1 Dec 2013 08:20:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_05,RDNS_NONE,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 01 Dec 2013 08:20:35 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Vn2GJ-0003Tq-Mg from ChungLin_Tang@mentor.com for gdb-patches@sourceware.org; Sun, 01 Dec 2013 00:20:19 -0800 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 1 Dec 2013 00:20:19 -0800 Received: from [0.0.0.0] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.2.247.3; Sun, 1 Dec 2013 00:20:17 -0800 Message-ID: <529AF143.9060704@codesourcery.com> Date: Sun, 01 Dec 2013 08:20:00 -0000 From: Chung-Lin Tang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: CC: Sandra Loosemore Subject: [patch, nios2] Update Linux parts for new syscall ABI Content-Type: multipart/mixed; boundary="------------090706080406010409090502" X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00000.txt.bz2 --------------090706080406010409090502 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Content-length: 695 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 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. --------------090706080406010409090502 Content-Type: text/plain; charset="Big5"; name="x.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="x.diff" Content-length: 3209 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; --------------090706080406010409090502--