TNeoKernel
v1.02
|
PIC32 port implementation details
The context switch is implemented using the core software 0 interrupt. It should be configured to use the lowest priority in the system:
The interrupt priority level used by the context switch interrupt should not be configured to use shadow register sets.
src/arch/pic32/tn_arch_pic32_int_vec1.S
must be included in the main project itself, in order to dispatch vector1 (core software interrupt 0) correctly.PIC32 port supports nested interrupts. The kernel provides C-language macros for calling C-language interrupt service routines, which can use either MIPS32 or MIPS16e mode. Both software and shadow register interrupt context saving is supported. Usage is as follows:
tn_soft_isr
or tn_srs_isr
, instead of __ISR
macro.PIC32 uses a separate stack for interrupt handlers. Switching stack pointers is done automatically in the ISR handler wrapper macros. User should allocate array for interrupt stack and pass it as an argument to tn_sys_start()
. Refer to the Starting the kernel section for the usage example and additional comments.