bool thread_is_note_pending(thread_t *thread)
Check if a thread has a note pending.
void thread_free(thread_t *thread)
Frees a thread structure.
uint64_t thread_send_note(thread_t *thread, const void *buffer, uint64_t count)
Send a note to a thread.
uint64_t thread_copy_from_user(thread_t *thread, void *dest, const void *userSrc, uint64_t length)
Safely copy data from user space.
void thread_load(thread_t *thread, interrupt_frame_t *frame)
Load state from a thread.
uint64_t thread_copy_to_user(thread_t *thread, void *dest, const void *userSrc, uint64_t length)
Safely copy data to user space.
_NORETURN void thread_jump(thread_t *thread)
Jump to a thread by calling thread_load() and then loading its interrupt frame.
uint64_t thread_load_atomic_from_user(thread_t *thread, atomic_uint64_t *userObj, uint64_t *outValue)
Atomically load a 64-bit value from a user-space atomic variable.
uint64_t thread_copy_from_user_terminated(thread_t *thread, const void *userArray, const void *terminator, uint8_t objectSize, uint64_t maxCount, void **outArray, uint64_t *outCount)
Safely copy a null-terminated array of objects from user space.
thread_t * thread_get_boot(void)
Retrieves the boot thread.
uint64_t thread_copy_from_user_pathname(thread_t *thread, pathname_t *pathname, const char *userPath)
Safely copy a string from user space and use it to initialize a pathname.
thread_t * thread_new(process_t *process)
Creates a new thread structure.
uint64_t thread_handle_page_fault(const interrupt_frame_t *frame)
Handles a page fault that occurred in the currently running thread.
void thread_save(thread_t *thread, const interrupt_frame_t *frame)
Save state to a thread.
thread_state_t
Thread state enum.
void thread_get_interrupt_frame(thread_t *thread, interrupt_frame_t *frame)
Retrieve the interrupt frame from a thread.
@ THREAD_UNBLOCKING
Has started unblocking, used to prevent the same thread being unblocked multiple times.
@ THREAD_PRE_BLOCK
Has started the process of blocking but has not yet been given to a owner cpu.
@ THREAD_BLOCKED
Is blocking and waiting in one or multiple wait queues.
@ THREAD_PARKED
Is doing nothing, not in a queue, not blocking, think of it as "other".
@ THREAD_RUNNING
Is currently running on a cpu.
@ THREAD_READY
Is ready to run and waiting to be scheduled.
__UINT64_TYPE__ tid_t
Thread Identifier.
EFI_PHYSICAL_ADDRESS buffer
A entry in a doubly linked list.
Per-thread scheduling context.
Structure to define a stack in memory.
Per thread syscall context.
Thread of execution structure.
list_entry_t processEntry
The entry for the parent process.
process_t * process
The parent process that the thread executes within.
_Atomic(thread_state_t) state
list_entry_t entry
The entry for the scheduler and wait system.
stack_pointer_t kernelStack
The kernel stack of the thread.
stack_pointer_t userStack
The user stack of the thread.
tid_t id
The thread id, unique within a process_t.