From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7568 invoked by alias); 3 Apr 2008 12:26:26 -0000 Received: (qmail 7560 invoked by uid 22791); 3 Apr 2008 12:26:26 -0000 X-Spam-Check-By: sourceware.org Received: from 204-133-123-27.dia.static.slbbi.com (HELO mail.chez-thomas.org) (204.133.123.27) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 03 Apr 2008 12:26:01 +0000 Received: by mail.chez-thomas.org (Postfix, from userid 999) id 6E88768C8034; Thu, 3 Apr 2008 06:25:59 -0600 (MDT) Received: from hermes.chez-thomas.org (hermes_local [192.168.1.101]) by mail.chez-thomas.org (Postfix) with ESMTP id 97A6168C802B; Thu, 3 Apr 2008 06:25:56 -0600 (MDT) Message-ID: <47F4CCD3.8090104@mlbassoc.com> Date: Thu, 03 Apr 2008 12:38:00 -0000 From: Gary Thomas User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: trollepi jj CC: ecos-discuss@ecos.sourceware.org References: In-Reply-To: Content-Type: multipart/mixed; boundary="------------080808080908000402090208" Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] how work synthetic for exceptions X-SW-Source: 2008-04/txt/msg00044.txt.bz2 --------------080808080908000402090208 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 2293 trollepi jj wrote: > Hi, > I try do modify the execution of a thread for the synthetic target. > I've done that for an at91 board (using SWI,exception hanler and HAL_SavedRegisters to store the context info). > I put an exception handler for the CYG_HAL_SYS_SIGILL to see if i get the info pointers of the handler (3rd parameter of the function). > I reach the exception handler and have this backtrace call from gdb > > > #0 simple_syscall_handler (data=2, number=0, info=0) at main.c:56 > #1 0x01004c7c in Cyg_Exception_Control::deliver_exception (this=0x2004560, exception_number=0, > exception_info=0) at /home/pitrolle/ecos/ecos/packages/kernel/current/src/common/except.cxx:235 > #2 0x010042bf in Cyg_Thread::deliver_exception (this=0x20004c0, exception_number=0, exception_info=0) > at /home/pitrolle/ecos/ecos/packages/kernel/current/src/common/thread.cxx:1013 > #3 0x01004ce0 in cyg_hal_deliver_exception (code=0, data=0) > at /home/pitrolle/ecos/ecos/packages/kernel/current/src/common/except.cxx:248 > #4 0x0100160d in synth_exception_sighandler (sig=4) > at /home/pitrolle/ecos/ecos/packages/hal/synth/arch/current/src/synth_intr.c:460 > #5 0x01002e18 in cyg_hal_sys_restore_rt () > at /home/pitrolle/ecos/ecos/packages/hal/synth/i386linux/current/src/syscall-i386-linux-1.0.S:446 > #6 0x00000004 in ?? () > #7 0x0100418c in idle_thread_main (data=0) > at /home/pitrolle/ecos/ecos/packages/kernel/current/src/common/thread.cxx:1231 > #8 0x01004be0 in Cyg_HardwareThread::thread_entry (thread=0x20004c0) > at /home/pitrolle/ecos/ecos/packages/kernel/current/src/common/thread.cxx:95 > #9 0x00000000 in ?? () > > I have severals questions : > - What is the real aim of cyg_hal_sys_restore_rt? > - If I want to get the context of the thread on the exception handler (info about saved registers like previous pc,sp,...) , what can i process? Note: if you're trying to use the SWI exception, then I think you need to apply the attached patch (I've not had a chance to try it as I don't have access to ARM hardware). -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------ --------------080808080908000402090208 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 615 Index: hal/arm/arch/current/src/vectors.S =================================================================== --- hal/arm/arch/current/src/vectors.S (revision 3391) +++ hal/arm/arch/current/src/vectors.S (working copy) @@ -539,7 +539,8 @@ tst r1,#CPSR_THUMB_ENABLE subeq r0,lr,#4 // PC at time of SWI (ARM) subne r0,lr,#2 // PC at time of SWI (thumb) - mov r2,#CYGNUM_HAL_EXCEPTION_INTERRUPT + mov r2,#CYGNUM_HAL_EXCEPTION_SOFTWARE_INTERRUPT + mov r3,sp b call_exception_handler .code 32 --------------080808080908000402090208 Content-Type: text/plain; charset=us-ascii Content-length: 148 -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss --------------080808080908000402090208--