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

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.

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.
 

Macro Definition Documentation

◆ E_VTABLE_UNKNOWN

#define E_VTABLE_UNKNOWN   0xFF

Constant denoting that the VTable pointer is not valid.

Function Documentation

◆ _rpc_call()

int _rpc_call ( )

◆ os_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:

  • method called will be able to access the first four arguments given to the rpc_call() call.
  • when method returns, the os_rpc_return() is triggered and will transfer the control back
  • to the calling code and process.

◆ 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 ( )