public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* Re: [ECOS] How DSR is executed in interrupt ?
@ 2007-09-12  8:19 ariga masahiro
  2007-09-12  8:25 ` Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: ariga masahiro @ 2007-09-12  8:19 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

Hi,

About revising eCos source,
please teach me.

I wrote in prev. mail.
> First I copied and reserved current ecos directory C:\cygwin\opt\ecos
> by renaminig C:\cygwin\opt\ecos_precvs.
> And I copied renewd source from /ecoscvs into corresponding current 
> directoy,
But after copied CVS checkout source int  C:\cygwin\opt\ecos there appeared 
\v2_0 directory and \current directory.
Like next.
Previously only
C:\cygwin\opt\ecos\ecos-2.0\packages\devs\eth\sh\etherc\v2_0\src\if_etherc.c
existed.
After copied CVS,also appeared
C:\cygwin\opt\ecos\ecos-2.0\packages\devs\eth\sh\etherc\current\src\if_etherc.c
Now how to correctly revise these sources ?
Is it possibile to modify \current source according to \v2_0 source,
and delete  \v2_0 directory,only remaining \current directory ?
Can I build without error ?
I wonder it is impossible.

Please enlighten me.

Masahiro Ariga 


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] How DSR is executed in interrupt ?
  2007-09-12  8:19 [ECOS] How DSR is executed in interrupt ? ariga masahiro
@ 2007-09-12  8:25 ` Andrew Lunn
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2007-09-12  8:25 UTC (permalink / raw)
  To: ariga masahiro; +Cc: ecos-discuss

On Wed, Sep 12, 2007 at 05:19:26PM +0900, ariga masahiro wrote:
> Hi,
>
> About revising eCos source,
> please teach me.
>
> I wrote in prev. mail.
>> First I copied and reserved current ecos directory C:\cygwin\opt\ecos
>> by renaminig C:\cygwin\opt\ecos_precvs.
>> And I copied renewd source from /ecoscvs into corresponding current 
>> directoy,

Don't copy annonvs on top of your old eCos. Keep the trees separate.
What you probably have to do is copy your new packages into the
anoncvs tree and add the new entries to the ecos.db file.

      Andrew


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* RE: [ECOS] How DSR is executed in interrupt ?
  2007-09-12  4:51       ` ariga masahiro
@ 2007-09-12  5:14         ` Paul D. DeRocco
  0 siblings, 0 replies; 8+ messages in thread
From: Paul D. DeRocco @ 2007-09-12  5:14 UTC (permalink / raw)
  To: 'ecos-discuss'

> From: ariga masahiro
>
> I am especially dubious whether it is correctly called.
> My next dubious point is that argument cpd->interrupt is
> used as eCos Vector-Table refence pointer.Is it correct to 
> pass the same 
> number to cyg_drv_interrupt_mask ? But I am sorry I can't fathom it yet.
> 
> -- my ISR routine is below
> lan91cxx_isr(cyg_vector_t vector, cyg_addrword_t data
>              /* , HAL_SavedRegisters *regs */ )
> {
>     struct eth_drv_sc *sc = (struct eth_drv_sc *)data;
>     struct lan91cxx_priv_data *cpd =
>         (struct lan91cxx_priv_data *)sc->driver_private;
> 
>     DEBUG_FUNCTION();
> 
>     INCR_STAT( interrupts );
> 
>     //20070903
>     diag_printf("ISR int=%d\n",cpd->interrupt);
> 
>     cyg_drv_interrupt_mask(cpd->interrupt);
>     cyg_drv_interrupt_acknowledge(cpd->interrupt);
>     return (CYG_ISR_HANDLED|CYG_ISR_CALL_DSR);  // Run the DSR }

The "vector" parameter is the interrupt vector number, so I don't see any
reason for wasting time casting "data" and following the chain to the
"interrupt" member.

-- 

Ciao,               Paul D. DeRocco
Paul                mailto:pderocco@ix.netcom.com 


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] How DSR is executed in interrupt ?
  2007-09-11 14:19     ` Andrew Lunn
@ 2007-09-12  4:51       ` ariga masahiro
  2007-09-12  5:14         ` Paul D. DeRocco
  0 siblings, 1 reply; 8+ messages in thread
From: ariga masahiro @ 2007-09-12  4:51 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

Hi,

Andrew wrote,
> Which SH processor do you have? Take a look at the code in
> sh*/current/src/var_misc.c:hal_interrupt_mask()
SH7709S.
In my ISR(cf.below),calling cyg_drv_interrupt_mask(cpd->interrupt),
and it is defined like next.
packages\hal\common\v2_0\include\drv_api.h(101): #define 
cyg_drv_interrupt_mask              cyg_interrupt_mask
So I presumed
packages\kernel\v2_0\src\common\kapi.cxx(590): externC void 
cyg_interrupt_mask(cyg_vector_t vector)
/* Interrupt controller access 
*/
externC void cyg_interrupt_mask(cyg_vector_t vector)
{
    Cyg_Interrupt::mask_interrupt( (cyg_vector)vector);
}
is called.
Am I mistaken ?
I am especially dubious whether it is correctly called.
My next dubious point is that argument cpd->interrupt is
used as eCos Vector-Table refence pointer.Is it correct to pass the same 
number to
cyg_drv_interrupt_mask ? But I am sorry I can't fathom it yet.

-- my ISR routine is below
lan91cxx_isr(cyg_vector_t vector, cyg_addrword_t data
             /* , HAL_SavedRegisters *regs */ )
{
    struct eth_drv_sc *sc = (struct eth_drv_sc *)data;
    struct lan91cxx_priv_data *cpd =
        (struct lan91cxx_priv_data *)sc->driver_private;

    DEBUG_FUNCTION();

    INCR_STAT( interrupts );

    //20070903
    diag_printf("ISR int=%d\n",cpd->interrupt);

    cyg_drv_interrupt_mask(cpd->interrupt);
    cyg_drv_interrupt_acknowledge(cpd->interrupt);
    return (CYG_ISR_HANDLED|CYG_ISR_CALL_DSR);  // Run the DSR
}

> You might have a firewall blocking access. Take a look at
> www.ecoscentric.com. They have daily snapshots of the CVS trunk.

I abondoned WinCvs1.2 because of executing not properly
althoug I nulled firewall.

Instead I used shell command on cygwin and could retrieve latest version( I 
think ).
I checked cvs version and learned it is 1.11.22.
I created directory for CVS and named it /ecoscvs.
I cd'ed to /ecoscvs,and used next checkout command.

cvs -z3 -d :pserver:anoncvs@ecos.sourceware.org:/cvs/ecos co -P ecos

Though appeared next warning, I ignored.
cvs checkout: warning: failed to open /home/LINK/.cvspass for reading: No 
such f
ile or directory

Followning short wait period, began downloading and outputting log
on cygwin shell window.
But little time later,it stops and never return to shell prompt.

I tried several times and I am confirmed it always stops same log posion.
I presumed it is caused by something like EOF and assumed
revised-source-proper are downloaded correctlry.

-- next is last part of log when stopped
cvs checkout: Updating ecos/packages/hal/arm/ebsa285/current/support
cvs checkout: Updating ecos/packages/hal/arm/ebsa285/current/support/linux
cvs checkout: Updating 
ecos/packages/hal/arm/ebsa285/current/support/linux/safl_util
cvs checkout: Updating ecos/packages/hal/arm/ebsa285/current/tests
cvs checkout: Updating ecos/packages/hal/arm/edb7xxx
cvs checkout: Updating ecos/packages/hal/arm/edb7xxx/current
cvs checkout: Updating ecos/packages/hal/arm/edb7xxx/current/cdl
cvs checkout: Updating ecos/packages/hal/arm/edb7xxx/current/include
cvs checkout: Updating ecos/packages/hal/arm/edb7xxx/current/include/pkgconf
cvs checkout: Updating ecos/packages/hal/arm/edb7xxx/current/misc

After that
I replaced newly-downloaded source as follows.

First I copied and reserved current ecos directory C:\cygwin\opt\ecos
by renaminig C:\cygwin\opt\ecos_precvs.
And I copied renewd source from /ecoscvs into corresponding current 
directoy,
and amended minor target-dependent changed to copied files.

Anyway this is first time I revised source using CVS,I have no confidence 
about
correct procedures.

Please enlighten me if I mistook something.

Masahiro Ariga


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] How DSR is executed in interrupt ?
  2007-09-11  2:44   ` ariga masahiro
@ 2007-09-11 14:19     ` Andrew Lunn
  2007-09-12  4:51       ` ariga masahiro
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2007-09-11 14:19 UTC (permalink / raw)
  To: ariga masahiro; +Cc: Andrew Lunn, ecos-discuss

On Tue, Sep 11, 2007 at 11:44:18AM +0900, ariga masahiro wrote:
> Hi,
>
> Thank you , Andrew,for your reply.
>
> Andrew wrote--
>> Are you sure the ISR is being called multiple times?
> Definitely.Forever repeating.
>
>> This masks the interrupt. i.e. it should disable the interrupt
>> controller from causing further interrupts from this source. The
>> interrupt is usually unmasked in the delivery function once the
>> hardware has been reprogrammed to de-assert the interrupt. Since you
>> say the DSR is not getting called, i don't see how the interrupt can
>> get unmasked and so i don't see how the ISR can be called again.....
> You are right I'm confirmed doing masking in ISR.
>
>> This suggests that cyg_drv_interrupt_mask() is not working. It is not
>> masking the interrupt. I would take a look at your HAL and check the
>> interrupt handling code.
> I studied cyg_drv_interrupt_mask() and learned it calls
> packages\kernel\v2_0\src\intr\intr.cxx(614): 
> Cyg_Interrupt::mask_interrupt(cyg_vector vector)
> But it's too complicated.
> Is there any way (like diag_printf) I could check entering this class 
> function and working correctly ?
> I couldn't break in this function in ICE.
>
> If this function is working properly , it's outside of  ISR where unmasking 
> is executed.
> Is it possible  ISR returns in VSR and  somewhere did unmask and entering 
> ISR repeatedly ?
> Since DSR was never called,I think it's somewhere except DSR.

Which SH processor do you have? Take a look at the code in
sh*/current/src/var_misc.c:hal_interrupt_mask()

I suspect the masking is not working correctly.

>> As i've said before v2_0 is very old. It could be this has been fixed
>> in newer code....
> I am desperately trying to revise source using WinCVS,but WinCVS
> can't operate properly.I still am trying.

You might have a firewall blocking access. Take a look at
www.ecoscentric.com. They have daily snapshots of the CVS trunk.

> Do I need to revise configtool also ?

Nope. 


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] How DSR is executed in interrupt ?
  2007-09-10  8:52 ` Andrew Lunn
@ 2007-09-11  2:44   ` ariga masahiro
  2007-09-11 14:19     ` Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: ariga masahiro @ 2007-09-11  2:44 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

Hi,

Thank you , Andrew,for your reply.

Andrew wrote--
> Are you sure the ISR is being called multiple times?
Definitely.Forever repeating.

> This masks the interrupt. i.e. it should disable the interrupt
> controller from causing further interrupts from this source. The
> interrupt is usually unmasked in the delivery function once the
> hardware has been reprogrammed to de-assert the interrupt. Since you
> say the DSR is not getting called, i don't see how the interrupt can
> get unmasked and so i don't see how the ISR can be called again.....
You are right I'm confirmed doing masking in ISR.

> This suggests that cyg_drv_interrupt_mask() is not working. It is not
> masking the interrupt. I would take a look at your HAL and check the
> interrupt handling code.
I studied cyg_drv_interrupt_mask() and learned it calls
packages\kernel\v2_0\src\intr\intr.cxx(614): 
Cyg_Interrupt::mask_interrupt(cyg_vector vector)
But it's too complicated.
Is there any way (like diag_printf) I could check entering this class 
function and working correctly ?
I couldn't break in this function in ICE.

If this function is working properly , it's outside of  ISR where unmasking 
is executed.
Is it possible  ISR returns in VSR and  somewhere did unmask and entering 
ISR repeatedly ?
Since DSR was never called,I think it's somewhere except DSR.

> As i've said before v2_0 is very old. It could be this has been fixed
> in newer code....
I am desperately trying to revise source using WinCVS,but WinCVS
can't operate properly.I still am trying.
 Do I need to revise configtool also ?

Masahiro Ariga

-----------------------------------------------------------------------------------
> On Mon, Sep 10, 2007 at 05:21:21PM +0900, ariga masahiro wrote:
>> Hi,
>>
>> Please help me next question ?
>>
>> I am trying to run LAN91CXX drive on interrupt,
>> and it became to enter ISR routine when IRQ3 Line is asserted.
>>
>> But it looks like IRQ3 Line is ON-State forever and never become 
>> OFF-State.
>> ISR is repetedly entered but never enter into DSR routine.
>>
>> ISR/DSR are setted like this in smsc_lan91cxx_init(),
>>    // Initialize environment, setup interrupt handler
>>    cyg_drv_interrupt_create(cpd->interrupt,
>>                            8, // Priority - what goes here?
>>                             (cyg_addrword_t)sc, //  Data item passed to
>> interrupt handler
>>                             (cyg_ISR_t *)lan91cxx_isr,
>>                             (cyg_DSR_t *)eth_drv_dsr, // The logical 
>> driver
>> DSR
>>                             &lan91cxx_interrupt_handle,
>>                             &lan91cxx_interrupt);
>>    cyg_drv_interrupt_attach(lan91cxx_interrupt_handle);
>>
>> ISR is like below,
>> static int
>> lan91cxx_isr(cyg_vector_t vector, cyg_addrword_t data
>>             /* , HAL_SavedRegisters *regs */ )
>> {
>>    struct eth_drv_sc *sc = (struct eth_drv_sc *)data;
>>    struct lan91cxx_priv_data *cpd =
>>        (struct lan91cxx_priv_data *)sc->driver_private;
>>
>>    DEBUG_FUNCTION();
>>
>>    INCR_STAT( interrupts );
>>
>>    cyg_drv_interrupt_mask(cpd->interrupt);
>>    cyg_drv_interrupt_acknowledge(cpd->interrupt);
>>    return (CYG_ISR_HANDLED|CYG_ISR_CALL_DSR);  // Run the DSR
>> }
>
> Are you sure the ISR is being called multiple times?
>
> This masks the interrupt. i.e. it should disable the interrupt
> controller from causing further interrupts from this source. The
> interrupt is usually unmasked in the delivery function once the
> hardware has been reprogrammed to de-assert the interrupt. Since you
> say the DSR is not getting called, i don't see how the interrupt can
> get unmasked and so i don't see how the ISR can be called again.....
>
> This suggests that cyg_drv_interrupt_mask() is not working. It is not
> masking the interrupt. I would take a look at your HAL and check the
> interrupt handling code.
>
>> I think /packages/io/eth/v2_0/src/net/eth_drv.c file's
>
> As i've said before v2_0 is very old. It could be this has been fixed
> in newer code....
>
>   Andrew
> 


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] How DSR is executed in interrupt ?
  2007-09-10  8:21 ariga masahiro
@ 2007-09-10  8:52 ` Andrew Lunn
  2007-09-11  2:44   ` ariga masahiro
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2007-09-10  8:52 UTC (permalink / raw)
  To: ariga masahiro; +Cc: ecos-discuss

On Mon, Sep 10, 2007 at 05:21:21PM +0900, ariga masahiro wrote:
> Hi,
>
> Please help me next question ?
>
> I am trying to run LAN91CXX drive on interrupt,
> and it became to enter ISR routine when IRQ3 Line is asserted.
>
> But it looks like IRQ3 Line is ON-State forever and never become OFF-State.
> ISR is repetedly entered but never enter into DSR routine.
>
> ISR/DSR are setted like this in smsc_lan91cxx_init(),
>    // Initialize environment, setup interrupt handler
>    cyg_drv_interrupt_create(cpd->interrupt,
>                            8, // Priority - what goes here?
>                             (cyg_addrword_t)sc, //  Data item passed to 
> interrupt handler
>                             (cyg_ISR_t *)lan91cxx_isr,
>                             (cyg_DSR_t *)eth_drv_dsr, // The logical driver 
> DSR
>                             &lan91cxx_interrupt_handle,
>                             &lan91cxx_interrupt);
>    cyg_drv_interrupt_attach(lan91cxx_interrupt_handle);
>
> ISR is like below,
> static int
> lan91cxx_isr(cyg_vector_t vector, cyg_addrword_t data
>             /* , HAL_SavedRegisters *regs */ )
> {
>    struct eth_drv_sc *sc = (struct eth_drv_sc *)data;
>    struct lan91cxx_priv_data *cpd =
>        (struct lan91cxx_priv_data *)sc->driver_private;
>
>    DEBUG_FUNCTION();
>
>    INCR_STAT( interrupts );
>
>    cyg_drv_interrupt_mask(cpd->interrupt);
>    cyg_drv_interrupt_acknowledge(cpd->interrupt);
>    return (CYG_ISR_HANDLED|CYG_ISR_CALL_DSR);  // Run the DSR
> }

Are you sure the ISR is being called multiple times? 

This masks the interrupt. i.e. it should disable the interrupt
controller from causing further interrupts from this source. The
interrupt is usually unmasked in the delivery function once the
hardware has been reprogrammed to de-assert the interrupt. Since you
say the DSR is not getting called, i don't see how the interrupt can
get unmasked and so i don't see how the ISR can be called again.....

This suggests that cyg_drv_interrupt_mask() is not working. It is not
masking the interrupt. I would take a look at your HAL and check the
interrupt handling code.

> I think /packages/io/eth/v2_0/src/net/eth_drv.c file's

As i've said before v2_0 is very old. It could be this has been fixed
in newer code....

   Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* [ECOS] How DSR is executed in interrupt ?
@ 2007-09-10  8:21 ariga masahiro
  2007-09-10  8:52 ` Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: ariga masahiro @ 2007-09-10  8:21 UTC (permalink / raw)
  To: ecos-discuss

Hi,

Please help me next question ?

I am trying to run LAN91CXX drive on interrupt,
and it became to enter ISR routine when IRQ3 Line is asserted.

But it looks like IRQ3 Line is ON-State forever and never become OFF-State.
ISR is repetedly entered but never enter into DSR routine.

ISR/DSR are setted like this in smsc_lan91cxx_init(),
    // Initialize environment, setup interrupt handler
    cyg_drv_interrupt_create(cpd->interrupt,
                            8, // Priority - what goes here?
                             (cyg_addrword_t)sc, //  Data item passed to 
interrupt handler
                             (cyg_ISR_t *)lan91cxx_isr,
                             (cyg_DSR_t *)eth_drv_dsr, // The logical driver 
DSR
                             &lan91cxx_interrupt_handle,
                             &lan91cxx_interrupt);
    cyg_drv_interrupt_attach(lan91cxx_interrupt_handle);

ISR is like below,
static int
lan91cxx_isr(cyg_vector_t vector, cyg_addrword_t data
             /* , HAL_SavedRegisters *regs */ )
{
    struct eth_drv_sc *sc = (struct eth_drv_sc *)data;
    struct lan91cxx_priv_data *cpd =
        (struct lan91cxx_priv_data *)sc->driver_private;

    DEBUG_FUNCTION();

    INCR_STAT( interrupts );

    cyg_drv_interrupt_mask(cpd->interrupt);
    cyg_drv_interrupt_acknowledge(cpd->interrupt);
    return (CYG_ISR_HANDLED|CYG_ISR_CALL_DSR);  // Run the DSR
}

According Anthony J. Massa's Book,as far as ISR returns CYG_ISR_CALL_DSR
DSR is executed.

As DSR,since I build using "net" Template,
I think /packages/io/eth/v2_0/src/net/eth_drv.c file's
eth_drv_dsr function is used.
I tested its entering by inserting diag_printf but never entered in it.

DSR is below,
eth_drv_dsr(cyg_vector_t vector,
            cyg_ucount32 count,
            cyg_addrword_t data)
{
    struct eth_drv_sc *sc = (struct eth_drv_sc *)data;

    //20070907
    diag_printf("DSR\n");

#ifdef CYGDBG_USE_ASSERTS
    // then check that this really is a "sc"
    {
        cyg_netdevtab_entry_t *t;
        for (t = &__NETDEVTAB__[0]; t != &__NETDEVTAB_END__; t++)
            if ( ((struct eth_drv_sc *)t->device_instance) == sc )
                break; // found it
        CYG_ASSERT( t != &__NETDEVTAB_END__, "eth_drv_dsr: Failed to find sc 
in NETDEVTAB" );
    }
#endif // Checking code

    sc->state |= ETH_DRV_NEEDS_DELIVERY;

    ecos_synch_eth_drv_dsr(); // [request] run delivery function for this 
dev
}

Also I assured interrupt_end is executed in VSR after subroutine call of 
ISR.

My question is that are there any way DSR is called other than above route ?

Especially I doubt about delivery operation althoug I have not fathamed its 
operation.
Is delivery operation is connected to interrupt ?

Please enlighten me.

Masahiro Ariga


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

end of thread, other threads:[~2007-09-12  8:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-12  8:19 [ECOS] How DSR is executed in interrupt ? ariga masahiro
2007-09-12  8:25 ` Andrew Lunn
  -- strict thread matches above, loose matches on Subject: below --
2007-09-10  8:21 ariga masahiro
2007-09-10  8:52 ` Andrew Lunn
2007-09-11  2:44   ` ariga masahiro
2007-09-11 14:19     ` Andrew Lunn
2007-09-12  4:51       ` ariga masahiro
2007-09-12  5:14         ` Paul D. DeRocco

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 read-only IMAP folder(s) and NNTP newsgroup(s).