I'm developing some code for a PowerPC (mpc55x) with the gnu gcc. I'm using the decrementer to generate a periodic interrupt that should execute a C-routing.
How can I write the address of this function into the Interrupt-vector-Table (IVOR10)?
If you are asking about the method to invoke the function that you have written by using IVT, then you have to have a jump to that address in the IVT if the routine is big else, you can code it there itself.
Here is a sample from a uCOS RTOS gcc port for the mpc555. This decrementer code may be slightly more complicated than you need because it adjusts for decrementer overflow to keep the tick in sync with real time.
Sorry, was in a rush. Of course you are right. Here is the .s code. BTW, prologue and epilogue are macros that save and restore the stack frame. Remember that this example is uC/OS-II specific. You may have to adjust. Send me a direct email and I will send you the files.
I've found the missing part to get my code working:
First one has to define a line like this (ass shown in AN3524SW): /* Interrupt Handler Parameters */ __IV_ADDR = ADDR(.xcptn);
in the linker file.
Then this must be added in handler.s: .equ IV_ADDR, __IV_ADDR .org IV_ADDR
because the ISR must be close together.
Somewhere in the code (during the initialization) the addresses of the ISR must be written into the corresponding special function registers: asm ("lis r5, __IV_ADDR@h"); asm ("mtivrp r5 "); asm ("lis r5, IVOR10Handler@h"); asm ("ori r5, r5, IVOR10Handler@l"); asm ("mtivor10 r5");
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.