Thread * current_thread
Currently running thread.
Definition: tasking.c:23
int num_threads
The number of threads in this process.
Definition: tasking.h:37
struct Thread * prev_thread_in_process
The previous thread in the process.
Definition: tasking.h:53
@ THREAD_WAITING_FOR_RPC_INIT
The state of a thread waiting for a process to fully initilaize it's RPC functions.
Definition: tasking.h:23
pid_t tasking_get_rpc_calling_thread(pid_t *tid)
Definition: tasking.c:366
void * rpc_ret_buf
The return buffer of the RPC call that the thread made.
Definition: tasking.h:59
void * tasking_get_address_space(pid_t pid)
Definition: tasking.c:356
char tasking_check_proc_exists(pid_t pid)
Definition: tasking.c:386
pid_t rpc_calling_pid
The PID of the thread that called this RPC (only used for RPC handler threads)
Definition: tasking.h:57
thread_state state
The state of this thread. (running,ready to run,blocked,etc.)
Definition: tasking.h:50
int * tasking_get_errno_address()
Definition: tasking.c:143
void tasking_yield()
Definition: tasking.c:214
int num_threads_blocked
The number of blocked threads in this process.
Definition: tasking.h:38
thread_state
Definition: tasking.h:17
pid_t tasking_new_thread(void *start, pid_t pid, void *param)
Definition: tasking.c:147
@ THREAD_WAITING_FOR_RPC
The state of a thread waiting for an RPC call to return.
Definition: tasking.h:22
@ THREAD_BLOCKED
The state of a generically blocked thread.
Definition: tasking.h:21
@ THREAD_RUNNING
The state of a running thread.
Definition: tasking.h:18
struct Thread * next_thread_in_process
The next thread in the process.
Definition: tasking.h:52
pid_t tasking_get_TID()
Definition: tasking.c:139
Process * process
The thread's process.
Definition: tasking.h:56
pid_t next_tid
The TID that the next created thread will use.
Definition: tasking.h:36
void tasking_thread_exit()
Definition: tasking.c:382
char tasking_is_privleged()
Definition: tasking.c:131
pid_t tid
The TID of this thread.
Definition: tasking.h:49
void tasking_unblock(pid_t pid, pid_t tid)
Definition: tasking.c:306
void tasking_set_rpc_calling_thread(pid_t pid, pid_t tid)
Definition: tasking.c:360
pid_t tasking_get_PID()
Definition: tasking.c:135
void tasking_exit(int code)
Definition: tasking.c:321
pid_t rpc_calling_tid
The TID of the thread that called this RPC (only used for RPC handler threads)
Definition: tasking.h:58
@ THREAD_EXITED
The state of an exited thread.
Definition: tasking.h:20
char priv
Whether the process is privileged (can execute syscalls to acesss all of memory/has acess to IO ports...
Definition: tasking.h:34
void * kernel_esp
The thread's kernel stack.
Definition: tasking.h:46
struct Thread * first_thread
A pointer to the head of the linked list of threads for this process.
Definition: tasking.h:39
void tasking_create_task(void *eip, void *address_space, char kmode, void *param1, void *param2, char isThread)
Definition: tasking.c:90
void tasking_block(thread_state newstate)
Definition: tasking.c:244
pid_t pid
The PID of this process.
Definition: tasking.h:35
void * tasking_get_rpc_ret_buf()
Definition: tasking.c:378
void tasking_set_rpc_ret_buf(void *buf)
Definition: tasking.c:371
struct Thread * next_ready_to_run
If the thread is in the ready to run list, this is the next ready to run thread. (potentially in a di...
Definition: tasking.h:54
int errno
The errno value for this thread.
Definition: tasking.h:51
void tasking_init()
Definition: tasking.c:123
void * kernel_esp_top
The top of the thread's kernel stack.
Definition: tasking.h:47
struct Thread * prev_ready_to_run
If the thread is in the ready to run list, this is the previous ready to run thread....
Definition: tasking.h:55
void * address_space
The address space of this thread. (it is in here and not in the process to simplify the task switch a...
Definition: tasking.h:48
@ THREAD_READY
The state of a ready to run thread.
Definition: tasking.h:19