From benjamin.heyne at uni-dortmund.de Fri Oct 9 09:46:16 2009 From: benjamin.heyne at uni-dortmund.de (Benjamin Heyne) Date: Fri, 9 Oct 2009 11:46:16 +0200 Subject: SH interrupt_handler function attribute register saving Message-ID: Hi all, I am currently implementing some interrupt routines for a SH2A device. The interrupt function is defined like this: void __attribute__ ((interrupt_handler)) INT_CMT1_CMI1(void) { //do something } Unfortunately the programm crashes after the first interrupt. When looking into the generated function entry/exit code by gcc, I noticed a mismatch between the saved and rescued registers from stack: 00002180 2F06 MOV.L R0, at -R15 00002182 2F16 MOV.L R1, at -R15 00002184 2F26 MOV.L R2, at -R15 00002186 2F36 MOV.L R3, at -R15 .... 000021A4 67F6 MOV.L @R15+,R7 000021A6 66F6 MOV.L @R15+,R6 000021A8 65F6 MOV.L @R15+,R5 000021AA 64F6 MOV.L @R15+,R4 000021AC 002B RTE 000021AE 0009 NOP Now, several questions arise: Is this a bug? Did I do something wrong? Is there any way around (except writing the routine in assembler by hand...)? -- Best regards Benjamin Heyne From ams at codesourcery.com Mon Oct 12 09:09:07 2009 From: ams at codesourcery.com (Andrew Stubbs) Date: Mon, 12 Oct 2009 10:09:07 +0100 Subject: [superh-gnu-discuss] SH interrupt_handler function attribute register saving In-Reply-To: References: Message-ID: <4AD2F233.7080908@codesourcery.com> Hi Benjamin, I am a little confused about the origin of your toolchain. Please could I ask you to post the output from gcc's --version option. Thanks Andrew On 09/10/09 10:46, Benjamin Heyne wrote: > Hi all, > I am currently implementing some interrupt routines for a SH2A device. > > The interrupt function is defined like this: > void __attribute__ ((interrupt_handler)) INT_CMT1_CMI1(void) > { > //do something > } > > Unfortunately the programm crashes after the first interrupt. When looking > into the generated function entry/exit code by gcc, I noticed a mismatch > between the saved and rescued registers from stack: > > 00002180 2F06 MOV.L R0, at -R15 > 00002182 2F16 MOV.L R1, at -R15 > 00002184 2F26 MOV.L R2, at -R15 > 00002186 2F36 MOV.L R3, at -R15 > .... > 000021A4 67F6 MOV.L @R15+,R7 > 000021A6 66F6 MOV.L @R15+,R6 > 000021A8 65F6 MOV.L @R15+,R5 > 000021AA 64F6 MOV.L @R15+,R4 > 000021AC 002B RTE > 000021AE 0009 NOP > > > Now, several questions arise: > Is this a bug? Did I do something wrong? Is there any way around (except > writing the routine in assembler by hand...)? > > -- > Best regards > Benjamin Heyne > > From benjamin.heyne at uni-dortmund.de Tue Oct 13 06:45:19 2009 From: benjamin.heyne at uni-dortmund.de (Benjamin Heyne) Date: Tue, 13 Oct 2009 08:45:19 +0200 Subject: [superh-gnu-discuss] SH interrupt_handler function attribute register saving In-Reply-To: <4AD2F233.7080908@codesourcery.com> References: <4AD2F233.7080908@codesourcery.com> Message-ID: <21610230b1b022c9280603f8d1f1b9e0.squirrel@unimail.uni-dortmund.de> > Hi Benjamin, > > I am a little confused about the origin of your toolchain. Please could > I ask you to post the output from gcc's --version option. > Hi Andrew, sorry for that. It's the current SH-Lite toolchain: sh-linux-gnu-gcc (Sourcery G++ Lite 4.3-143) 4.3.3 Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Compilation is done using options: -Os -ffixed-r13 -fno-builtin -ffreestanding -nostdinc -m3e -mb -fomit-frame-pointer -fno-stack-protector -- Best regards Benjamin Heyne From ams at codesourcery.com Tue Oct 13 09:30:52 2009 From: ams at codesourcery.com (Andrew Stubbs) Date: Tue, 13 Oct 2009 10:30:52 +0100 Subject: [superh-gnu-discuss] SH interrupt_handler function attribute register saving In-Reply-To: <21610230b1b022c9280603f8d1f1b9e0.squirrel@unimail.uni-dortmund.de> References: <4AD2F233.7080908@codesourcery.com> <21610230b1b022c9280603f8d1f1b9e0.squirrel@unimail.uni-dortmund.de> Message-ID: <4AD448CC.7070009@codesourcery.com> On 13/10/09 07:45, Benjamin Heyne wrote: > -Os -ffixed-r13 -fno-builtin -ffreestanding -nostdinc -m3e -mb > -fomit-frame-pointer -fno-stack-protector Sorry Benjamin, The current Lite release is purely for SH-4A targets. It has not been configured or tested for other SH targets. If you require support for other SH targets please contact sales at codecourcery.com. In the meantime, I suggest you write an assembler insert that saves the caller save registers, and then have that call a regular C function, without any attributes. Refer to the compiler's assembler output for how to define a function in assembler. E.g. asm (" myinterruptentrypoint: ..... ..... ....."); void myinterrupthandler () { .... } There are probably other solutions also. Andrew From ams at codesourcery.com Fri Oct 23 16:41:29 2009 From: ams at codesourcery.com (Andrew Stubbs) Date: Fri, 23 Oct 2009 17:41:29 +0100 Subject: Sourcery G++ Lite 4.4-45 for SuperH GNU/Linux now available Message-ID: <4AE1DCB9.5020503@codesourcery.com> CodeSourcery is pleased to announce the availability of a new Sourcery G++ Lite Edition release for SuperH processors. This is available for download from: http://www.codesourcery.com/sgpp/lite/superh Some of the new features in this release include: * GCC has been upgraded to 4.4.1. * Glibc has been upgraded to 2.10. * uClibc has been upgraded to 0.9.30. * GDB has been upgraded to 6.8.50. * GDB now supports post-mortem debugging using core-files. Please see the Getting Started Guide for a complete set of release notes: http://www.codesourcery.com/sgpp/lite/superh/portal/doc5782/getting-started.pdf -- Andrew Stubbs CodeSourcery From ams at codesourcery.com Tue Oct 27 10:21:49 2009 From: ams at codesourcery.com (Andrew Stubbs) Date: Tue, 27 Oct 2009 10:21:49 +0000 Subject: Hi, all In-Reply-To: <200910271042.23444.fabio.giovagnini@aurion-tech.com> References: <200910271042.23444.fabio.giovagnini@aurion-tech.com> Message-ID: <4AE6C9BD.3060009@codesourcery.com> On -10/01/37 20:59, Fabio Giovagnini wrote: > I'd like to build for my rsk 7203 code surgery tool chain > I need to build because the binary bz2 has oble mb ed m4l gcc library. > I haev some troubles during the building process. Where couls I find some step > by step guide to make the toolchain from the scratch? Hi Fabio, The complete set of commands used to build the binary toolchain are included in the source package. Naturally you will need to adjust these for your purposes. However, I think your problems may be bigger than you think. :( Building a toolchain for SH2A Linux is not going to be easy: the toolchain sources to not contain any support for the FDPIC memory model. I have heard of a FLT memory model port, but I'm not sure if that is included in these sources, or not. I've certainly never tried to build it. The good news is that you should find that toolchain as supplied is sufficient to build an SH2A Linux kernel (provided that it is new enough not to depend on libgcc). Sorry I could not be of more help Andrew Stubbs CodeSourcery From fabio.giovagnini at aurion-tech.com Tue Oct 27 14:39:27 2009 From: fabio.giovagnini at aurion-tech.com (Fabio Giovagnini) Date: Tue, 27 Oct 2009 15:39:27 +0100 Subject: Hi, all In-Reply-To: <4AE6C9BD.3060009@codesourcery.com> References: <200910271042.23444.fabio.giovagnini@aurion-tech.com> <4AE6C9BD.3060009@codesourcery.com> Message-ID: <200910271539.27969.fabio.giovagnini@aurion-tech.com> Sorry Andrew, but what the difference exactly with the toolchain mased in builroot? Thanks Alle 11:21, marted? 27 ottobre 2009, Andrew Stubbs ha scritto: > On -10/01/37 20:59, Fabio Giovagnini wrote: > > I'd like to build for my rsk 7203 code surgery tool chain > > I need to build because the binary bz2 has oble mb ed m4l gcc library. > > I haev some troubles during the building process. Where couls I find some > > step by step guide to make the toolchain from the scratch? > > Hi Fabio, > > The complete set of commands used to build the binary toolchain are > included in the source package. Naturally you will need to adjust these > for your purposes. > > However, I think your problems may be bigger than you think. :( > > Building a toolchain for SH2A Linux is not going to be easy: the > toolchain sources to not contain any support for the FDPIC memory model. > I have heard of a FLT memory model port, but I'm not sure if that is > included in these sources, or not. I've certainly never tried to build it. > > The good news is that you should find that toolchain as supplied is > sufficient to build an SH2A Linux kernel (provided that it is new enough > not to depend on libgcc). > > Sorry I could not be of more help > > Andrew Stubbs > CodeSourcery -- Fabio Giovagnini Aurion s.r.l. CF e P.IVA 00885711200 Tel. +39.335.8350919 www.aurion-tech.com account telefono VoIP skype (www.skype.com): aurion.giovagnini From ams at codesourcery.com Tue Oct 27 14:51:05 2009 From: ams at codesourcery.com (Andrew Stubbs) Date: Tue, 27 Oct 2009 14:51:05 +0000 Subject: [superh-gnu-discuss] Re: Hi, all In-Reply-To: <200910271539.27969.fabio.giovagnini@aurion-tech.com> References: <200910271042.23444.fabio.giovagnini@aurion-tech.com> <4AE6C9BD.3060009@codesourcery.com> <200910271539.27969.fabio.giovagnini@aurion-tech.com> Message-ID: <4AE708D9.7050009@codesourcery.com> On 27/10/09 14:39, Fabio Giovagnini wrote: > Sorry Andrew, > but what the difference exactly with the toolchain mased in builroot? I'm not sure I understand the question. The CodeSourcery Lite toolchain is based on the FSF tools with some custom patches for new features, bug fixes and such. It is configured and tested for SH-4A, as you know, but should work for SH-2A provided that no libgcc is required (or other libraries). That said, it has not been tested for SH-2A so the may be bugs. Hope that helps Andrew From fabio.giovagnini at aurion-tech.com Tue Oct 27 14:53:39 2009 From: fabio.giovagnini at aurion-tech.com (Fabio Giovagnini) Date: Tue, 27 Oct 2009 15:53:39 +0100 Subject: [superh-gnu-discuss] Re: Hi, all In-Reply-To: <4AE708D9.7050009@codesourcery.com> References: <200910271042.23444.fabio.giovagnini@aurion-tech.com> <200910271539.27969.fabio.giovagnini@aurion-tech.com> <4AE708D9.7050009@codesourcery.com> Message-ID: <200910271553.39927.fabio.giovagnini@aurion-tech.com> Ok. Now it is more clear Thanks Alle 15:51, marted? 27 ottobre 2009, Andrew Stubbs ha scritto: > On 27/10/09 14:39, Fabio Giovagnini wrote: > > Sorry Andrew, > > but what the difference exactly with the toolchain mased in builroot? > > I'm not sure I understand the question. > > The CodeSourcery Lite toolchain is based on the FSF tools with some > custom patches for new features, bug fixes and such. > > It is configured and tested for SH-4A, as you know, but should work for > SH-2A provided that no libgcc is required (or other libraries). That > said, it has not been tested for SH-2A so the may be bugs. > > Hope that helps > > Andrew -- Fabio Giovagnini Aurion s.r.l. CF e P.IVA 00885711200 Tel. +39.335.8350919 www.aurion-tech.com account telefono VoIP skype (www.skype.com): aurion.giovagnini From fabio.giovagnini at aurion-tech.com Tue Oct 27 14:47:38 2009 From: fabio.giovagnini at aurion-tech.com (Fabio Giovagnini) Date: Tue, 27 Oct 2009 15:47:38 +0100 Subject: Hi, all In-Reply-To: <4AE6C9BD.3060009@codesourcery.com> References: <200910271042.23444.fabio.giovagnini@aurion-tech.com> <4AE6C9BD.3060009@codesourcery.com> Message-ID: <200910271547.38149.fabio.giovagnini@aurion-tech.com> At the end, do you have to sugget me a good toolchain for rsk 7203? Thanks in advance and sorry. Alle 11:21, marted? 27 ottobre 2009, Andrew Stubbs ha scritto: > On -10/01/37 20:59, Fabio Giovagnini wrote: > > I'd like to build for my rsk 7203 code surgery tool chain > > I need to build because the binary bz2 has oble mb ed m4l gcc library. > > I haev some troubles during the building process. Where couls I find some > > step by step guide to make the toolchain from the scratch? > > Hi Fabio, > > The complete set of commands used to build the binary toolchain are > included in the source package. Naturally you will need to adjust these > for your purposes. > > However, I think your problems may be bigger than you think. :( > > Building a toolchain for SH2A Linux is not going to be easy: the > toolchain sources to not contain any support for the FDPIC memory model. > I have heard of a FLT memory model port, but I'm not sure if that is > included in these sources, or not. I've certainly never tried to build it. > > The good news is that you should find that toolchain as supplied is > sufficient to build an SH2A Linux kernel (provided that it is new enough > not to depend on libgcc). > > Sorry I could not be of more help > > Andrew Stubbs > CodeSourcery -- Fabio Giovagnini Aurion s.r.l. CF e P.IVA 00885711200 Tel. +39.335.8350919 www.aurion-tech.com account telefono VoIP skype (www.skype.com): aurion.giovagnini From ams at codesourcery.com Tue Oct 27 15:52:59 2009 From: ams at codesourcery.com (Andrew Stubbs) Date: Tue, 27 Oct 2009 15:52:59 +0000 Subject: [superh-gnu-discuss] Re: Hi, all In-Reply-To: <200910271547.38149.fabio.giovagnini@aurion-tech.com> References: <200910271042.23444.fabio.giovagnini@aurion-tech.com> <4AE6C9BD.3060009@codesourcery.com> <200910271547.38149.fabio.giovagnini@aurion-tech.com> Message-ID: <4AE7175B.6050607@codesourcery.com> On 27/10/09 14:47, Fabio Giovagnini wrote: > At the end, do you have to sugget me a good toolchain for rsk 7203? Not at present, no. :( CodeSourcery have one in development, but that won't be ready for release for some time. Andrew From fabio.giovagnini at aurion-tech.com Tue Oct 27 16:04:35 2009 From: fabio.giovagnini at aurion-tech.com (Fabio Giovagnini) Date: Tue, 27 Oct 2009 17:04:35 +0100 Subject: [superh-gnu-discuss] Re: Hi, all In-Reply-To: <4AE7175B.6050607@codesourcery.com> References: <200910271042.23444.fabio.giovagnini@aurion-tech.com> <200910271547.38149.fabio.giovagnini@aurion-tech.com> <4AE7175B.6050607@codesourcery.com> Message-ID: <200910271704.36100.fabio.giovagnini@aurion-tech.com> Thanks a lot Andrew. Alle 16:52, marted? 27 ottobre 2009, Andrew Stubbs ha scritto: > On 27/10/09 14:47, Fabio Giovagnini wrote: > > At the end, do you have to sugget me a good toolchain for rsk 7203? > > Not at present, no. :( > > CodeSourcery have one in development, but that won't be ready for > release for some time. > > Andrew -- Fabio Giovagnini Aurion s.r.l. CF e P.IVA 00885711200 Tel. +39.335.8350919 www.aurion-tech.com account telefono VoIP skype (www.skype.com): aurion.giovagnini