Installing ISR implementation for OpenRISC
Joel Sherrill
joel.sherrill at oarcorp.com
Tue Jul 1 13:23:46 UTC 2014
On 6/30/2014 6:51 PM, Hesham Moustafa wrote:
> Hi,
>
> I want to implement an API for OpenRISC IRQ. The hardware assumes that
> the handlers are installed at addresses 0x100 * N, meaning that every
> interrupt handler is starting at a multiple of 0x100, and each of each
> is of size 0xFF at maximum. Once an interrupt occurs, the processors
> jumps to the corresponding 0x100 * N address according to the
> interrupt type.
>
> There are some solutions I propose for the implementation of
> Install_ISR function:
>
> First, the ISR code text can be copied to the correct 0x100 * N
> address, but this will fail if the code text is longer than 0xFF.
>
> Second, the interrupt handlers at 0x100 * N can have the first
> instruction to always jumps to the next word (or any other address in
> the range of 0x100 * N : 0x100 * (N+1) - 1, which is the address of
> the ISR that the installer would write.
>
How many is N? This sounds a lot like the PowerPC. In that case, you
likely do
not want to use simple vectored because it CPU will most likely be connected
to a Programmable Interrupt Controller on a real board.
In the PowerPC, ARM, and MIPS ports, they use the PIC interrupt model.
They are similar to the OpenRISC in that they have an array of a few
instructions
which are jumped to by an ISR. Those few instructions are the ISR
preamble which
gets you to common code, which in turn gets you to the BSP PIC decoder
code.
Except for the initial ISR processing code (OpenRISC assembly) and the BSP
dependent code which reads HW to determine the source(s) and vectors
the user's ISR handler, the PIC framework will fill in the rest.
The ISR processing follows a common algorithm but the assembly code
is architecture specific.
So use the PIC model. Which BSP to look at is up for discussion. My first
suggestions would be the PowerPC and the qoriq or gen5200 BSP. They
are both reasonably recent and use the PIC framework.
> I would appreciate any other suggestions.
>
> Regards,
> Hesham
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
More information about the devel
mailing list