From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by ozlabs.org (Postfix) with ESMTP id 8E6EADDF01 for ; Tue, 24 Feb 2009 04:33:12 +1100 (EST) Received: by ey-out-2122.google.com with SMTP id 9so273836eyd.15 for ; Mon, 23 Feb 2009 09:33:10 -0800 (PST) MIME-Version: 1.0 Sender: sylvain.joyeau@gmail.com In-Reply-To: References: <85a5c2010902230439n1096196dr519462513bc3910d@mail.gmail.com> <85a5c2010902230648m72b63eeds70b4e7a5ec4d8c51@mail.gmail.com> Date: Mon, 23 Feb 2009 18:33:10 +0100 Message-ID: Subject: Re: Problem with decrementer interrupt From: "sjoyeau@wanadoo.fr" To: sumedh tirodkar Content-Type: multipart/alternative; boundary=0015174c14167488b00463996510 Cc: linuxppc-dev@ozlabs.org Reply-To: sjoyeau@wanadoo.fr List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --0015174c14167488b00463996510 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Sumedh, You may check the context in which your CPU in running the C code from interrupt context (ie stack pointer (r1), kernel locks disabling rescheduling etc..) and double check the IRQ originator (the decrementer) i= s acknowlegded somewhere your handler before enabling back interrupts, else your handler gets fired. -- sj 2009/2/23 sumedh tirodkar > Alright...I am trying to develop a system of my own.. > Consider that i am not using any linux kernel...I m writing some > program right from scratch......... > The major steps that i have taken are... > > 1. Started with a assembly file... > 2. Have relocated the interrupt handlers to there respective > positions...The interrupt handlers are written in assembly language... > 3. Initialised Decrementer register to get an interrupt after some > interval... > 4. Jump to some function using > > bl > > function_name_main which will have a infinite while loop.. > This works fine i.e. the interrupts(decrementer interrupt to be more > specific) work fine...I have initialised serial port to get the > output... > > Now, the problem that i am facing.... > > If in interrupt handler of the decrementer, i make a call to some C > function in some other C file...using the follwing statement... > > Dec_handler: /* I have relocated this to interrupt vector address of > decrementer interrupt*/ > /*code to print using serial port*/ > bla /*code to call some function in C file*/ > /*code to print using serial port---but i m never able to see this > output*/ > RFI > > This starts creating a problem...somehow we dont return to this code > after the end of the function_name_handler... > Consider the following code for the function_name_handler: > void function_name_handler(void) > { > /*Some action*/ > } > > So, if its possible for anyone to help me with this...please reply... > > Regards, > Sumedh > > > On Mon, Feb 23, 2009 at 8:18 PM, Matt Gessner wrote: > > > > > > On Mon, Feb 23, 2009 at 8:03 AM, sumedh tirodkar < > sumedhtirodkar@gmail.com> > > wrote: > >> > >> I am using PowerPC 7447A...I am trying to port SA-RTL on PowerPC... > > > > What I said earlier was: You need to tell people what cpu you're using, > what > > linux kernel, etc etc etc. > > > > Fine, we know the CPU. What kernel are you using? Is it ancient? > > > > I doubt the information below is going to be useful... > > > >> > >> I am using > >> > >> bla > >> > >> from the assembly code to call the function in C file...This i am > >> doing from interrupt handler of the decrementer... > >> If any more details are required, please let me know... > > > > > _______________________________________________ > Linuxppc-dev mailing list > Linuxppc-dev@ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc-dev > --=20 ------------------ Sylvain JOYEAU Freelance Engineer Software RT-OS R&D sylvain.joyeau@gmail.com T=E9l: +33-(0)667 477 052 "A good idea is one side of the coin. The other side is the practical usefulness". J. Liedke. --0015174c14167488b00463996510 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Sumedh,

You may check the context in which your CPU in running th= e C code from interrupt context (ie stack pointer (r1), kernel locks disabl= ing rescheduling etc..) and double check the IRQ originator (the decremente= r) is acknowlegded somewhere your handler before enabling back interrupts, = else your handler gets fired.

--
sj

2009/2/23 sumedh tirodkar <sumedhtirod= kar@gmail.com>
Alright...I am trying to develop a system of my own..
Consider that i am not using any linux kernel...I m writing some
program right from scratch.........
The major steps that i have taken are...

1. Started with a assembly file...
2. Have relocated the interrupt handlers to there respective
positions...The interrupt handlers are written in assembly language...
3. Initialised Decrementer register to get an interrupt after some interval= ...
4. Jump to some function using

   bl <function_name_main>

   function_name_main which will have a infinite while loop.. This works fine i.e. the interrupts(decrementer interrupt to be more
specific) work fine...I have initialised serial port to get the
output...

Now, the problem that i am facing....

If in interrupt handler of the decrementer, i make a call to some C
function in some other C file...using the follwing statement...

Dec_handler:  /* I have relocated this to interrupt vector address of<= br> decrementer interrupt*/
    /*code to print using serial port*/
    bla <function_name_handler> /*code to call some functi= on in C file*/
    /*code to print using serial port---but i m never able to se= e this output*/
    RFI

This starts creating a problem...somehow we dont return to this code
after the end of the function_name_handler...
Consider the following code for the function_name_handler:
void function_name_handler(void)
{
  /*Some action*/
}

So, if its possible for anyone to help me with this...please reply...

Regards,
Sumedh


On Mon, Feb 23, 2009 at 8:18 PM, Matt Gessner <mgessner@gmail.com> wrote:
>
>
> On Mon, Feb 23, 2009 at 8:03 AM, sumedh tirodkar <sumedhtirodkar@gmail.com>
> wrote:
>>
>> I am using PowerPC 7447A...I am trying to port SA-RTL on PowerPC..= .
>
> What I said earlier was: You need to tell people what cpu you're u= sing, what
> linux kernel, etc etc etc.
>
> Fine, we know the CPU.  What kernel are you using?  Is it an= cient?
>
> I doubt the information below is going to be useful...
>
>>
>> I am using
>>
>> bla <function_name>
>>
>> from the assembly code to call the function in C file...This i am<= br> >> doing from interrupt handler of the decrementer...
>> If any more details are required, please let me know...
>
>
_________________________= ______________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev



--
-----------= -------
Sylvain JOYEAU
Freelance Engineer
Software RT-OS R&Dsylvain.joyeau@gmail.com<= br> T=E9l: +33-(0)667 477 052
"A good idea is one side of the coin. The= other side is the practical usefulness". J. Liedke.
--0015174c14167488b00463996510--