I found a link to the answer you are looking for, but I sympathise how difficult it is to find information here.
The search does not allow you to view a thread as a whole… like this… https://sourceforge.net/forum/forum.php?thread_id=1351935&forum_id=382005
(This link required a bit of detective work!)
You don’t have to modify FreeRTOS kernel. You can do this like that:
void vSysIsr(void) __attribute__ ((naked));
void vSysIsr(void)
{
asm(
"push {r0}" "\n\t"
/* AT91C_PITC_PISR register address to r0 */
"ldr r0,=0xFFFFFD34" "\n\t"
"ldr r0,[r0]" "\n\t"
/* now content of AT91C_PITC_PISR register is in r0 */
"tst r0,#1" "\n\t"
/* test bit PITS in the register */
"pop {r0}" "\n\t"
/* jump to vPreemptiveTick if it is PIT interrupt */
"bne vPreemptiveTick" "\n\t"
/* if it is not PIT irq, check the rest of sources */
"b vSysIsrRest" "\n\t"
);
}
//------------------------------------------------------------------------------
/// This procedure services all system interrupt sources
/// except PIT interrupt
//------------------------------------------------------------------------------
void vSysIsrRest(void) __attribute__ ((interrupt ("IRQ")));
void vSysIsrRest(void)
{
// check if interrupt is caused by end of PDC transfer DBGU
if ((AT91C_BASE_DBGU->DBGU_CSR & AT91C_US_ENDTX) != 0)
{
vDbguIsr();
}