R_RTOS
0.1
DistributedRealTimeOperatingSystemfortheARMCortexMArchitecture
|
Service calls, which can be used by/inside tasks. More...
#include "R_RTOS_inc.h"
Go to the source code of this file.
Macros | |
#define | INPUT_ARG_1(input) __asm volatile( "movs r0, %0 \n"::"l"(input) :) |
Sets input as the first input argument for a following function call. More... | |
#define | INPUT_ARG_2(input) __asm volatile( "movs r1, %0 \n"::"l"(input) :) |
Sets input as the second input argument for a following function call. More... | |
#define | INPUT_ARG_3(input) __asm volatile( "movs r2, %0 \n"::"l"(input) :) |
Sets input as the third input argument for a following function call. More... | |
#define | INPUT_ARG_4(input) __asm volatile( "movs r3, %0 \n"::"l"(input) :) |
Sets input as the fourth input argument for a following function call. More... | |
#define | OUTPUT_ARG(output) __asm volatile( "mrs r1, msp \n ldr r0, [r1] \n movs %0, r0 \n":"=l"(output): :"memory") |
Retrieves an return value from a preceding function call and stores it into output. More... | |
#define | SVC(svcCode) __asm volatile( "svc %[svc_code] \n" : : [svc_code]"I"(svcCode) : ) |
SVC Call with the given svcCode. More... | |
Service calls, which can be used by/inside tasks.
#define INPUT_ARG_1 | ( | input | ) | __asm volatile( "movs r0, %0 \n"::"l"(input) :) |
Sets input as the first input argument for a following function call.
[in] | input | input argument - max uint32_t |
When a function is called the Parameters are passed through the the registers r0-r3. To mimic the behavior of such a regular function call, one can manually put the arguments into the corresponding registers.
The first argument will be stored in R0.
#define INPUT_ARG_2 | ( | input | ) | __asm volatile( "movs r1, %0 \n"::"l"(input) :) |
Sets input as the second input argument for a following function call.
[in] | input | input argument - max uint32_t |
When a function is called the Parameters are passed through the the registers r0-r3. To mimic the behavior of such a regular function call, one can manually put the arguments into the corresponding registers.
The second argument will be stored in R1.
#define INPUT_ARG_3 | ( | input | ) | __asm volatile( "movs r2, %0 \n"::"l"(input) :) |
Sets input as the third input argument for a following function call.
[in] | input | input argument - max uint32_t |
When a function is called the Parameters are passed through the the registers r0-r3. To mimic the behavior of such a regular function call, one can manually put the arguments into the corresponding registers.
The third argument will be stored in R2.
#define INPUT_ARG_4 | ( | input | ) | __asm volatile( "movs r3, %0 \n"::"l"(input) :) |
Sets input as the fourth input argument for a following function call.
[in] | input | input argument - max uint32_t |
When a function is called the Parameters are passed through the the registers r0-r3. To mimic the behavior of such a regular function call, one can manually put the arguments into the corresponding registers.
The fourth argument will be stored in R3.
#define OUTPUT_ARG | ( | output | ) | __asm volatile( "mrs r1, msp \n ldr r0, [r1] \n movs %0, r0 \n":"=l"(output): :"memory") |
Retrieves an return value from a preceding function call and stores it into output.
[out] | output | output argument - max uint32_t |
When a function returns the return value is stored in r0. To mimic the behavior of such a regular function return, one can manually retrieve the return value from the exception stack frame stored using the msp. Register r0 is the last valued pushed onto the stack, thus it is the first value to pop off the stack.
#define SVC | ( | svcCode | ) | __asm volatile( "svc %[svc_code] \n" : : [svc_code]"I"(svcCode) : ) |
SVC Call with the given svcCode.
[in] | svcCode | number of the SVC Call to be called |
To make a SuperVisorCall the svc instruction has to be executed. A byte value can be passed alongside to further distinct the requested service.