We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
This is the code I need to make compatible with RV.
void vPortYieldProcessor( void ) { __asm{ ADD lr, lr, #4 }; /* Perform the context switch. */ portSAVE_CONTEXT(); vTaskSwitchContext(); portRESTORE_CONTEXT(); }
With this code. I received error "lr is undefined"
After reading the manual, and probably understood incorrectly, I put declaration
#define lr __return_address()
before the above function, and received this error instead
..\..\Source\portable\Keil\ARM7\portISR.c(98): error: #1093: Must be a modifiable lvalue
Anyone can help? Thanks
It will take me sometime to digest all that, but thank you very much.
Your post will surely help me solve the problem.
Actually, that's an early version of the entry/leave code for the SVC gate of a multithreading nanokernel I'm writing for the ARM7.
I have stripped-off detailed comments to keep the code focused on the entry/exit sequences. The point I want to make is that handling the context saving/restore must be done in a way that preserves the calling context. Although it can be done with the RVCT C compiler (using the embedded assembler), it is much easier, clearer and probably faster to do that directly in assembly. But, in any case, you would probably not be able to do that in pure C code.