MyOS Kernel
|
#include <sys/types.h>
#include <stddef.h>
#include "tasking.h"
#include "rpc.h"
#include "pmem.h"
#include "cpu/paging.h"
#include "cpu/arch_consts.h"
#include "kmalloc.h"
#include <string.h>
#include "cpu/serial.h"
Data Structures | |
struct | rpc_waiting_thread |
Functions | |
static void | mark_init (pid_t pid) |
static void | clear_init (pid_t pid) |
static char | is_init (pid_t pid) |
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 () |
Variables | |
rpc_func_info * | process_funcs [32768] ={NULL} |
Pointers to a list of registered functions for each process. | |
size_t | process_num_funcs [32768] ={0} |
The number of functions each process has registered. | |
char | process_ready_bmap [32768/8] ={0} |
A bitmap of processes that have completed RPC init. | |
rpc_waiting_thread * | waiting_thread_list =NULL |
A linked list of threads waiting for a process to finish RPC init. | |
|
static |
Mark a process as not ready to accept RPC calls
pid | The pid to mark |
|
static |
Check if a process is ready to accept RPC calls
pid | The pid to check |
size_t kernel_get_num_rpc_funcs | ( | pid_t | pid | ) |
Get the number of RPC functions a process has registers
pid | The PID of the process |
void* kernel_rpc_call | ( | pid_t | pid, |
char * | name, | ||
void * | buf, | ||
size_t | size | ||
) |
Call an RPC function
pid | The PID of the process with the RPC function |
name | The name of the function to call |
buf | The argument buffer to provide |
size | The size of the argument buffer |
void kernel_rpc_deallocate_buf | ( | void * | buf, |
size_t | size | ||
) |
Deallocate an RPC return buffer
buf | The buffer to deallocate |
size | The size of the buffer to deallocate |
void kernel_rpc_mark_as_init | ( | ) |
Mark the current process as ready to accept RPC calls
void kernel_rpc_register_func | ( | char * | name, |
rpc_func | code | ||
) |
Register an RPC function
name | The name of the function |
code | The code of the function |
void kernel_rpc_return | ( | void * | buf, |
size_t | size | ||
) |
Set the RPC return buffer for the calling thread & unblock the calling thread
buf | The return buffer |
size | The size of the return buffer |
|
static |
Mark a process as ready to accept RPC calls
pid | The pid to mark |