From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30977 invoked by alias); 9 Apr 2008 08:20:34 -0000 Received: (qmail 30962 invoked by uid 22791); 9 Apr 2008 08:20:33 -0000 X-Spam-Check-By: sourceware.org Received: from bay0-omc1-s35.bay0.hotmail.com (HELO bay0-omc1-s35.bay0.hotmail.com) (65.54.246.107) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 09 Apr 2008 08:19:58 +0000 Received: from BAY121-W25 ([207.46.10.60]) by bay0-omc1-s35.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 9 Apr 2008 01:19:57 -0700 Message-ID: From: trollepi jj To: Bart Veer CC: Date: Wed, 09 Apr 2008 09:10:00 -0000 In-Reply-To: References: Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes 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/msg00146.txt.bz2 Hi, We have successfully implement the same mecanism (a kind of softirq) on the= synthetic target. We modify and add some structures to meet the requiremen= ts of linux signal implementation. But we have a conception question : Why do you coding the call of the syscall in the file syscall-i386-linux-1.= 0.S? Is it impossible for the synthetic to call directly a syscall (confusi= on between gnu/linux libC and eCos lib, stack issues)? Best regards ---------------------------------------- > Date: Thu, 3 Apr 2008 14:23:53 +0100 > From: bartv@ecoscentric.com > To: jackoaway@hotmail.com > CC: ecos-discuss@ecos.sourceware.org > Subject: Re: [ECOS] how work synthetic for exceptions >=20 >>>>>> "jjp" =3D=3D trollepi jj writes: >=20 > jjp> Hi, > jjp> I try do modify the execution of a thread for the synthetic > jjp> target. I've done that for an at91 board (using SWI,exception > jjp> hanler and HAL_SavedRegisters to store the context info). I > jjp> put an exception handler for the CYG_HAL_SYS_SIGILL to see if > jjp> i get the info pointers of the handler (3rd parameter of the > jjp> function). I reach the exception handler and have this > jjp> backtrace call from gdb >=20 > jjp> #0 simple_syscall_handler (data=3D2, number=3D0, info=3D0) at m= ain.c:56 > jjp> #1 0x01004c7c in Cyg_Exception_Control::deliver_exception (this= =3D0x2004560, exception_number=3D0,=20 > jjp> exception_info=3D0) at /home/pitrolle/ecos/ecos/packages/ker= nel/current/src/common/except.cxx:235 > jjp> #2 0x010042bf in Cyg_Thread::deliver_exception (this=3D0x20004c= 0, exception_number=3D0, exception_info=3D0) > jjp> at /home/pitrolle/ecos/ecos/packages/kernel/current/src/comm= on/thread.cxx:1013 > jjp> #3 0x01004ce0 in cyg_hal_deliver_exception (code=3D0, data=3D0) > jjp> at /home/pitrolle/ecos/ecos/packages/kernel/current/src/comm= on/except.cxx:248 > jjp> #4 0x0100160d in synth_exception_sighandler (sig=3D4) > jjp> at /home/pitrolle/ecos/ecos/packages/hal/synth/arch/current/= src/synth_intr.c:460 > jjp> #5 0x01002e18 in cyg_hal_sys_restore_rt () > jjp> at /home/pitrolle/ecos/ecos/packages/hal/synth/i386linux/cur= rent/src/syscall-i386-linux-1.0.S:446 > jjp> #6 0x00000004 in ?? () > jjp> #7 0x0100418c in idle_thread_main (data=3D0) > jjp> at /home/pitrolle/ecos/ecos/packages/kernel/current/src/comm= on/thread.cxx:1231 > jjp> #8 0x01004be0 in Cyg_HardwareThread::thread_entry (thread=3D0x2= 0004c0) > jjp> at /home/pitrolle/ecos/ecos/packages/kernel/current/src/comm= on/thread.cxx:95 > jjp> #9 0x00000000 in ?? () >=20 > jjp> I have severals questions : > jjp> - What is the real aim of cyg_hal_sys_restore_rt? >=20 > From the source code (syscall-i386-linux-1.0.S): >=20 > // ----------------------------------------------------------------------= ------ > // Special support for returning from a signal handler. In theory no spec= ial > // action is needed, but with some versions of the kernel on some > // architectures that is not good enough. Instead returning has to happen > // via another system call.=20=20=20=20=20=20=20=20=20 >=20 > .align 16 > .global cyg_hal_sys_restore_rt > ... >=20 > The exact details of low-level signal handling on x86 get very messy. > Generally it is best not to worry too much about the details. >=20=09 > jjp> - If I want to get the context of the thread on the > jjp> exception handler (info about saved registers like previous > jjp> pc,sp,...) , what can i process? >=20 > Currently the synthetic target HAL does not collect this information - > it is not required for a basic implementation of the HAL > specification. What you would probably need to do is modify the > architectural HAL's synth_intr.c so that when it installs > synth_exception_sighandler() with sigaction() it uses the > CYG_HAL_SYS_SA_SIGINFO flag (man sigaction for details). Then change > the exception handler to accept two additional arguments, a > cyg_hal_sys_siginfo_t and a cyg_hal_sys_ucontext_t. Both of these > structures will need to be defined somewhere, with ucontext_t > probably going into the i386linux HAL. Then you still have to figure > out what to do with the extra information. >=20 > Note that you can probably do most/all of this in your application if > desired, if you wish to avoid modifying the eCos HAL packages. During > startup your application can use cyg_hal_sys_sigaction() to install > replacement exception handlers. >=20 > Bart >=20 > --=20 > Bart Veer eCos Configuration Architect > eCosCentric Limited The eCos experts http://www.ecoscentric.com/ > Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571 > Registered in England and Wales: Reg No 4422071. > ** Visit us at ESC Silicon Valley ** > ** April 15-17 2008, Booth 3012, San Jose McEnery Convention Center ** >=20 > --=20 > Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos > and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss >=20 _________________________________________________________________ T=E9l=E9chargez le nouveau Windows Live Messenger ! http://get.live.com/messenger/overview -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss