Implementation of RPC mechanism for ARM Cortex-M processors.
When running on Cortex-M, remote procedure call is performed by injecting an artificial exception frame which causes code to jump to the called routine instead of returning to where it came from. Returning will then jump into specially crafted routine, that injects rpc_return system call. This restores the previous state of caller's stack while copying the return value.
Macros | |
#define | E_VTABLE_UNKNOWN 0xFF |
Constant denoting that the VTable pointer is not valid. | |
Functions | |
void | rpc_return () |
int | os_rpc_call (uint32_t arg0, uint32_t arg1, uint32_t arg2, uint32_t arg3) |
Kernel implementation of rpc_call syscall. | |
int | _rpc_call () |
int | os_rpc_return (uint32_t arg0, uint32_t arg1, uint32_t arg2, uint32_t arg3) |
Kernel implementation of rpc_return syscall. | |
#define E_VTABLE_UNKNOWN 0xFF |
Constant denoting that the VTable pointer is not valid.
int _rpc_call | ( | ) |
int os_rpc_call | ( | uint32_t | arg0, |
uint32_t | arg1, | ||
uint32_t | arg2, | ||
uint32_t | arg3 | ||
) |
Kernel implementation of rpc_call syscall.
This syscall has to validate the RPC service and method IDs, determine the address of RPC method and owning process. Then it has to transfer the control to RPC method in a manner that:
int os_rpc_return | ( | uint32_t | arg0, |
uint32_t | arg1, | ||
uint32_t | arg2, | ||
uint32_t | arg3 | ||
) |
Kernel implementation of rpc_return syscall.
This syscall has to return the control back to the code which called rpc_call. This has to be done in a way that the calling code will be able to access the return value of the RPC method.
void rpc_return | ( | ) |