MyOS Kernel
rpc.h File Reference
#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  rpc_func_info
 

Typedefs

typedef void(* rpc_func) (void *)
 Type of an RPC function.
 

Functions

void * kernel_rpc_call (pid_t pid, char *name, void *buf, size_t size)
 
void kernel_rpc_register_func (char *name, rpc_func code)
 
void kernel_rpc_deallocate_buf (void *buf, size_t size)
 
void kernel_rpc_return (void *buf, size_t size)
 
size_t kernel_get_num_rpc_funcs (pid_t pid)
 
void kernel_rpc_mark_as_init ()
 
char kernel_rpc_is_init (pid_t pid)
 

Function Documentation

◆ kernel_get_num_rpc_funcs()

size_t kernel_get_num_rpc_funcs ( pid_t  pid)

Get the number of RPC functions a process has registers

Parameters
pidThe PID of the process
Returns
the number of RPC functions the process has registered

◆ kernel_rpc_call()

void* kernel_rpc_call ( pid_t  pid,
char *  name,
void *  buf,
size_t  size 
)

Call an RPC function

Parameters
pidThe PID of the process with the RPC function
nameThe name of the function to call
bufThe argument buffer to provide
sizeThe size of the argument buffer
Returns
the return buffer of the RPC functiom

◆ kernel_rpc_deallocate_buf()

void kernel_rpc_deallocate_buf ( void *  buf,
size_t  size 
)

Deallocate an RPC return buffer

Parameters
bufThe buffer to deallocate
sizeThe size of the buffer to deallocate

◆ kernel_rpc_is_init()

char kernel_rpc_is_init ( pid_t  pid)

Check if a process is ready to accept RPC calls

Parameters
pidThe pid to check
Returns
whether the process is ready

◆ kernel_rpc_mark_as_init()

void kernel_rpc_mark_as_init ( )

Mark the current process as ready to accept RPC calls

◆ kernel_rpc_register_func()

void kernel_rpc_register_func ( char *  name,
rpc_func  code 
)

Register an RPC function

Parameters
nameThe name of the function
codeThe code of the function

◆ kernel_rpc_return()

void kernel_rpc_return ( void *  buf,
size_t  size 
)

Set the RPC return buffer for the calling thread & unblock the calling thread

Parameters
bufThe return buffer
sizeThe size of the return buffer
Note
This function must only be called from an RPC thread