Remote Procedure Calls

Type Definitons

typedef struct RPC_Service_t_ RPC_Service_t

typedef RPC_Method_t* VTable_t

Any function that wants to implement a RPC call has to have this signature. If function won’t have use for any of arg0arg1arg2arg3service

service Address of RPC object which was used to perform this RPC call. Works like self` variable in Python.

arg0 optional argument to RPC call. Can only be of integral 32-bit large type

arg1 optional argument to RPC call. Can only be of integral 32-bit large type

arg2 optional argument to RPC call. Can only be of integral 32-bit large type

arg3 optional argument to RPC call. Can only be of integral 32-bit large type */ typedef int (*RPC_Method_t)(RPC_Service_t

Functions

get_vtable_process(VTable_t vtable)

This function will find the process which defined this vtable.

vtable address of the vtable retrieved from the RPC object. process ID of the owning process or E_VTABLE_UNKNOWN

Returns process ID of the owning process or E_VTABLE_UNKNOWN

bool rpc_stack_push(Process_t process_id)

Registers new process ID in thread’s stack of RPC call owning processes. This stack records which process is “owning” this thread while RPC call is in effect. While RPC call can technically perform another RPC call, this is a stack rather than plain field. New member is always added on top of the stack unless stack is full.

process_id ID of the process owning the RPC method true if process was added, false if stack is already full

Returns true if process was added, false if stack is already full

int rpc_stack_pop()

Removes the most recently added entry from thread’s stack of RPC call owning processes. Will do nothing if stack is already empty. new depth of the stack. Returns 0 if stack is empty.

rpc_stack_top()

Returns the process ID of the most recently added entry in thread’s stack of RPC call owning processes. Most recently added process_ID or E_VTABLE_UNKNOWN

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

This routine performs remote procedure call. It digs for 5th and 6th argument passed to _rpc_call()_rpc_call()

int os_rpc_return(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint32_t arg3)

This routine unwinds stack frame used to call RPC method and passes return value from RPC to the caller.

This syscall has to return the control back to the code which called rpc_call

Macros

E_VTABLE_UNKNOWN

Constant denoting that the VTable pointer is not valid.

← Notifications Signal handling →