This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: cyg_drv_interrupt_create ()


>> The interrupt number. Most times these map directly to what
>> you would expect. But you can get the definitions by
>> including <cyg/hal/hal_intr.h>. Look at the header (and
>> possibly what it includes) to find the value required. Yes
>> our documentation could be improved :-|.
>
>Does it have to be defined in the <cyg/hal/hal_intr.h> header file to be
>a useable interrupt?

Yes it should.
The interrupt number you specify is an index into an interrupt table. The ARM processor only has
one IRQ and one FIQ pin and on most boards these lines are connected to an interrupt controller
(this may be part of a chip with an embedded ARM core). In the hal for the arm the interrupt routine
(hal/arm/arch/current/src/vector.S, label handle_IRQ_or_FIQ:) will call the hal_IRQ_handler function
defined in hal/arm/edb7xxx/current/src/edb7xxx_misc.c. This latter function will then query the
interrupt controller to determine where the interrupt comes from and return this as a number.
Now the IR handler in vectors.S will get the address of the function from a table (hal_interrupt_handlers)
and call the corresponding interrupt.

I don't know details about the board you are using but if you are using a free interrupt or an interrupt
not yet used/defined by eCos you should define one yourself. The only thing is that you have to make
sure that this is the same number as returned by hal_IRQ_handler.
You will also want to add this to hal/arm/edb7xxx/current/include/hal_platform_ints.h.

Best is to first have a good look at the code, I did some single stepping through the interrupt handler
before I understood what is going on (but I guess this is only possible with a hardware debugger
and not with a GDB stub).

Ps: some of the function/file names I typed myself so they may contain typo's ;-)

Hope this helps,

	Rob Jansen

Software Engineer
Competence Center Platforms
BU Mobile Communications
Meijhorst 60-10, 6537 KT Nijmegen, The Netherlands
Tel: +31-24-353-6329
Fax: +31-24-353-3613
mailto:Rob.WJ.Jansen@philips.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]