[Xenomai-help] How to access the MPC8260 register space
Configuration: MPC8260 Linux 2.4.25 IPIPE 0.9-03 Xenomai 2.1 (latest SVN version) IMMR = 0xF000 Background: - Have Linux based device driver, providing SCC/FCC transparent mode access Problem: I am new to Xenomai, and am quite exciting about the prospects of what it can offer. A user mode device driver sounds like a *nice* dream, but I ed a few more details. I have a Xenomai task that is able to intercept the the SCC2 interrupts, but now I need to figure out how to access the memory based MPC8260 registers. What is needed for a user mode Xenonmai task to access the MPC8260 register which live in 0xf..0xf002? I tried using rt_misc_get_io_region(), but didn't get too far. I think this routine is designed to access I/O space, which doesn't exist on PPC processor. Should I be using the mmap() system call? Or, is there a better approach? In kernel space, I have no trouble accessing these registers. ** The information contained in, or attached to, this e-mail, may contain confidential information and is intended solely for the use of the individual or entity to whom they are addressed and may be subject to legal privilege. If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager. Please do not copy it for any purpose, or disclose its contents to any other person. The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company. The recipient should check this e-mail and any attachments for the presence of viruses. The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email. ** ___ Xenomai-help mailing list Xenomai-help@gna.org https://mail.gna.org/listinfo/xenomai-help
Re: [Xenomai-help] 2.6 kernel module with math functions
Philippe Gerum wrote: > Cedric Herreman wrote: > > OK, > > > > I made an extra math module, copying some of the source code from newlib > > for the functions i needed. It works. > > > > Another question : if i create an application (in stead of kernel > > module) that starts a real time thread. Can i then use math functions > > inside the real time running part ? > > > > In the latency example, the sqrt function is used for displaying the > > results of the latency test. This is outside the real time task. Is it > > possible to use this call in the real time function ? Or any other > > library function (that is not performing system calls) ? > > > > Yes. RT threads in user-space have their own FPU context managed by Xenomai. As for math functions implemented in libm, they may be called from real-time threads, but if we want to be precise, we can not guarantee their worst case behaviour, you have to do a mathematical analysis of their implementation for that (sqrt is probably implemented in hardware, so you have to read intel spec to know if the max cycles count is known, but it would be strange if it was not). -- Gilles Chanteperdrix. ___ Xenomai-help mailing list Xenomai-help@gna.org https://mail.gna.org/listinfo/xenomai-help
Re: [Xenomai-help] Interrupt processing crashes in semTake
Hans-J. Ude wrote: > I'm porting an vxWorks application to Xenomai at the moment. When it comes > to interrupt handling, there is nothing in the vx skin to handle that (did i > overlook something?). Would an implementation of intConnect be enough ? With vectors and interrupts being the same thing (IVEC_TO_INUM and INUM_TO_IVEC would not change anything). > First I've tried to handle that down in the xenomai > layer but problems occured and someone advised me to use a native interrupt > task using rt_intr_wait. I did so but the program segfaults after a minute > or so. I've put a sigsegv handler with a stack backtrace function into the > code. That shows the crash happens in the internals of semTake. Is it > problematic to make skin calls (semGive in my case) from inside the native > irq handler? Is there a bug somewhere in UVM or the test program or settings > or in other words: how are interrups handled properly from the vxWorks skin? > > I've tracked the problem down to a test program which is appended to this > mail. I set up the irq number by #define to the irq of my network card. Then > made traffic by copying a large amount of files to the target system. After > about 3 interrupts the crash happens most times but this value ranges > from about 1000 to 5. I have just tried your test program and it appears to work. But I had to fix the various function prototypes (vxWorks thread functions take 10 int arguments, and irq_server is void). Add -W -Wstrict-prototypes to your compilation flags, and you will get the warnings. Appart from that, the "wrong context" issue does not seem to be a real issue, since irq_server is a valid thread context. But fixing wind_errnoset was needed anyway. I did not get any crash, but used the disk IRQ (only 150 interrupts by second or so, worse than the timer...), running a recursive ls about 10 minutes. So, I am afraid you will have to dig a bit deeper > > No clue what could be wrong. I'm using kernel 2.6.13 and xenomai 2.0.1 with > the included ipipe patch on a PIImmx running at 266 Mhz. > > The backtrace function is the only debugging function i have since remote > debugging with gdb/gdbserver is still not working properly, but i'm gonna > describe that in detail in anorter post. Here comes the program: note that at the end of sigsegv_handler, after having restored the default signal handler, you should raise SIGSEGV again so that the normal processing may be done (otherwise, the program retries the same operation and SEGV again, but who knows ?). And if you do not want to have to bother about doing all that stuff, the program "catchsegv" is your friend. -- Gilles Chanteperdrix. ___ Xenomai-help mailing list Xenomai-help@gna.org https://mail.gna.org/listinfo/xenomai-help
RE: [Xenomai-help] Newbie question about MVM
Gilles Chanteperdrix wrote > > Hi, > > I'm new to Linux and Xenomai so excuse me if my question > is trivial. > > Can I install and use the MVM on a Linux 2.4 workstation > (Red Hat RHEL > 2.1AS) > that is not patched by Adeos? > > I'm having trouble installing it and I don't know if its > because I'm > doing something wrong, > Or because its not > supposed to work... > > I've searched the internet and could not find any answers. > > My target board is PPC and I use patched Linux 2.6.13.4 > with it + > Xenomai 2.0.1 , cross > Compiled with the > flags: ARCH=ppc CROSS_COMPILE=ppc_82xx. > > Let us make it clear: even if you are cross-compiling, the > MVM will be built for your build system, not for your target > system (host system, in autotools language). > > I tried to build MVM when cross-compiling and saw no > problems. So, I guess you should try and explain us a bit > more what kind of problems you are having. > > -- > > > Gilles Chanteperdrix. > In the meantime my hard disk died, so it will probably take me a few days getting my PC running again... Thanks a lot for you help, I at least understand the MVM concept a little better now so I will try Playing around with it as soon as I have a computer again:-) Sarit. *** This email message and any attachments thereto are intended only for use by the addressee(s) named above, and may contain legally privileged and/or confidential information. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the [EMAIL PROTECTED] and destroy the original message. *** ___ Xenomai-help mailing list Xenomai-help@gna.org https://mail.gna.org/listinfo/xenomai-help
[Xenomai-help] How to access the MPC8260 register space
Configuration: MPC8260 Linux 2.4.25 IPIPE 0.9-03 Xenomai 2.1 (latest SVN version) IMMR = 0xF000 Background: - Have Linux based device driver, providing SCC/FCC transparent mode access Problem: I am new to Xenomai, and am quite exciting about the prospects of what it can offer. A user mode device driver sounds like a *nice* dream, but I ed a few more details. I have a Xenomai task that is able to intercept the the SCC2 interrupts, but now I need to figure out how to access the memory based MPC8260 registers. What is needed for a user mode Xenonmai task to access the MPC8260 register which live in 0xf..0xf002? I tried using rt_misc_get_io_region(), but didn't get too far. I think this routine is designed to access I/O space, which doesn't exist on PPC processor. Should I be using the mmap() system call? Or, is there a better approach? In kernel space, I have no trouble accessing these registers. ** The information contained in, or attached to, this e-mail, may contain confidential information and is intended solely for the use of the individual or entity to whom they are addressed and may be subject to legal privilege. If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager. Please do not copy it for any purpose, or disclose its contents to any other person. The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company. The recipient should check this e-mail and any attachments for the presence of viruses. The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email. **
Re: [Xenomai-help] Interrupt processing crashes in semTake
Hans-J. Ude wrote: > I'm porting an vxWorks application to Xenomai at the moment. When it comes > to interrupt handling, there is nothing in the vx skin to handle that (did i > overlook something?). Would an implementation of intConnect be enough ? With vectors and interrupts being the same thing (IVEC_TO_INUM and INUM_TO_IVEC would not change anything). > First I've tried to handle that down in the xenomai > layer but problems occured and someone advised me to use a native interrupt > task using rt_intr_wait. I did so but the program segfaults after a minute > or so. I've put a sigsegv handler with a stack backtrace function into the > code. That shows the crash happens in the internals of semTake. Is it > problematic to make skin calls (semGive in my case) from inside the native > irq handler? Is there a bug somewhere in UVM or the test program or settings > or in other words: how are interrups handled properly from the vxWorks skin? > > I've tracked the problem down to a test program which is appended to this > mail. I set up the irq number by #define to the irq of my network card. Then > made traffic by copying a large amount of files to the target system. After > about 3 interrupts the crash happens most times but this value ranges > from about 1000 to 5. I have just tried your test program and it appears to work. But I had to fix the various function prototypes (vxWorks thread functions take 10 int arguments, and irq_server is void). Add -W -Wstrict-prototypes to your compilation flags, and you will get the warnings. Appart from that, the "wrong context" issue does not seem to be a real issue, since irq_server is a valid thread context. But fixing wind_errnoset was needed anyway. I did not get any crash, but used the disk IRQ (only 150 interrupts by second or so, worse than the timer...), running a recursive ls about 10 minutes. So, I am afraid you will have to dig a bit deeper > > No clue what could be wrong. I'm using kernel 2.6.13 and xenomai 2.0.1 with > the included ipipe patch on a PIImmx running at 266 Mhz. > > The backtrace function is the only debugging function i have since remote > debugging with gdb/gdbserver is still not working properly, but i'm gonna > describe that in detail in anorter post. Here comes the program: note that at the end of sigsegv_handler, after having restored the default signal handler, you should raise SIGSEGV again so that the normal processing may be done (otherwise, the program retries the same operation and SEGV again, but who knows ?). And if you do not want to have to bother about doing all that stuff, the program "catchsegv" is your friend. -- Gilles Chanteperdrix.
Re: [Xenomai-help] 2.6 kernel module with math functions
Philippe Gerum wrote: > Cedric Herreman wrote: > > OK, > > > > I made an extra math module, copying some of the source code from newlib > > for the functions i needed. It works. > > > > Another question : if i create an application (in stead of kernel > > module) that starts a real time thread. Can i then use math functions > > inside the real time running part ? > > > > In the latency example, the sqrt function is used for displaying the > > results of the latency test. This is outside the real time task. Is it > > possible to use this call in the real time function ? Or any other > > library function (that is not performing system calls) ? > > > > Yes. RT threads in user-space have their own FPU context managed by Xenomai. As for math functions implemented in libm, they may be called from real-time threads, but if we want to be precise, we can not guarantee their worst case behaviour, you have to do a mathematical analysis of their implementation for that (sqrt is probably implemented in hardware, so you have to read intel spec to know if the max cycles count is known, but it would be strange if it was not). -- Gilles Chanteperdrix.