C Microkernel Realtime eXecutive
Realtime Operating System for Cortex-M based microcontrollers
 
Loading...
Searching...
No Matches

Implementation of RPC mechanism for ARM Cortex-M processors. More...

Functions

void rpc_return (void)
 
int os_rpc_call (unsigned long arg0, unsigned long arg1, unsigned long arg2, unsigned long arg3)
 Kernel implementation of rpc_call syscall.
 
int _rpc_call (void)
 
int os_rpc_return (uint32_t arg0, uint32_t arg1, uint32_t arg2, uint32_t arg3)
 Kernel implementation of rpc_return syscall.
 

Detailed Description

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.

Function Documentation

◆ _rpc_call()

int _rpc_call ( void  )

◆ os_rpc_call()

int os_rpc_call ( unsigned long  arg0,
unsigned long  arg1,
unsigned long  arg2,
unsigned long  arg3 
)

Kernel implementation of rpc_call syscall.

This routine performs remote procedure call. It digs for 5th and 6th argument passed to _rpc_call() on thread stack. Retrieves address of called method from service VMT and synthesizes stack frame for jumping into this method. Arguments used to call _rpc_call() are passed to callee.

◆ os_rpc_return()

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.

◆ rpc_return()

void rpc_return ( void  )