From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 10 Oct 2008 16:02:09 +0000 (GMT) From: Gabriele Moabiti MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1111212992-1223654529=:87674" Message-ID: <129381.87674.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 Cc: Xenomai help --0-1111212992-1223654529=:87674 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =0A=0A=0A=0A>> It's a long story... I know anonymous mapping is better but = I have need physical contiguos memory=0A>> (not for the test of course). Th= e binary blob has fixed addresses between 1 to 16 MB so I have mapped the = =0A>To do this with RTDM, you should use rtdm_mmap_to_user, not=0A>rtdm_iom= ap_to_user. And to do this with an anonymous mapping, you simply=0A>need to= pass the address where you want the mmap to occur to mmap, and=0A>pass MAP= _FIXED to mmap flags, this is all documented in mmap manual.=0A=0AI did't s= pecify I have passed mem=3Dxxx to kernel to take the upper 16MB so I have t= o use rtdm_iomap_to_user.=0AI think the RTDM mapping works.=0A=0A>> I start= UD from the terminal and the terminal always report the right error.=0A>= =0A>Ok. Probably the I-pipe patch only calls your callback for real-time=0A= >tasks. Is the thread which runs the binary blob created with xenomai=0A>se= rvices ?=0A=0Amy_rt_task_func()=0A{=0A int 3 // This is trapped by the c= ustom exception routine (forwarded to xenomai handler). The terminal write= =0A // trace/breakpoint trap=0A}=0A=0Amy_rt_task_func()=0A{=0A = call *asm_part=0A}=0A=0Aasm_part --- (it has been copied in the first 16 = MB of user task mapped to the 16 MB kernel memory)=0A=0Aint 3 // This is no= t trapped by the custom exception routine however the a trace/breakpoint tr= ap is raised and=0A // it is written in terminal=0A---=0A=0A Gabr= iele=0A=0A=0A Scopri il blog di Yahoo! Mail:=0ATrucchi, novit=C3=A0 e = scrivi la tua opinione.=0Ahttp://www.ymailblogit.com/blog --0-1111212992-1223654529=:87674 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


>> It's a long story... I know anonymous mapping is= better but I have need physical contiguos memory
>> (not for the = test of course). The binary blob has fixed addresses between 1 to 16 MB so = I have mapped the
>To do this with RTDM, you should use rtdm_mmap_to= _user, not
>rtdm_iomap_to_user. And to do this with an anonymous mapp= ing, you simply
>need to pass the address where you want the mmap to = occur to mmap, and
>pass MAP_FIXED to mmap flags, this is all documen= ted in mmap manual.

I did't specify I have passed mem=3Dxxx to kerne= l to take the upper 16MB so I have to use rtdm_iomap_to_user.
I think th= e RTDM mapping works.

>> I start UD from the terminal and the t= erminal always report the right error.
>
>Ok. Probably the I-pi= pe patch only calls your callback for real-time
>tasks. Is the thread= which runs the binary blob created with xenomai
>services ?

m= y_rt_task_func()
{
    int 3 // This is trapped by the= custom exception routine (forwarded to xenomai handler). The terminal writ= e
            // trace/brea= kpoint trap
}

my_rt_task_func()
=0A{
=0A    = call *asm_part
=0A}
=0A
asm_part --- (it has been copied in the fi= rst 16 MB of user task mapped to the 16 MB kernel memory)

int 3 // T= his is not trapped by the custom exception routine however the a trace/brea= kpoint trap is raised and
       //  = it is written in terminal
---

    Gabriele

=

=0A=0A=0A=0A
Scopri il Blog= di Yahoo! Mail: trucchi, novit=C3=A0, consigli... e scrivi la tua opin= ione! --0-1111212992-1223654529=:87674--