[ECOS] Re: ARM Assabet software interrupts

Richard Panton rpanton@3glab.com
Fri Mar 30 01:17:00 GMT 2001


On Wed, 28 Mar 2001, Vlasios Tsiatsis wrote:

> I would like to define an interrupt handler (ISR and DSR) for a software
> interrupt for the ARM processor on the assabet board.
> If i use the cyg_interrupt_create() function what should i do so that i
> install an interrupt
> handler for, say, the software interrupt #5 ?
> My problem is that i don't understand (i haven't looked at the source
> code yet) how the demultiplexing of software interrupts is done. Should
> i give the number 5 as the interrupt handler data to the
> cyg_interrupt_create() function ?

On ARM processors, you have three interrupt mechanisms - SWI (software),
IRQ (hardware, normal) and FIQ (hardware - fast). If you examine the
hal/arm/arch/current/src/vectors.S file, you will see that IRQ and FIQ are
handled by the same routine (after some initial separate glue code),
whereas SWI calls the exception handler. The IRQ/FIQ code goes on to
check the source of the interrupt, encoding this as a (small) number -
commonly called the interrupt number. This is COMPLETELY DIFFERENT from
the SWI number, which is simply a 24 bit integer encoded into the SWI
instruction.

You COULD modify the cyg_hal_report_software_interrupt() function in
hal/arm/arch/current/src/hal_misc.c to examine the register dump, extract
the address of the SWI instruction, read the instruction and extract the
SWI index, and then branch to one of various routines based upon that, but
you'll still need to modify vectors.S to allow the SWI call to return to
the main program.

-- 
Richard Panton              Systems Architect          3G Lab Ltd.
richard.panton@3glab.com    http://www.3glab.org/



More information about the Ecos-discuss mailing list