linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Problem with decrementer interrupt
@ 2009-02-23  7:54 sumedh tirodkar
       [not found] ` <85a5c2010902230439n1096196dr519462513bc3910d@mail.gmail.com>
  0 siblings, 1 reply; 9+ messages in thread
From: sumedh tirodkar @ 2009-02-23  7:54 UTC (permalink / raw)
  To: linuxppc-dev

In the handler for decrementer interrupt...there is a call to a C function...
Now if the call is removed...the decrementer interrupt works perfectly fine...
But if the C function is present, then the decrementer interrupt stops
coming after say 5-6 times...
Not able to find any reasoning for the same...
Has anyone come across this kind of problem?If yes, am i missing something?

Regards,
Sumedh

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem with decrementer interrupt
       [not found] ` <85a5c2010902230439n1096196dr519462513bc3910d@mail.gmail.com>
@ 2009-02-23 13:03   ` sumedh tirodkar
  2009-02-23 14:48     ` Matt Gessner
  0 siblings, 1 reply; 9+ messages in thread
From: sumedh tirodkar @ 2009-02-23 13:03 UTC (permalink / raw)
  To: Matt Gessner, linuxppc-dev

I am using PowerPC 7447A...I am trying to port SA-RTL on PowerPC...
I am using

bla <function_name>

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...

Regards,
Sumedh

On Mon, Feb 23, 2009 at 6:09 PM, Matt Gessner <mgessner@gmail.com> wrote:
> You need to tell people what cpu you're using, what linux kernel, etc etc
> etc.
>
> Your email is otherwise completely useless.
>
> On Mon, Feb 23, 2009 at 2:54 AM, sumedh tirodkar <sumedhtirodkar@gmail.com>
> wrote:
>>
>> In the handler for decrementer interrupt...there is a call to a C
>> function...
>> Now if the call is removed...the decrementer interrupt works perfectly
>> fine...
>> But if the C function is present, then the decrementer interrupt stops
>> coming after say 5-6 times...
>> Not able to find any reasoning for the same...
>> Has anyone come across this kind of problem?If yes, am i missing
>> something?
>>
>> Regards,
>> Sumedh
>> _______________________________________________
>> Linuxppc-dev mailing list
>> Linuxppc-dev@ozlabs.org
>> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem with decrementer interrupt
  2009-02-23 13:03   ` sumedh tirodkar
@ 2009-02-23 14:48     ` Matt Gessner
  2009-02-23 17:04       ` sumedh tirodkar
  0 siblings, 1 reply; 9+ messages in thread
From: Matt Gessner @ 2009-02-23 14:48 UTC (permalink / raw)
  To: sumedh tirodkar; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 607 bytes --]

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 <function_name>
>
> 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...
>

[-- Attachment #2: Type: text/html, Size: 1096 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem with decrementer interrupt
  2009-02-23 14:48     ` Matt Gessner
@ 2009-02-23 17:04       ` sumedh tirodkar
  2009-02-23 17:33         ` sjoyeau
  0 siblings, 1 reply; 9+ messages in thread
From: sumedh tirodkar @ 2009-02-23 17:04 UTC (permalink / raw)
  To: Matt Gessner; +Cc: linuxppc-dev

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
decrementer interrupt*/
     /*code to print using serial port*/
     bla <function_name_handler> /*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 <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 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 <function_name>
>>
>> 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...
>
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem with decrementer interrupt
  2009-02-23 17:04       ` sumedh tirodkar
@ 2009-02-23 17:33         ` sjoyeau
  2009-02-23 18:02           ` sumedh tirodkar
  0 siblings, 1 reply; 9+ messages in thread
From: sjoyeau @ 2009-02-23 17:33 UTC (permalink / raw)
  To: sumedh tirodkar; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 3213 bytes --]

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) is
acknowlegded somewhere your handler before enabling back interrupts, else
your handler gets fired.

--
sj

2009/2/23 sumedh tirodkar <sumedhtirodkar@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
> decrementer interrupt*/
>     /*code to print using serial port*/
>     bla <function_name_handler> /*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 <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 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 <function_name>
> >>
> >> 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
>



-- 
------------------
Sylvain JOYEAU
Freelance Engineer
Software RT-OS R&D
sylvain.joyeau@gmail.com
Tél: +33-(0)667 477 052
"A good idea is one side of the coin. The other side is the practical
usefulness". J. Liedke.

[-- Attachment #2: Type: text/html, Size: 4271 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem with decrementer interrupt
  2009-02-23 17:33         ` sjoyeau
@ 2009-02-23 18:02           ` sumedh tirodkar
  2009-02-24  7:54             ` sjoyeau
  0 siblings, 1 reply; 9+ messages in thread
From: sumedh tirodkar @ 2009-02-23 18:02 UTC (permalink / raw)
  To: sjoyeau; +Cc: linuxppc-dev

I have initialised to stack pointer(r1) properly...actually...i went
thru the object dump...bt when i juz use

  bla <function_name_handler>

the link register is not getting pushed on to the stack in the prolog
of that function...so the stack is basically not coming into the
picture...
@IRQ originator, that doesn't seem to be a problem...

The only thing that i am able to think of is that when i do a "bla",
the return address is not getting stored in link register...and i m
not able to figure out why...

Regards,
Sumedh

On Mon, Feb 23, 2009 at 11:03 PM, sjoyeau@wanadoo.fr <sjoyeau@wanadoo.fr> w=
rote:
> 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)=
 is
> acknowlegded somewhere your handler before enabling back interrupts, else
> your handler gets fired.
>
> --
> sj
>
> 2009/2/23 sumedh tirodkar <sumedhtirodkar@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
>> decrementer interrupt*/
>>     /*code to print using serial port*/
>>     bla <function_name_handler> /*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 <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 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 <function_name>
>> >>
>> >> 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
>
>
>
> --
> ------------------
> 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.
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem with decrementer interrupt
  2009-02-23 18:02           ` sumedh tirodkar
@ 2009-02-24  7:54             ` sjoyeau
  2009-02-24 11:53               ` sumedh tirodkar
  0 siblings, 1 reply; 9+ messages in thread
From: sjoyeau @ 2009-02-24  7:54 UTC (permalink / raw)
  To: sumedh tirodkar; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 4867 bytes --]

Sumedh,

I've just noticed you are using the "bla" instruction, which use absolute
target address: are you sure the C code gets even be executed ?
I don't know how the compiler successfully assemble your code because the
binary is supposed to be position independant code (PIC): you should rather
use "bl" instruction (relative branch).

--
sj

2009/2/23 sumedh tirodkar <sumedhtirodkar@gmail.com>

>
> I have initialised to stack pointer(r1) properly...actually...i went
> thru the object dump...bt when i juz use
>
>  bla <function_name_handler>
>
> the link register is not getting pushed on to the stack in the prolog
> of that function...so the stack is basically not coming into the
> picture...
> @IRQ originator, that doesn't seem to be a problem...
>
> The only thing that i am able to think of is that when i do a "bla",
> the return address is not getting stored in link register...and i m
> not able to figure out why...
>
> Regards,
> Sumedh
>
> On Mon, Feb 23, 2009 at 11:03 PM, sjoyeau@wanadoo.fr <sjoyeau@wanadoo.fr>
> wrote:
> > 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)
> is
> > acknowlegded somewhere your handler before enabling back interrupts, else
> > your handler gets fired.
> >
> > --
> > sj
> >
> > 2009/2/23 sumedh tirodkar <sumedhtirodkar@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
> >> decrementer interrupt*/
> >>     /*code to print using serial port*/
> >>     bla <function_name_handler> /*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 <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
> 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 <function_name>
> >> >>
> >> >> 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
> >
> >
> >
> > --
> > ------------------
> > Sylvain JOYEAU
> > Freelance Engineer
> > Software RT-OS R&D
> > sylvain.joyeau@gmail.com
> > Tél: +33-(0)667 477 052
> > "A good idea is one side of the coin. The other side is the practical
> > usefulness". J. Liedke.
> >
>
>
>


-- 
------------------
Sylvain JOYEAU
Freelance Engineer
Software RT-OS R&D
sylvain.joyeau@gmail.com
Tél: +33-(0)667 477 052
"A good idea is one side of the coin. The other side is the practical
usefulness". J. Liedke.

[-- Attachment #2: Type: text/html, Size: 6691 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem with decrementer interrupt
  2009-02-24  7:54             ` sjoyeau
@ 2009-02-24 11:53               ` sumedh tirodkar
  2009-02-24 17:32                 ` sumedh tirodkar
  0 siblings, 1 reply; 9+ messages in thread
From: sumedh tirodkar @ 2009-02-24 11:53 UTC (permalink / raw)
  To: sjoyeau; +Cc: linuxppc-dev

The reason that i m using bla is that i am writing the interrupt
handler from dec_start: to dec_end:....
then i am relocating this code to its corresponding vector
location(0x900)...As this relocated code is gonna be executed on
occurrence of interrupt, i cant use bl instruction...i have to go for
bla...
The C code is getting executed for sure...hav checked this using some
debug message...But the return from that function is not
happening...somehow the link register is not getting properly
loaded...dont knw wat is the reason behind this...

Regards,
Sumedh

On Tue, Feb 24, 2009 at 1:24 PM, sjoyeau@wanadoo.fr <sjoyeau@wanadoo.fr> wr=
ote:
> Sumedh,
>
> I've just noticed you are using the "bla" instruction, which use absolute
> target address: are you sure the C code gets even be executed ?
> I don't know how the compiler successfully assemble your code because the
> binary is supposed to be position independant code (PIC): you should rath=
er
> use "bl" instruction (relative branch).
>
> --
> sj
>
> 2009/2/23 sumedh tirodkar <sumedhtirodkar@gmail.com>
>>
>> I have initialised to stack pointer(r1) properly...actually...i went
>> thru the object dump...bt when i juz use
>>
>>  bla <function_name_handler>
>>
>> the link register is not getting pushed on to the stack in the prolog
>> of that function...so the stack is basically not coming into the
>> picture...
>> @IRQ originator, that doesn't seem to be a problem...
>>
>> The only thing that i am able to think of is that when i do a "bla",
>> the return address is not getting stored in link register...and i m
>> not able to figure out why...
>>
>> Regards,
>> Sumedh
>>
>> On Mon, Feb 23, 2009 at 11:03 PM, sjoyeau@wanadoo.fr <sjoyeau@wanadoo.fr=
>
>> wrote:
>> > 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) is
>> > acknowlegded somewhere your handler before enabling back interrupts,
>> > else
>> > your handler gets fired.
>> >
>> > --
>> > sj
>> >
>> > 2009/2/23 sumedh tirodkar <sumedhtirodkar@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
>> >> decrementer interrupt*/
>> >>     /*code to print using serial port*/
>> >>     bla <function_name_handler> /*code to call some function in C
>> >> file*/
>> >>     /*code to print using serial port---but i m never able to see thi=
s
>> >> 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
>> >> > 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 <function_name>
>> >> >>
>> >> >> 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
>> >
>> >
>> >
>> > --
>> > ------------------
>> > 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.
>> >
>>
>>
>
>
>
> --
> ------------------
> 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.
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problem with decrementer interrupt
  2009-02-24 11:53               ` sumedh tirodkar
@ 2009-02-24 17:32                 ` sumedh tirodkar
  0 siblings, 0 replies; 9+ messages in thread
From: sumedh tirodkar @ 2009-02-24 17:32 UTC (permalink / raw)
  To: sjoyeau; +Cc: linuxppc-dev

I found out the problem...it was somewhere in my code...actually the
link register was getting over-written...
Thanks for help...

Regards,
Sumedh

On Tue, Feb 24, 2009 at 5:23 PM, sumedh tirodkar
<sumedhtirodkar@gmail.com> wrote:
> The reason that i m using bla is that i am writing the interrupt
> handler from dec_start: to dec_end:....
> then i am relocating this code to its corresponding vector
> location(0x900)...As this relocated code is gonna be executed on
> occurrence of interrupt, i cant use bl instruction...i have to go for
> bla...
> The C code is getting executed for sure...hav checked this using some
> debug message...But the return from that function is not
> happening...somehow the link register is not getting properly
> loaded...dont knw wat is the reason behind this...
>
> Regards,
> Sumedh
>
> On Tue, Feb 24, 2009 at 1:24 PM, sjoyeau@wanadoo.fr <sjoyeau@wanadoo.fr> =
wrote:
>> Sumedh,
>>
>> I've just noticed you are using the "bla" instruction, which use absolut=
e
>> target address: are you sure the C code gets even be executed ?
>> I don't know how the compiler successfully assemble your code because th=
e
>> binary is supposed to be position independant code (PIC): you should rat=
her
>> use "bl" instruction (relative branch).
>>
>> --
>> sj
>>
>> 2009/2/23 sumedh tirodkar <sumedhtirodkar@gmail.com>
>>>
>>> I have initialised to stack pointer(r1) properly...actually...i went
>>> thru the object dump...bt when i juz use
>>>
>>> =A0bla <function_name_handler>
>>>
>>> the link register is not getting pushed on to the stack in the prolog
>>> of that function...so the stack is basically not coming into the
>>> picture...
>>> @IRQ originator, that doesn't seem to be a problem...
>>>
>>> The only thing that i am able to think of is that when i do a "bla",
>>> the return address is not getting stored in link register...and i m
>>> not able to figure out why...
>>>
>>> Regards,
>>> Sumedh
>>>
>>> On Mon, Feb 23, 2009 at 11:03 PM, sjoyeau@wanadoo.fr <sjoyeau@wanadoo.f=
r>
>>> wrote:
>>> > Hi Sumedh,
>>> >
>>> > You may check the context in which your CPU in running the C code fro=
m
>>> > interrupt context (ie stack pointer (r1), kernel locks disabling
>>> > rescheduling etc..) and double check the IRQ originator (the
>>> > decrementer) is
>>> > acknowlegded somewhere your handler before enabling back interrupts,
>>> > else
>>> > your handler gets fired.
>>> >
>>> > --
>>> > sj
>>> >
>>> > 2009/2/23 sumedh tirodkar <sumedhtirodkar@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
>>> >>
>>> >> =A0 =A0bl <function_name_main>
>>> >>
>>> >> =A0 =A0function_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: =A0/* I have relocated this to interrupt vector address=
 of
>>> >> decrementer interrupt*/
>>> >> =A0 =A0 /*code to print using serial port*/
>>> >> =A0 =A0 bla <function_name_handler> /*code to call some function in =
C
>>> >> file*/
>>> >> =A0 =A0 /*code to print using serial port---but i m never able to se=
e this
>>> >> output*/
>>> >> =A0 =A0 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)
>>> >> {
>>> >> =A0 /*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
>>> >> > using,
>>> >> > what
>>> >> > linux kernel, etc etc etc.
>>> >> >
>>> >> > Fine, we know the CPU. =A0What kernel are you using? =A0Is it anci=
ent?
>>> >> >
>>> >> > 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
>>> >> >> 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&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.
>>> >
>>>
>>>
>>
>>
>>
>> --
>> ------------------
>> 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.
>>
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-02-24 17:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-23  7:54 Problem with decrementer interrupt sumedh tirodkar
     [not found] ` <85a5c2010902230439n1096196dr519462513bc3910d@mail.gmail.com>
2009-02-23 13:03   ` sumedh tirodkar
2009-02-23 14:48     ` Matt Gessner
2009-02-23 17:04       ` sumedh tirodkar
2009-02-23 17:33         ` sjoyeau
2009-02-23 18:02           ` sumedh tirodkar
2009-02-24  7:54             ` sjoyeau
2009-02-24 11:53               ` sumedh tirodkar
2009-02-24 17:32                 ` sumedh tirodkar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).