From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 24 Oct 2008 13:53:27 +0000 (GMT) From: Gabriele Moabiti MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-107273184-1224856407=:63324" Message-ID: <258091.63324.qm@domain.hid> Subject: Re: [Xenomai-help] trap exceptions in user List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gilles Chanteperdrix , Jan Kiszka Cc: Xenomai help --0-107273184-1224856407=:63324 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I have upgraded the kernel to 2.6.24 + xenomai 2.4.5=0A=0AThe custom except= ion doesn't work as I expected.=0A=0Astatic rthal_trap_handler_t old_trap_h= andler;=0A In an the kernel driver I set:=0Aold_trap_handler =3D rthal_tra= p_catch(&custom_trap_fault);=0A the custom handler is:=0Astatic int custom= _trap_fault(unsigned event, unsigned domid, void *data)=0A{=0A if (is_my_a= pplication(...) && i_want_to_manage_exception(event)) {=0A ManageCustomE= xceptions();=0A return RTHAL_EVENT_STOP; /* 1=3DSTOP */=0A }=0A return (= (rthal_trap_handler_t) old_trap_handler)(event, domid, data);=0A}=0A=0AThe = exception 7 is passed to the xenomai exception handler (TS flag).=0A=0AI co= nsider now ManageCustomExceptions a function that do nothing.=0A=0AINT 3 or= 1=0AAdeos does what I expected. It returns and nothing done.=0AThe program= continue happy to the next instruction.=0A=0AINT 0 (divide error) or 16 (f= pu exception)=0AThe system hangs.=0AWhen I pass to xenomai It doesn't handl= e the exception and relax the thread an propagate=0Ato linux (I think as ex= pected to do).=0A[in the xnpod_trap_fault, xnpod_shadow_p is true then xnsh= adow_relax is performed so the =0A routine return 0 (RTHAL_EVENT_PROPAGATE)= ]=0A=0AIs it possible to customize such exceptions? Am I missing something?= =0A=0A Gabriele=0A=0A=0A Scopri il blog di Yahoo! Mail:=0ATrucchi, = novit=C3=A0 e scrivi la tua opinione.=0Ahttp://www.ymailblogit.com/blog --0-107273184-1224856407=:63324 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
I have upgraded the kernel to 2.6.24 + xenomai 2.4.5
=0A
The custo= m exception doesn't work as I expected.

static rthal_trap_handler_t = old_trap_handler;
  In an the kernel driver I set:
old_trap_hand= ler =3D rthal_trap_catch(&custom_trap_fault);
  the custom hand= ler is:
static int custom_trap_fault(unsigned event, unsigned domid, voi= d *data)
{
  if (is_my_application(...) && i_want_to_man= age_exception(event)) {
    ManageCustomExceptions();
=     return RTHAL_EVENT_STOP; /* 1=3DSTOP */
 }
&n= bsp;return ((rthal_trap_handler_t) old_trap_handler)(event, domid, data);}

The exception 7 is passed to the xenomai exception handler (TS f= lag).

I consider now ManageCustomExceptions a function that do nothi= ng.

INT 3 or 1
Adeos does what I expected. It returns and nothing= done.
The program continue happy to the next instruction.

INT 0 = (divide error) or 16 (fpu exception)
The system hangs.
When I pass to xenomai It doesn't handle the exception and relax= the thread an propagate
to linux (I think as expected to do).
=0A[in= the xnpod_trap_fault, xnpod_shadow_p is true then xnshadow_relax is perfor= med so the
 routine return 0 (RTHAL_EVENT_PROPAGATE)]

Is it= possible to customize such exceptions? Am I missing something?

&nbs= p;   Gabriele


=0A=0A=0A=0A
Scopri il Blog di Yahoo! Mail: trucchi, novit=C3=A0, consigli... e= scrivi la tua opinione! --0-107273184-1224856407=:63324--