R_RTOS
0.1
DistributedRealTimeOperatingSystemfortheARMCortexMArchitecture
|
SVC Call service routine - OS service calls. More...
SVC Call service routine - OS service calls.
Computes which stack pointer was used when the SVC Call occured. Stack pointer is saved in R0, which will later be used for unstacking and retrieving function arguments. Also the EXC_RETURN can be altered during the SVC_HandlerMain to controll into which mode this function shall exit and which stack pointer to use.
SVC Calls are used for OS service calls. They can only be called by tasks (and might be called by interrupts with lower priority than the SVC Call interrupt - !!!NOT RECOMMENDED!!!).
DO NOT NEST SVC CALLS! MAKE SURE EVERY FUNCTION INVOKED DURING AN SVC CALL DOES NOT INCLUDE ANOTHER SVC CALL!
Due to tasks only having a limited stack and of course to keep their stack as small as possible, service calls (e.g. setting a timer, taking/giving a semaphore) are outsourced into service calls. Service calls always have privileged mode and make use of the main stack pointer. Also service calls can not be interrupted (SVC Call has the highest interrupt priority).