This is the mail archive of the
ecos-devel@sources.redhat.com
mailing list for the eCos project.
Sv: cyg_drv_interrupt_create() troubles
Now, maybe this is because itīs friday - maybe because Iīve gone blind, but...
cyg_interrupt_create() creates a Cyg_Interrupt object with new().
A parameter is passed to new, this parameter is the intr parameter that was passed to cyg_interrupt_create.
In my ethernet driver (the NE2000 port) this parameter is given as a pointer to a cyg_interrupt struct in the driverīs private data area.
cyg_interrupt looks to me as a symbolic placeholder and nothing else.
Q: What is the purpose of this pointer being passed to new?
Normally such a parameter to new would be a typename of the object to allocate, but in this case it is an instance of a struct.
Could someone please help me out here?
- Stephen
----- Original Message -----
From: Jonathan Larmour <jifl@eCosCentric.com>
To: Stephen Mose Aaskov <sma@2m.dk>
Cc: <ecos-devel@sources.redhat.com>
Sent: Thursday, October 03, 2002 5:10 PM
Subject: Re: cyg_drv_interrupt_create() troubles
> Stephen Mose Aaskov wrote:
> > Iīm working on a port of a NE2000 driver to our platform (MIPS R3000,
> > Davicom Eth. controller).
> >
> > Currently I experience that the board crashes emidiatly after the call
> > to cyg_drv_interrupt_create() in the driver_init function. If I wrap
> > the code in cyg_interrupt_disable()/enable I can defer the crash to
> > after the cyg_interrupt_enable() call.
> >
> > However, as I understand no activity involving the interrupt handler
> > and interrupts should be possible until after a call to
> > ..._interrupt_attach(). So all I have is a newly created interrupt
> > object, that still manages to crash the board.
> >
> > Anyone eager to help out a bit here??
>
> That's very odd. As you say, cyg_drv_interrupt_create() isn't meant to
> really _do_ anything, only cyg_drv_interrupt_attach() is. You should still
> be able to single step through that code even with ints disabled if you
> set a breakpoint before it. Check that the interrupt vector is being set
> up in the right place.
>
> Enable CYGPKG_INFRA_DEBUG which will (among other things) show if you get
> any unhandled interrupts.
>
> Another option is something tangential like you are scribbling over memory
> (and that memory _does_ contain something relevant for handling other
> interrupts). Check all the locations you are passing in are valid.
> Similarly check you aren't running out of stack.
>
> I take it when you run with GDB it's not actually stopping with a SEGV or
> SIGBUS then?
>
> Jifl
> --
> eCosCentric http://www.eCosCentric.com/ <info@eCosCentric.com>
> --[ "You can complain because roses have thorns, or you ]--
> --[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine
>
>